{"action":"created","comment":{"url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/pulls/comments/24847791","id":24847791,"diff_hunk":"@@ -0,0 +1,48 @@\n+# Non-bouncy numbers\n+# Problem 113\n+\n+# Working from left-to-right if no digit is exceeded by the digit to its left it\n+# is called an increasing number; for example, 134468.\n+\n+# Similarly if no digit is exceeded by the digit to its right it is called a\n+# decreasing number; for example, 66420.\n+\n+# We shall call a positive integer that is neither increasing nor decreasing a\n+# \"bouncy\" number; for example, 155349.\n+\n+# As n increases, the proportion of bouncy numbers below n increases such that\n+# there are only 12951 numbers below one-million that are not bouncy and only\n+# 277032 non-bouncy numbers below 10**10.\n+\n+# How many numbers below a googol (10**100) are not bouncy?\n+\n+def desc?(x)\n+  num_array = x.to_s.chars.map(&:to_i)\n+  num_array.reduce{ |e1,e2| e1 >= e2 ? e2 : (return false) }; true\n+end\n+\n+def asc?(x)\n+  num_array = x.to_s.chars.map(&:to_i)\n+  num_array.reduce{ |e1,e2| e1 <= e2 ? e2 : (return false) }; true\n+end\n+\n+def bouncy?(x)\n+ if asc?(x) || desc?(x)","path":"pe_113.rb","position":30,"original_position":30,"commit_id":"49d573a589a88d00f1349f4ddce6718cda111c32","original_commit_id":"49d573a589a88d00f1349f4ddce6718cda111c32","user":{"login":"tdg5","id":2316989,"avatar_url":"https://avatars.githubusercontent.com/u/2316989?v=3","gravatar_id":"","url":"https://api.github.com/users/tdg5","html_url":"https://github.com/tdg5","followers_url":"https://api.github.com/users/tdg5/followers","following_url":"https://api.github.com/users/tdg5/following{/other_user}","gists_url":"https://api.github.com/users/tdg5/gists{/gist_id}","starred_url":"https://api.github.com/users/tdg5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdg5/subscriptions","organizations_url":"https://api.github.com/users/tdg5/orgs","repos_url":"https://api.github.com/users/tdg5/repos","events_url":"https://api.github.com/users/tdg5/events{/privacy}","received_events_url":"https://api.github.com/users/tdg5/received_events","type":"User","site_admin":false},"body":"Unrelated to the last two comments, how could you skip a lot of work for `9_190_000..9_990_000` because that whole range is going to be bouncy, no?","created_at":"2015-02-17T19:54:45Z","updated_at":"2015-02-17T19:54:45Z","html_url":"https://github.com/LightLaboratories/jamienf_project_euler/pull/3#discussion_r24847791","pull_request_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/pulls/comments/24847791"},"html":{"href":"https://github.com/LightLaboratories/jamienf_project_euler/pull/3#discussion_r24847791"},"pull_request":{"href":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/pulls/3","id":29471592,"html_url":"https://github.com/LightLaboratories/jamienf_project_euler/pull/3","diff_url":"https://github.com/LightLaboratories/jamienf_project_euler/pull/3.diff","patch_url":"https://github.com/LightLaboratories/jamienf_project_euler/pull/3.patch","issue_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/issues/3","number":3,"state":"open","locked":false,"title":"Add solution for PE #113","user":{"login":"tdg5","id":2316989,"avatar_url":"https://avatars.githubusercontent.com/u/2316989?v=3","gravatar_id":"","url":"https://api.github.com/users/tdg5","html_url":"https://github.com/tdg5","followers_url":"https://api.github.com/users/tdg5/followers","following_url":"https://api.github.com/users/tdg5/following{/other_user}","gists_url":"https://api.github.com/users/tdg5/gists{/gist_id}","starred_url":"https://api.github.com/users/tdg5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdg5/subscriptions","organizations_url":"https://api.github.com/users/tdg5/orgs","repos_url":"https://api.github.com/users/tdg5/repos","events_url":"https://api.github.com/users/tdg5/events{/privacy}","received_events_url":"https://api.github.com/users/tdg5/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-17T19:48:46Z","updated_at":"2015-02-17T19:54:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"494ecb45b475b4af0d1a3e2f9abd857ed38fbc29","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/pulls/3/commits","review_comments_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/pulls/3/comments","review_comment_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/pulls/comments/{number}","comments_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/issues/3/comments","statuses_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/statuses/49d573a589a88d00f1349f4ddce6718cda111c32","head":{"label":"LightLaboratories:pe_113.rb","ref":"pe_113.rb","sha":"49d573a589a88d00f1349f4ddce6718cda111c32","user":{"login":"LightLaboratories","id":10864388,"avatar_url":"https://avatars.githubusercontent.com/u/10864388?v=3","gravatar_id":"","url":"https://api.github.com/users/LightLaboratories","html_url":"https://github.com/LightLaboratories","followers_url":"https://api.github.com/users/LightLaboratories/followers","following_url":"https://api.github.com/users/LightLaboratories/following{/other_user}","gists_url":"https://api.github.com/users/LightLaboratories/gists{/gist_id}","starred_url":"https://api.github.com/users/LightLaboratories/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LightLaboratories/subscriptions","organizations_url":"https://api.github.com/users/LightLaboratories/orgs","repos_url":"https://api.github.com/users/LightLaboratories/repos","events_url":"https://api.github.com/users/LightLaboratories/events{/privacy}","received_events_url":"https://api.github.com/users/LightLaboratories/received_events","type":"Organization","site_admin":false},"repo":{"id":30351023,"name":"jamienf_project_euler","full_name":"LightLaboratories/jamienf_project_euler","owner":{"login":"LightLaboratories","id":10864388,"avatar_url":"https://avatars.githubusercontent.com/u/10864388?v=3","gravatar_id":"","url":"https://api.github.com/users/LightLaboratories","html_url":"https://github.com/LightLaboratories","followers_url":"https://api.github.com/users/LightLaboratories/followers","following_url":"https://api.github.com/users/LightLaboratories/following{/other_user}","gists_url":"https://api.github.com/users/LightLaboratories/gists{/gist_id}","starred_url":"https://api.github.com/users/LightLaboratories/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LightLaboratories/subscriptions","organizations_url":"https://api.github.com/users/LightLaboratories/orgs","repos_url":"https://api.github.com/users/LightLaboratories/repos","events_url":"https://api.github.com/users/LightLaboratories/events{/privacy}","received_events_url":"https://api.github.com/users/LightLaboratories/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LightLaboratories/jamienf_project_euler","description":null,"fork":true,"url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler","forks_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/forks","keys_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/teams","hooks_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/hooks","issue_events_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/issues/events{/number}","events_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/events","assignees_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/assignees{/user}","branches_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/branches{/branch}","tags_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/tags","blobs_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/git/refs{/sha}","trees_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/statuses/{sha}","languages_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/languages","stargazers_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/stargazers","contributors_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/contributors","subscribers_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/subscribers","subscription_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/subscription","commits_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/commits{/sha}","git_commits_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/git/commits{/sha}","comments_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/comments{/number}","issue_comment_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/issues/comments/{number}","contents_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/contents/{+path}","compare_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/merges","archive_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/downloads","issues_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/issues{/number}","pulls_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/pulls{/number}","milestones_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/milestones{/number}","notifications_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/labels{/name}","releases_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/releases{/id}","created_at":"2015-02-05T10:54:26Z","updated_at":"2015-02-05T10:58:57Z","pushed_at":"2015-02-17T19:47:37Z","git_url":"git://github.com/LightLaboratories/jamienf_project_euler.git","ssh_url":"git@github.com:LightLaboratories/jamienf_project_euler.git","clone_url":"https://github.com/LightLaboratories/jamienf_project_euler.git","svn_url":"https://github.com/LightLaboratories/jamienf_project_euler","homepage":null,"size":190,"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":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"LightLaboratories:base","ref":"base","sha":"fc8fde5b2f18e5393f5c8245707ac4e408944765","user":{"login":"LightLaboratories","id":10864388,"avatar_url":"https://avatars.githubusercontent.com/u/10864388?v=3","gravatar_id":"","url":"https://api.github.com/users/LightLaboratories","html_url":"https://github.com/LightLaboratories","followers_url":"https://api.github.com/users/LightLaboratories/followers","following_url":"https://api.github.com/users/LightLaboratories/following{/other_user}","gists_url":"https://api.github.com/users/LightLaboratories/gists{/gist_id}","starred_url":"https://api.github.com/users/LightLaboratories/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LightLaboratories/subscriptions","organizations_url":"https://api.github.com/users/LightLaboratories/orgs","repos_url":"https://api.github.com/users/LightLaboratories/repos","events_url":"https://api.github.com/users/LightLaboratories/events{/privacy}","received_events_url":"https://api.github.com/users/LightLaboratories/received_events","type":"Organization","site_admin":false},"repo":{"id":30351023,"name":"jamienf_project_euler","full_name":"LightLaboratories/jamienf_project_euler","owner":{"login":"LightLaboratories","id":10864388,"avatar_url":"https://avatars.githubusercontent.com/u/10864388?v=3","gravatar_id":"","url":"https://api.github.com/users/LightLaboratories","html_url":"https://github.com/LightLaboratories","followers_url":"https://api.github.com/users/LightLaboratories/followers","following_url":"https://api.github.com/users/LightLaboratories/following{/other_user}","gists_url":"https://api.github.com/users/LightLaboratories/gists{/gist_id}","starred_url":"https://api.github.com/users/LightLaboratories/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LightLaboratories/subscriptions","organizations_url":"https://api.github.com/users/LightLaboratories/orgs","repos_url":"https://api.github.com/users/LightLaboratories/repos","events_url":"https://api.github.com/users/LightLaboratories/events{/privacy}","received_events_url":"https://api.github.com/users/LightLaboratories/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LightLaboratories/jamienf_project_euler","description":null,"fork":true,"url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler","forks_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/forks","keys_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/teams","hooks_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/hooks","issue_events_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/issues/events{/number}","events_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/events","assignees_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/assignees{/user}","branches_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/branches{/branch}","tags_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/tags","blobs_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/git/refs{/sha}","trees_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/statuses/{sha}","languages_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/languages","stargazers_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/stargazers","contributors_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/contributors","subscribers_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/subscribers","subscription_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/subscription","commits_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/commits{/sha}","git_commits_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/git/commits{/sha}","comments_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/comments{/number}","issue_comment_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/issues/comments/{number}","contents_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/contents/{+path}","compare_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/merges","archive_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/downloads","issues_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/issues{/number}","pulls_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/pulls{/number}","milestones_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/milestones{/number}","notifications_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/labels{/name}","releases_url":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/releases{/id}","created_at":"2015-02-05T10:54:26Z","updated_at":"2015-02-05T10:58:57Z","pushed_at":"2015-02-17T19:47:37Z","git_url":"git://github.com/LightLaboratories/jamienf_project_euler.git","ssh_url":"git@github.com:LightLaboratories/jamienf_project_euler.git","clone_url":"https://github.com/LightLaboratories/jamienf_project_euler.git","svn_url":"https://github.com/LightLaboratories/jamienf_project_euler","homepage":null,"size":190,"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":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/pulls/3"},"html":{"href":"https://github.com/LightLaboratories/jamienf_project_euler/pull/3"},"issue":{"href":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/issues/3"},"comments":{"href":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/LightLaboratories/jamienf_project_euler/statuses/49d573a589a88d00f1349f4ddce6718cda111c32"}}}}