{"action":"created","comment":{"url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/pulls/comments/33440075","id":33440075,"diff_hunk":"@@ -0,0 +1,39 @@\n+# We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once;\n+# for example, the 5-digit number, 15234, is 1 through 5 pandigital.\n+\n+# The product 7254 is unusual, as the identity, 39 × 186 = 7254, \n+# containing multiplicand, multiplier, and product is 1 through 9 pandigital.\n+\n+# Find the sum of all products whose multiplicand/multiplier/product identity can be written as a 1 through 9 pandigital.\n+\n+# HINT: Some products can be obtained in more than one way so be sure to only include it once in your sum.\n+\n+class Pandigital\n+  def self.calculate\n+    sum = 0\n+    product_array = []\n+    product = 0\n+    (1..2000).each do |first_num|\n+      (1..2000).each do |second_num|\n+        # total length of multipliers must be 5 for a total length of 9 digits (figured out through trial and error)\n+        if (first_num.to_s + second_num.to_s).length == 5","path":"pandigital.rb","position":19,"original_position":19,"commit_id":"833df54b7d19b5ee9be897e24bb40da2bd917e42","original_commit_id":"833df54b7d19b5ee9be897e24bb40da2bd917e42","user":{"login":"benlovell","id":41963,"avatar_url":"https://avatars.githubusercontent.com/u/41963?v=3","gravatar_id":"","url":"https://api.github.com/users/benlovell","html_url":"https://github.com/benlovell","followers_url":"https://api.github.com/users/benlovell/followers","following_url":"https://api.github.com/users/benlovell/following{/other_user}","gists_url":"https://api.github.com/users/benlovell/gists{/gist_id}","starred_url":"https://api.github.com/users/benlovell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benlovell/subscriptions","organizations_url":"https://api.github.com/users/benlovell/orgs","repos_url":"https://api.github.com/users/benlovell/repos","events_url":"https://api.github.com/users/benlovell/events{/privacy}","received_events_url":"https://api.github.com/users/benlovell/received_events","type":"User","site_admin":false},"body":"What does the magic number `5` signify here? Perhaps making this a well-named constant would increase the clarity and intent?","created_at":"2015-06-29T07:35:46Z","updated_at":"2015-06-29T07:35:46Z","html_url":"https://github.com/wegotcoders/wgc_groundwork/pull/32#discussion_r33440075","pull_request_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/wegotcoders/wgc_groundwork/pulls/comments/33440075"},"html":{"href":"https://github.com/wegotcoders/wgc_groundwork/pull/32#discussion_r33440075"},"pull_request":{"href":"https://api.github.com/repos/wegotcoders/wgc_groundwork/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/pulls/32","id":38355058,"html_url":"https://github.com/wegotcoders/wgc_groundwork/pull/32","diff_url":"https://github.com/wegotcoders/wgc_groundwork/pull/32.diff","patch_url":"https://github.com/wegotcoders/wgc_groundwork/pull/32.patch","issue_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/issues/32","number":32,"state":"open","locked":false,"title":"My completed groundwork/programming challenge","user":{"login":"cltweedie","id":11664034,"avatar_url":"https://avatars.githubusercontent.com/u/11664034?v=3","gravatar_id":"","url":"https://api.github.com/users/cltweedie","html_url":"https://github.com/cltweedie","followers_url":"https://api.github.com/users/cltweedie/followers","following_url":"https://api.github.com/users/cltweedie/following{/other_user}","gists_url":"https://api.github.com/users/cltweedie/gists{/gist_id}","starred_url":"https://api.github.com/users/cltweedie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cltweedie/subscriptions","organizations_url":"https://api.github.com/users/cltweedie/orgs","repos_url":"https://api.github.com/users/cltweedie/repos","events_url":"https://api.github.com/users/cltweedie/events{/privacy}","received_events_url":"https://api.github.com/users/cltweedie/received_events","type":"User","site_admin":false},"body":"I've solved the primes problem both with and without the built-in prime library, but as my solution without it takes around a minute to calculate the sum, the page uses the more efficient one with it. I've left my own algorithm commented out below it for reference.\r\n","created_at":"2015-06-23T16:18:22Z","updated_at":"2015-06-29T07:35:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b839727a26b09906fcdb23f1d0b7599cafe73a3b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/pulls/32/commits","review_comments_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/pulls/32/comments","review_comment_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/issues/32/comments","statuses_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/statuses/833df54b7d19b5ee9be897e24bb40da2bd917e42","head":{"label":"cltweedie:master","ref":"master","sha":"833df54b7d19b5ee9be897e24bb40da2bd917e42","user":{"login":"cltweedie","id":11664034,"avatar_url":"https://avatars.githubusercontent.com/u/11664034?v=3","gravatar_id":"","url":"https://api.github.com/users/cltweedie","html_url":"https://github.com/cltweedie","followers_url":"https://api.github.com/users/cltweedie/followers","following_url":"https://api.github.com/users/cltweedie/following{/other_user}","gists_url":"https://api.github.com/users/cltweedie/gists{/gist_id}","starred_url":"https://api.github.com/users/cltweedie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cltweedie/subscriptions","organizations_url":"https://api.github.com/users/cltweedie/orgs","repos_url":"https://api.github.com/users/cltweedie/repos","events_url":"https://api.github.com/users/cltweedie/events{/privacy}","received_events_url":"https://api.github.com/users/cltweedie/received_events","type":"User","site_admin":false},"repo":{"id":37013903,"name":"wgc_groundwork","full_name":"cltweedie/wgc_groundwork","owner":{"login":"cltweedie","id":11664034,"avatar_url":"https://avatars.githubusercontent.com/u/11664034?v=3","gravatar_id":"","url":"https://api.github.com/users/cltweedie","html_url":"https://github.com/cltweedie","followers_url":"https://api.github.com/users/cltweedie/followers","following_url":"https://api.github.com/users/cltweedie/following{/other_user}","gists_url":"https://api.github.com/users/cltweedie/gists{/gist_id}","starred_url":"https://api.github.com/users/cltweedie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cltweedie/subscriptions","organizations_url":"https://api.github.com/users/cltweedie/orgs","repos_url":"https://api.github.com/users/cltweedie/repos","events_url":"https://api.github.com/users/cltweedie/events{/privacy}","received_events_url":"https://api.github.com/users/cltweedie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cltweedie/wgc_groundwork","description":"We Got Coders Profile Viewer - Programming Challenge","fork":true,"url":"https://api.github.com/repos/cltweedie/wgc_groundwork","forks_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/forks","keys_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/teams","hooks_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/hooks","issue_events_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/issues/events{/number}","events_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/events","assignees_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/assignees{/user}","branches_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/branches{/branch}","tags_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/tags","blobs_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/git/refs{/sha}","trees_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/statuses/{sha}","languages_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/languages","stargazers_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/stargazers","contributors_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/contributors","subscribers_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/subscribers","subscription_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/subscription","commits_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/commits{/sha}","git_commits_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/git/commits{/sha}","comments_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/comments{/number}","issue_comment_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/issues/comments{/number}","contents_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/contents/{+path}","compare_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/merges","archive_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/downloads","issues_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/issues{/number}","pulls_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/pulls{/number}","milestones_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/milestones{/number}","notifications_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/labels{/name}","releases_url":"https://api.github.com/repos/cltweedie/wgc_groundwork/releases{/id}","created_at":"2015-06-07T11:20:13Z","updated_at":"2015-06-09T16:54:34Z","pushed_at":"2015-06-23T15:59:38Z","git_url":"git://github.com/cltweedie/wgc_groundwork.git","ssh_url":"git@github.com:cltweedie/wgc_groundwork.git","clone_url":"https://github.com/cltweedie/wgc_groundwork.git","svn_url":"https://github.com/cltweedie/wgc_groundwork","homepage":null,"size":11082,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"wegotcoders:master","ref":"master","sha":"3931ca912131447cb50222d1519520727ae78899","user":{"login":"wegotcoders","id":5376033,"avatar_url":"https://avatars.githubusercontent.com/u/5376033?v=3","gravatar_id":"","url":"https://api.github.com/users/wegotcoders","html_url":"https://github.com/wegotcoders","followers_url":"https://api.github.com/users/wegotcoders/followers","following_url":"https://api.github.com/users/wegotcoders/following{/other_user}","gists_url":"https://api.github.com/users/wegotcoders/gists{/gist_id}","starred_url":"https://api.github.com/users/wegotcoders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wegotcoders/subscriptions","organizations_url":"https://api.github.com/users/wegotcoders/orgs","repos_url":"https://api.github.com/users/wegotcoders/repos","events_url":"https://api.github.com/users/wegotcoders/events{/privacy}","received_events_url":"https://api.github.com/users/wegotcoders/received_events","type":"Organization","site_admin":false},"repo":{"id":16459176,"name":"wgc_groundwork","full_name":"wegotcoders/wgc_groundwork","owner":{"login":"wegotcoders","id":5376033,"avatar_url":"https://avatars.githubusercontent.com/u/5376033?v=3","gravatar_id":"","url":"https://api.github.com/users/wegotcoders","html_url":"https://github.com/wegotcoders","followers_url":"https://api.github.com/users/wegotcoders/followers","following_url":"https://api.github.com/users/wegotcoders/following{/other_user}","gists_url":"https://api.github.com/users/wegotcoders/gists{/gist_id}","starred_url":"https://api.github.com/users/wegotcoders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wegotcoders/subscriptions","organizations_url":"https://api.github.com/users/wegotcoders/orgs","repos_url":"https://api.github.com/users/wegotcoders/repos","events_url":"https://api.github.com/users/wegotcoders/events{/privacy}","received_events_url":"https://api.github.com/users/wegotcoders/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wegotcoders/wgc_groundwork","description":"We Got Coders Profile Viewer - Programming Challenge","fork":false,"url":"https://api.github.com/repos/wegotcoders/wgc_groundwork","forks_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/forks","keys_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/teams","hooks_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/hooks","issue_events_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/issues/events{/number}","events_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/events","assignees_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/assignees{/user}","branches_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/branches{/branch}","tags_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/tags","blobs_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/git/refs{/sha}","trees_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/statuses/{sha}","languages_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/languages","stargazers_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/stargazers","contributors_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/contributors","subscribers_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/subscribers","subscription_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/subscription","commits_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/commits{/sha}","git_commits_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/git/commits{/sha}","comments_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/comments{/number}","issue_comment_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/issues/comments{/number}","contents_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/contents/{+path}","compare_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/merges","archive_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/downloads","issues_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/issues{/number}","pulls_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/pulls{/number}","milestones_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/milestones{/number}","notifications_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/labels{/name}","releases_url":"https://api.github.com/repos/wegotcoders/wgc_groundwork/releases{/id}","created_at":"2014-02-02T17:37:24Z","updated_at":"2015-06-24T17:32:28Z","pushed_at":"2015-06-23T16:18:22Z","git_url":"git://github.com/wegotcoders/wgc_groundwork.git","ssh_url":"git@github.com:wegotcoders/wgc_groundwork.git","clone_url":"https://github.com/wegotcoders/wgc_groundwork.git","svn_url":"https://github.com/wegotcoders/wgc_groundwork","homepage":null,"size":13154,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":24,"forks":46,"open_issues":24,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wegotcoders/wgc_groundwork/pulls/32"},"html":{"href":"https://github.com/wegotcoders/wgc_groundwork/pull/32"},"issue":{"href":"https://api.github.com/repos/wegotcoders/wgc_groundwork/issues/32"},"comments":{"href":"https://api.github.com/repos/wegotcoders/wgc_groundwork/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/wegotcoders/wgc_groundwork/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/wegotcoders/wgc_groundwork/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wegotcoders/wgc_groundwork/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/wegotcoders/wgc_groundwork/statuses/833df54b7d19b5ee9be897e24bb40da2bd917e42"}}}}