{"action":"created","comment":{"url":"https://api.github.com/repos/exercism/xruby/pulls/comments/62436054","id":62436054,"diff_hunk":"@@ -0,0 +1,37 @@\n+class Alphametics\n+  VERSION = 1\n+\n+  def solve(puzzle)\n+    letters = Hash.new(0)\n+    puzzle = format_to_ruby(puzzle)\n+    puzzle.scan(/[a-zA-Z]/) { |w| letters[w] += 1 }\n+\n+    possible_values(letters.keys) do |letters_values|\n+      return letters_values if valid?(puzzle, letters_values)\n+    end\n+\n+    nil\n+  end\n+\n+  private\n+\n+  def format_to_ruby(puzzle)\n+    puzzle.gsub(/\\^/, '**') # format exponent: 2 ^ 3 to 2 ** 3","path":"exercises/alphametics/example.rb","position":null,"original_position":19,"commit_id":"aaa625b9a4d681525ba81b9f0c41e5eba409265e","original_commit_id":"f0daa92513aa52e13b7d83e26ca347a964aa7e6e","user":{"login":"repinel","id":1685896,"avatar_url":"https://avatars.githubusercontent.com/u/1685896?v=3","gravatar_id":"","url":"https://api.github.com/users/repinel","html_url":"https://github.com/repinel","followers_url":"https://api.github.com/users/repinel/followers","following_url":"https://api.github.com/users/repinel/following{/other_user}","gists_url":"https://api.github.com/users/repinel/gists{/gist_id}","starred_url":"https://api.github.com/users/repinel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/repinel/subscriptions","organizations_url":"https://api.github.com/users/repinel/orgs","repos_url":"https://api.github.com/users/repinel/repos","events_url":"https://api.github.com/users/repinel/events{/privacy}","received_events_url":"https://api.github.com/users/repinel/received_events","type":"User","site_admin":false},"body":"Sorry, the complain was actually for `lib/alphametics_cases.rb`. Fixed.","created_at":"2016-05-08T18:09:33Z","updated_at":"2016-05-08T18:09:33Z","html_url":"https://github.com/exercism/xruby/pull/312#discussion_r62436054","pull_request_url":"https://api.github.com/repos/exercism/xruby/pulls/312","_links":{"self":{"href":"https://api.github.com/repos/exercism/xruby/pulls/comments/62436054"},"html":{"href":"https://github.com/exercism/xruby/pull/312#discussion_r62436054"},"pull_request":{"href":"https://api.github.com/repos/exercism/xruby/pulls/312"}}},"pull_request":{"url":"https://api.github.com/repos/exercism/xruby/pulls/312","id":68862906,"html_url":"https://github.com/exercism/xruby/pull/312","diff_url":"https://github.com/exercism/xruby/pull/312.diff","patch_url":"https://github.com/exercism/xruby/pull/312.patch","issue_url":"https://api.github.com/repos/exercism/xruby/issues/312","number":312,"state":"open","locked":false,"title":"[WIP] Add alphametics","user":{"login":"repinel","id":1685896,"avatar_url":"https://avatars.githubusercontent.com/u/1685896?v=3","gravatar_id":"","url":"https://api.github.com/users/repinel","html_url":"https://github.com/repinel","followers_url":"https://api.github.com/users/repinel/followers","following_url":"https://api.github.com/users/repinel/following{/other_user}","gists_url":"https://api.github.com/users/repinel/gists{/gist_id}","starred_url":"https://api.github.com/users/repinel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/repinel/subscriptions","organizations_url":"https://api.github.com/users/repinel/orgs","repos_url":"https://api.github.com/users/repinel/repos","events_url":"https://api.github.com/users/repinel/events{/privacy}","received_events_url":"https://api.github.com/users/repinel/received_events","type":"User","site_admin":false},"body":"Working on this one.","created_at":"2016-05-04T13:36:50Z","updated_at":"2016-05-08T18:09:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5e46a73edcfec35cffc9126aa5e7d01c4b1a4b92","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/exercism/xruby/pulls/312/commits","review_comments_url":"https://api.github.com/repos/exercism/xruby/pulls/312/comments","review_comment_url":"https://api.github.com/repos/exercism/xruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/exercism/xruby/issues/312/comments","statuses_url":"https://api.github.com/repos/exercism/xruby/statuses/aaa625b9a4d681525ba81b9f0c41e5eba409265e","head":{"label":"repinel:alphametics","ref":"alphametics","sha":"aaa625b9a4d681525ba81b9f0c41e5eba409265e","user":{"login":"repinel","id":1685896,"avatar_url":"https://avatars.githubusercontent.com/u/1685896?v=3","gravatar_id":"","url":"https://api.github.com/users/repinel","html_url":"https://github.com/repinel","followers_url":"https://api.github.com/users/repinel/followers","following_url":"https://api.github.com/users/repinel/following{/other_user}","gists_url":"https://api.github.com/users/repinel/gists{/gist_id}","starred_url":"https://api.github.com/users/repinel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/repinel/subscriptions","organizations_url":"https://api.github.com/users/repinel/orgs","repos_url":"https://api.github.com/users/repinel/repos","events_url":"https://api.github.com/users/repinel/events{/privacy}","received_events_url":"https://api.github.com/users/repinel/received_events","type":"User","site_admin":false},"repo":{"id":57453822,"name":"xruby","full_name":"repinel/xruby","owner":{"login":"repinel","id":1685896,"avatar_url":"https://avatars.githubusercontent.com/u/1685896?v=3","gravatar_id":"","url":"https://api.github.com/users/repinel","html_url":"https://github.com/repinel","followers_url":"https://api.github.com/users/repinel/followers","following_url":"https://api.github.com/users/repinel/following{/other_user}","gists_url":"https://api.github.com/users/repinel/gists{/gist_id}","starred_url":"https://api.github.com/users/repinel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/repinel/subscriptions","organizations_url":"https://api.github.com/users/repinel/orgs","repos_url":"https://api.github.com/users/repinel/repos","events_url":"https://api.github.com/users/repinel/events{/privacy}","received_events_url":"https://api.github.com/users/repinel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/repinel/xruby","description":"Exercism Exercises in Ruby","fork":true,"url":"https://api.github.com/repos/repinel/xruby","forks_url":"https://api.github.com/repos/repinel/xruby/forks","keys_url":"https://api.github.com/repos/repinel/xruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/repinel/xruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/repinel/xruby/teams","hooks_url":"https://api.github.com/repos/repinel/xruby/hooks","issue_events_url":"https://api.github.com/repos/repinel/xruby/issues/events{/number}","events_url":"https://api.github.com/repos/repinel/xruby/events","assignees_url":"https://api.github.com/repos/repinel/xruby/assignees{/user}","branches_url":"https://api.github.com/repos/repinel/xruby/branches{/branch}","tags_url":"https://api.github.com/repos/repinel/xruby/tags","blobs_url":"https://api.github.com/repos/repinel/xruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/repinel/xruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/repinel/xruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/repinel/xruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/repinel/xruby/statuses/{sha}","languages_url":"https://api.github.com/repos/repinel/xruby/languages","stargazers_url":"https://api.github.com/repos/repinel/xruby/stargazers","contributors_url":"https://api.github.com/repos/repinel/xruby/contributors","subscribers_url":"https://api.github.com/repos/repinel/xruby/subscribers","subscription_url":"https://api.github.com/repos/repinel/xruby/subscription","commits_url":"https://api.github.com/repos/repinel/xruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/repinel/xruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/repinel/xruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/repinel/xruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/repinel/xruby/contents/{+path}","compare_url":"https://api.github.com/repos/repinel/xruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/repinel/xruby/merges","archive_url":"https://api.github.com/repos/repinel/xruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/repinel/xruby/downloads","issues_url":"https://api.github.com/repos/repinel/xruby/issues{/number}","pulls_url":"https://api.github.com/repos/repinel/xruby/pulls{/number}","milestones_url":"https://api.github.com/repos/repinel/xruby/milestones{/number}","notifications_url":"https://api.github.com/repos/repinel/xruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/repinel/xruby/labels{/name}","releases_url":"https://api.github.com/repos/repinel/xruby/releases{/id}","deployments_url":"https://api.github.com/repos/repinel/xruby/deployments","created_at":"2016-04-30T17:24:45Z","updated_at":"2016-04-30T17:24:46Z","pushed_at":"2016-05-08T17:59:01Z","git_url":"git://github.com/repinel/xruby.git","ssh_url":"git@github.com:repinel/xruby.git","clone_url":"https://github.com/repinel/xruby.git","svn_url":"https://github.com/repinel/xruby","homepage":null,"size":704,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"exercism:master","ref":"master","sha":"79a1042023c37eab2f0cbb19141a80663045759c","user":{"login":"exercism","id":5624255,"avatar_url":"https://avatars.githubusercontent.com/u/5624255?v=3","gravatar_id":"","url":"https://api.github.com/users/exercism","html_url":"https://github.com/exercism","followers_url":"https://api.github.com/users/exercism/followers","following_url":"https://api.github.com/users/exercism/following{/other_user}","gists_url":"https://api.github.com/users/exercism/gists{/gist_id}","starred_url":"https://api.github.com/users/exercism/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exercism/subscriptions","organizations_url":"https://api.github.com/users/exercism/orgs","repos_url":"https://api.github.com/users/exercism/repos","events_url":"https://api.github.com/users/exercism/events{/privacy}","received_events_url":"https://api.github.com/users/exercism/received_events","type":"Organization","site_admin":false},"repo":{"id":17258847,"name":"xruby","full_name":"exercism/xruby","owner":{"login":"exercism","id":5624255,"avatar_url":"https://avatars.githubusercontent.com/u/5624255?v=3","gravatar_id":"","url":"https://api.github.com/users/exercism","html_url":"https://github.com/exercism","followers_url":"https://api.github.com/users/exercism/followers","following_url":"https://api.github.com/users/exercism/following{/other_user}","gists_url":"https://api.github.com/users/exercism/gists{/gist_id}","starred_url":"https://api.github.com/users/exercism/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exercism/subscriptions","organizations_url":"https://api.github.com/users/exercism/orgs","repos_url":"https://api.github.com/users/exercism/repos","events_url":"https://api.github.com/users/exercism/events{/privacy}","received_events_url":"https://api.github.com/users/exercism/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/exercism/xruby","description":"Exercism Exercises in Ruby","fork":false,"url":"https://api.github.com/repos/exercism/xruby","forks_url":"https://api.github.com/repos/exercism/xruby/forks","keys_url":"https://api.github.com/repos/exercism/xruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/exercism/xruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/exercism/xruby/teams","hooks_url":"https://api.github.com/repos/exercism/xruby/hooks","issue_events_url":"https://api.github.com/repos/exercism/xruby/issues/events{/number}","events_url":"https://api.github.com/repos/exercism/xruby/events","assignees_url":"https://api.github.com/repos/exercism/xruby/assignees{/user}","branches_url":"https://api.github.com/repos/exercism/xruby/branches{/branch}","tags_url":"https://api.github.com/repos/exercism/xruby/tags","blobs_url":"https://api.github.com/repos/exercism/xruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/exercism/xruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/exercism/xruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/exercism/xruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/exercism/xruby/statuses/{sha}","languages_url":"https://api.github.com/repos/exercism/xruby/languages","stargazers_url":"https://api.github.com/repos/exercism/xruby/stargazers","contributors_url":"https://api.github.com/repos/exercism/xruby/contributors","subscribers_url":"https://api.github.com/repos/exercism/xruby/subscribers","subscription_url":"https://api.github.com/repos/exercism/xruby/subscription","commits_url":"https://api.github.com/repos/exercism/xruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/exercism/xruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/exercism/xruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/exercism/xruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/exercism/xruby/contents/{+path}","compare_url":"https://api.github.com/repos/exercism/xruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/exercism/xruby/merges","archive_url":"https://api.github.com/repos/exercism/xruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/exercism/xruby/downloads","issues_url":"https://api.github.com/repos/exercism/xruby/issues{/number}","pulls_url":"https://api.github.com/repos/exercism/xruby/pulls{/number}","milestones_url":"https://api.github.com/repos/exercism/xruby/milestones{/number}","notifications_url":"https://api.github.com/repos/exercism/xruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/exercism/xruby/labels{/name}","releases_url":"https://api.github.com/repos/exercism/xruby/releases{/id}","deployments_url":"https://api.github.com/repos/exercism/xruby/deployments","created_at":"2014-02-27T18:11:43Z","updated_at":"2016-05-08T02:49:09Z","pushed_at":"2016-05-08T17:59:02Z","git_url":"git://github.com/exercism/xruby.git","ssh_url":"git@github.com:exercism/xruby.git","clone_url":"https://github.com/exercism/xruby.git","svn_url":"https://github.com/exercism/xruby","homepage":null,"size":26916,"stargazers_count":121,"watchers_count":121,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":129,"mirror_url":null,"open_issues_count":9,"forks":129,"open_issues":9,"watchers":121,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/exercism/xruby/pulls/312"},"html":{"href":"https://github.com/exercism/xruby/pull/312"},"issue":{"href":"https://api.github.com/repos/exercism/xruby/issues/312"},"comments":{"href":"https://api.github.com/repos/exercism/xruby/issues/312/comments"},"review_comments":{"href":"https://api.github.com/repos/exercism/xruby/pulls/312/comments"},"review_comment":{"href":"https://api.github.com/repos/exercism/xruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/exercism/xruby/pulls/312/commits"},"statuses":{"href":"https://api.github.com/repos/exercism/xruby/statuses/aaa625b9a4d681525ba81b9f0c41e5eba409265e"}}}}