{"action":"created","comment":{"url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/pulls/comments/49936467","id":49936467,"diff_hunk":"@@ -1,14 +1,14 @@\n-# This method takes a string, str, and returns the first non-repeated letter in that string.\n-# More specifically, it looks for the first letter that appears by itself.\n-#\n-# + \"ddcdd\" has 'c' as its first non-repeated letter, and thus returns 'c'\n-# + \"aabccd\" has both 'b' and 'd' as non-repeating letters, but would return 'b' because that\n-#   one occurs first\n-# + \"aabbaa\" only has repeated letters (two pairs of 'a', and a pair of 'b'), and thus returns\n-#   nil (since there does not exist a non-repeated letter)\n-\n-\n def find_first_non_repeated_letter(str)\n-  #write your method here\n-  return true\n-end\n+    str.split('').each do |x|\n+        str.count(x)\n+        if str.count(x) == 1\n+            return x","path":"lib/find_non_repeated_letter.rb","position":18,"original_position":18,"commit_id":"22c723834ff6c2acc3fa4944c82283b18488ceb1","original_commit_id":"22c723834ff6c2acc3fa4944c82283b18488ceb1","user":{"login":"mel-d","id":16277895,"avatar_url":"https://avatars.githubusercontent.com/u/16277895?v=3","gravatar_id":"","url":"https://api.github.com/users/mel-d","html_url":"https://github.com/mel-d","followers_url":"https://api.github.com/users/mel-d/followers","following_url":"https://api.github.com/users/mel-d/following{/other_user}","gists_url":"https://api.github.com/users/mel-d/gists{/gist_id}","starred_url":"https://api.github.com/users/mel-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mel-d/subscriptions","organizations_url":"https://api.github.com/users/mel-d/orgs","repos_url":"https://api.github.com/users/mel-d/repos","events_url":"https://api.github.com/users/mel-d/events{/privacy}","received_events_url":"https://api.github.com/users/mel-d/received_events","type":"User","site_admin":false},"body":"Makes sense! I hadn't realize that 'return' meant the code stopped running.\nThanks!\n\nOn Thu, Jan 14, 2016 at 5:27 PM, Sumeet Jain <notifications@github.com>\nwrote:\n\n> In lib/find_non_repeated_letter.rb\n> <https://github.com/omahacodeschool/ruby-toy__first-non-repeated-letter/pull/6#discussion_r49801797>\n> :\n>\n> >  def find_first_non_repeated_letter(str)\n> > -  #write your method here\n> > -  return true\n> > -end\n> > +    str.split('').each do |x|\n> > +        str.count(x)\n> > +        if str.count(x) == 1\n> > +            return x\n>\n> If a unique character is found, this return x line would end the method.\n> It works beautifully :)\n>\n> Like if str was \"Hello\" (so the first non-repeated character is \"H\"),\n> then your method wouldn't even bother to check if \"e\" or the other\n> subsequent letters were unique. It would have stopped running as soon as it\n> found that \"H\" is unique. That's a good thing!\n>\n> But keeping that in mind, the next large section of code in your method is\n> a bit unnecessary. For example, consider this re-write of your assignment:\n>\n> def find_first_non_repeated_letter(str)\n>     str.split('').each do |x|\n>         str.count(x)\n>         if str.count(x) == 1\n>             return x\n>         end\n>     end\n>\n>     return nilend\n>\n> I replaced the entire section chunk of your code with return nil. But\n> remember that that line of code *will never even be executed* if the return\n> x is triggered.\n>\n> So while your code *does* work well, I wanted to show this to you. Think\n> about it for a bit, and see if you have any questions. If you don't, reply\n> with something like \"Got it!\" and I'll approve this assignment.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/omahacodeschool/ruby-toy__first-non-repeated-letter/pull/6/files#r49801797>\n> .\n>\n","created_at":"2016-01-16T20:03:18Z","updated_at":"2016-01-16T20:03:18Z","html_url":"https://github.com/omahacodeschool/ruby-toy__first-non-repeated-letter/pull/6#discussion_r49936467","pull_request_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/pulls/comments/49936467"},"html":{"href":"https://github.com/omahacodeschool/ruby-toy__first-non-repeated-letter/pull/6#discussion_r49936467"},"pull_request":{"href":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/pulls/6","id":55977845,"html_url":"https://github.com/omahacodeschool/ruby-toy__first-non-repeated-letter/pull/6","diff_url":"https://github.com/omahacodeschool/ruby-toy__first-non-repeated-letter/pull/6.diff","patch_url":"https://github.com/omahacodeschool/ruby-toy__first-non-repeated-letter/pull/6.patch","issue_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/issues/6","number":6,"state":"open","locked":false,"title":"Done","user":{"login":"mel-d","id":16277895,"avatar_url":"https://avatars.githubusercontent.com/u/16277895?v=3","gravatar_id":"","url":"https://api.github.com/users/mel-d","html_url":"https://github.com/mel-d","followers_url":"https://api.github.com/users/mel-d/followers","following_url":"https://api.github.com/users/mel-d/following{/other_user}","gists_url":"https://api.github.com/users/mel-d/gists{/gist_id}","starred_url":"https://api.github.com/users/mel-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mel-d/subscriptions","organizations_url":"https://api.github.com/users/mel-d/orgs","repos_url":"https://api.github.com/users/mel-d/repos","events_url":"https://api.github.com/users/mel-d/events{/privacy}","received_events_url":"https://api.github.com/users/mel-d/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-14T00:37:08Z","updated_at":"2016-01-16T20:03:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c8a78cc75e41184478d5a7fe39b4b37d17f089eb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/pulls/6/commits","review_comments_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/pulls/6/comments","review_comment_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/issues/6/comments","statuses_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/statuses/22c723834ff6c2acc3fa4944c82283b18488ceb1","head":{"label":"mel-d:master","ref":"master","sha":"22c723834ff6c2acc3fa4944c82283b18488ceb1","user":{"login":"mel-d","id":16277895,"avatar_url":"https://avatars.githubusercontent.com/u/16277895?v=3","gravatar_id":"","url":"https://api.github.com/users/mel-d","html_url":"https://github.com/mel-d","followers_url":"https://api.github.com/users/mel-d/followers","following_url":"https://api.github.com/users/mel-d/following{/other_user}","gists_url":"https://api.github.com/users/mel-d/gists{/gist_id}","starred_url":"https://api.github.com/users/mel-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mel-d/subscriptions","organizations_url":"https://api.github.com/users/mel-d/orgs","repos_url":"https://api.github.com/users/mel-d/repos","events_url":"https://api.github.com/users/mel-d/events{/privacy}","received_events_url":"https://api.github.com/users/mel-d/received_events","type":"User","site_admin":false},"repo":{"id":49529118,"name":"ruby-toy__first-non-repeated-letter","full_name":"mel-d/ruby-toy__first-non-repeated-letter","owner":{"login":"mel-d","id":16277895,"avatar_url":"https://avatars.githubusercontent.com/u/16277895?v=3","gravatar_id":"","url":"https://api.github.com/users/mel-d","html_url":"https://github.com/mel-d","followers_url":"https://api.github.com/users/mel-d/followers","following_url":"https://api.github.com/users/mel-d/following{/other_user}","gists_url":"https://api.github.com/users/mel-d/gists{/gist_id}","starred_url":"https://api.github.com/users/mel-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mel-d/subscriptions","organizations_url":"https://api.github.com/users/mel-d/orgs","repos_url":"https://api.github.com/users/mel-d/repos","events_url":"https://api.github.com/users/mel-d/events{/privacy}","received_events_url":"https://api.github.com/users/mel-d/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mel-d/ruby-toy__first-non-repeated-letter","description":"Find the first non-repeated letter in a string","fork":true,"url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter","forks_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/forks","keys_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/teams","hooks_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/hooks","issue_events_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/issues/events{/number}","events_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/events","assignees_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/assignees{/user}","branches_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/branches{/branch}","tags_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/tags","blobs_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/git/refs{/sha}","trees_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/statuses/{sha}","languages_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/languages","stargazers_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/stargazers","contributors_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/contributors","subscribers_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/subscribers","subscription_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/subscription","commits_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/commits{/sha}","git_commits_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/git/commits{/sha}","comments_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/comments{/number}","issue_comment_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/issues/comments{/number}","contents_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/contents/{+path}","compare_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/merges","archive_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/downloads","issues_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/issues{/number}","pulls_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/pulls{/number}","milestones_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/milestones{/number}","notifications_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/labels{/name}","releases_url":"https://api.github.com/repos/mel-d/ruby-toy__first-non-repeated-letter/releases{/id}","created_at":"2016-01-12T21:11:28Z","updated_at":"2016-01-12T21:11:29Z","pushed_at":"2016-01-14T00:36:48Z","git_url":"git://github.com/mel-d/ruby-toy__first-non-repeated-letter.git","ssh_url":"git@github.com:mel-d/ruby-toy__first-non-repeated-letter.git","clone_url":"https://github.com/mel-d/ruby-toy__first-non-repeated-letter.git","svn_url":"https://github.com/mel-d/ruby-toy__first-non-repeated-letter","homepage":null,"size":5,"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":"omahacodeschool:master","ref":"master","sha":"4c5d8ba2668fd1bb4d8586b45bd84383ad8a4209","user":{"login":"omahacodeschool","id":6311183,"avatar_url":"https://avatars.githubusercontent.com/u/6311183?v=3","gravatar_id":"","url":"https://api.github.com/users/omahacodeschool","html_url":"https://github.com/omahacodeschool","followers_url":"https://api.github.com/users/omahacodeschool/followers","following_url":"https://api.github.com/users/omahacodeschool/following{/other_user}","gists_url":"https://api.github.com/users/omahacodeschool/gists{/gist_id}","starred_url":"https://api.github.com/users/omahacodeschool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omahacodeschool/subscriptions","organizations_url":"https://api.github.com/users/omahacodeschool/orgs","repos_url":"https://api.github.com/users/omahacodeschool/repos","events_url":"https://api.github.com/users/omahacodeschool/events{/privacy}","received_events_url":"https://api.github.com/users/omahacodeschool/received_events","type":"Organization","site_admin":false},"repo":{"id":47854393,"name":"ruby-toy__first-non-repeated-letter","full_name":"omahacodeschool/ruby-toy__first-non-repeated-letter","owner":{"login":"omahacodeschool","id":6311183,"avatar_url":"https://avatars.githubusercontent.com/u/6311183?v=3","gravatar_id":"","url":"https://api.github.com/users/omahacodeschool","html_url":"https://github.com/omahacodeschool","followers_url":"https://api.github.com/users/omahacodeschool/followers","following_url":"https://api.github.com/users/omahacodeschool/following{/other_user}","gists_url":"https://api.github.com/users/omahacodeschool/gists{/gist_id}","starred_url":"https://api.github.com/users/omahacodeschool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omahacodeschool/subscriptions","organizations_url":"https://api.github.com/users/omahacodeschool/orgs","repos_url":"https://api.github.com/users/omahacodeschool/repos","events_url":"https://api.github.com/users/omahacodeschool/events{/privacy}","received_events_url":"https://api.github.com/users/omahacodeschool/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/omahacodeschool/ruby-toy__first-non-repeated-letter","description":"Find the first non-repeated letter in a string","fork":false,"url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter","forks_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/forks","keys_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/teams","hooks_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/hooks","issue_events_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/issues/events{/number}","events_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/events","assignees_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/assignees{/user}","branches_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/branches{/branch}","tags_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/tags","blobs_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/git/refs{/sha}","trees_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/statuses/{sha}","languages_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/languages","stargazers_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/stargazers","contributors_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/contributors","subscribers_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/subscribers","subscription_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/subscription","commits_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/commits{/sha}","git_commits_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/git/commits{/sha}","comments_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/comments{/number}","issue_comment_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/issues/comments{/number}","contents_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/contents/{+path}","compare_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/merges","archive_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/downloads","issues_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/issues{/number}","pulls_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/pulls{/number}","milestones_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/milestones{/number}","notifications_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/labels{/name}","releases_url":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/releases{/id}","created_at":"2015-12-11T22:34:36Z","updated_at":"2016-01-11T03:28:14Z","pushed_at":"2016-01-15T19:35:31Z","git_url":"git://github.com/omahacodeschool/ruby-toy__first-non-repeated-letter.git","ssh_url":"git@github.com:omahacodeschool/ruby-toy__first-non-repeated-letter.git","clone_url":"https://github.com/omahacodeschool/ruby-toy__first-non-repeated-letter.git","svn_url":"https://github.com/omahacodeschool/ruby-toy__first-non-repeated-letter","homepage":null,"size":5,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":2,"forks":14,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/pulls/6"},"html":{"href":"https://github.com/omahacodeschool/ruby-toy__first-non-repeated-letter/pull/6"},"issue":{"href":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/issues/6"},"comments":{"href":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/omahacodeschool/ruby-toy__first-non-repeated-letter/statuses/22c723834ff6c2acc3fa4944c82283b18488ceb1"}}}}