{"action":"created","comment":{"url":"https://api.github.com/repos/vasubits/MICP-2k18/pulls/comments/170816715","pull_request_review_id":99559907,"id":170816715,"diff_hunk":"@@ -0,0 +1,68 @@\n+import java.util.HashSet;\r\n+import java.util.Set;\r\n+\r\n+public class StringSeg {\r\n+\r\n+\tpublic static boolean breakable(String line, Set<String> Dictionary) {\r\n+\t\t\r\n+\t\tif(Dictionary== null && (line==null || line==\"\")) \r\n+\t\t{\r\n+\t\t\treturn true;\r\n+\t\t}\r\n+\t\tif(Dictionary == null)\r\n+\t\t{\r\n+\t\t\treturn false;\r\n+\t\t\t\r\n+\t\t}\t\r\n+\t\tif(line==null || Dictionary.isEmpty())\r\n+\t\t{\r\n+\t\t\treturn false;\r\n+\t\t}\r\n+\t\t\r\n+\t\tif(line.equals(\"\")) //nothing to search\r\n+\t\t\treturn true;\r\n+\t\t\r\n+\t    int[] traverse = new int[line.length()+1]; //traverse entire string with one step ahead\r\n+\t    \r\n+\t    for(int i=0;i<traverse.length;i++)\r\n+\t    {\r\n+\t    \ttraverse[i]=-1;\t\t\t\t\t\t\t//all are unvisited.\r\n+\t    }\r\n+\t \r\n+\t    traverse[0]=0;\r\n+\t     \r\n+\t    for(int i=0; i<line.length(); i++)\r\n+\t    {\r\n+\t    \tif(traverse[i]!=-1)\t\t\t\t\t\t//if not visited yet,move ahead from here\r\n+\t        {\r\n+\t        \tfor( int j=i+1; j<=line.length(); j++)   //upto last point of given string\r\n+\t        \t{\r\n+\t                String part = line.substring(i, j);  //consider all substring while increasing char be  char\r\n+\t                if(Dictionary.contains(part)){       //look-up in dictionary\r\n+\t                \ttraverse[j]=i;                   //if found, change visited status\r\n+\t                    i=j;                             //move index pointer ahead\r","path":"Week3/StringSeg.java","position":43,"original_position":43,"commit_id":"3524acb121e19629b2a5e5bfc6c8039033b27943","original_commit_id":"3524acb121e19629b2a5e5bfc6c8039033b27943","user":{"login":"mooreaarond","id":6600797,"avatar_url":"https://avatars1.githubusercontent.com/u/6600797?v=4","gravatar_id":"","url":"https://api.github.com/users/mooreaarond","html_url":"https://github.com/mooreaarond","followers_url":"https://api.github.com/users/mooreaarond/followers","following_url":"https://api.github.com/users/mooreaarond/following{/other_user}","gists_url":"https://api.github.com/users/mooreaarond/gists{/gist_id}","starred_url":"https://api.github.com/users/mooreaarond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mooreaarond/subscriptions","organizations_url":"https://api.github.com/users/mooreaarond/orgs","repos_url":"https://api.github.com/users/mooreaarond/repos","events_url":"https://api.github.com/users/mooreaarond/events{/privacy}","received_events_url":"https://api.github.com/users/mooreaarond/received_events","type":"User","site_admin":false},"body":"I don't believe that we can actually move the pointer forward like you do here.  Consider the following case:\r\nDictionary { 'he', 'heart', 'cat' }\r\nline = 'heartcat'\r\nthe answer is true ('heart', 'cat')\r\nYour algorithm will find 'he', advance forward, and not find the word 'heart' because i will not be at 'a'","created_at":"2018-02-27T05:09:28Z","updated_at":"2018-02-27T05:23:36Z","html_url":"https://github.com/vasubits/MICP-2k18/pull/5#discussion_r170816715","pull_request_url":"https://api.github.com/repos/vasubits/MICP-2k18/pulls/5","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/vasubits/MICP-2k18/pulls/comments/170816715"},"html":{"href":"https://github.com/vasubits/MICP-2k18/pull/5#discussion_r170816715"},"pull_request":{"href":"https://api.github.com/repos/vasubits/MICP-2k18/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/vasubits/MICP-2k18/pulls/5","id":171474940,"html_url":"https://github.com/vasubits/MICP-2k18/pull/5","diff_url":"https://github.com/vasubits/MICP-2k18/pull/5.diff","patch_url":"https://github.com/vasubits/MICP-2k18/pull/5.patch","issue_url":"https://api.github.com/repos/vasubits/MICP-2k18/issues/5","number":5,"state":"open","locked":false,"title":"String segment : Please review my code ","user":{"login":"vasubits","id":10937438,"avatar_url":"https://avatars1.githubusercontent.com/u/10937438?v=4","gravatar_id":"","url":"https://api.github.com/users/vasubits","html_url":"https://github.com/vasubits","followers_url":"https://api.github.com/users/vasubits/followers","following_url":"https://api.github.com/users/vasubits/following{/other_user}","gists_url":"https://api.github.com/users/vasubits/gists{/gist_id}","starred_url":"https://api.github.com/users/vasubits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasubits/subscriptions","organizations_url":"https://api.github.com/users/vasubits/orgs","repos_url":"https://api.github.com/users/vasubits/repos","events_url":"https://api.github.com/users/vasubits/events{/privacy}","received_events_url":"https://api.github.com/users/vasubits/received_events","type":"User","site_admin":false},"body":"Stringseg.java ~ source code file\r\nStringSegTest.java ~ test cases","created_at":"2018-02-26T19:53:55Z","updated_at":"2018-02-27T05:23:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e3f0179f49574f5cc515339710b1277082a761d6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/vasubits/MICP-2k18/pulls/5/commits","review_comments_url":"https://api.github.com/repos/vasubits/MICP-2k18/pulls/5/comments","review_comment_url":"https://api.github.com/repos/vasubits/MICP-2k18/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vasubits/MICP-2k18/issues/5/comments","statuses_url":"https://api.github.com/repos/vasubits/MICP-2k18/statuses/3524acb121e19629b2a5e5bfc6c8039033b27943","head":{"label":"vasubits:vasubits-StringSeg-1","ref":"vasubits-StringSeg-1","sha":"3524acb121e19629b2a5e5bfc6c8039033b27943","user":{"login":"vasubits","id":10937438,"avatar_url":"https://avatars1.githubusercontent.com/u/10937438?v=4","gravatar_id":"","url":"https://api.github.com/users/vasubits","html_url":"https://github.com/vasubits","followers_url":"https://api.github.com/users/vasubits/followers","following_url":"https://api.github.com/users/vasubits/following{/other_user}","gists_url":"https://api.github.com/users/vasubits/gists{/gist_id}","starred_url":"https://api.github.com/users/vasubits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasubits/subscriptions","organizations_url":"https://api.github.com/users/vasubits/orgs","repos_url":"https://api.github.com/users/vasubits/repos","events_url":"https://api.github.com/users/vasubits/events{/privacy}","received_events_url":"https://api.github.com/users/vasubits/received_events","type":"User","site_admin":false},"repo":{"id":121259704,"name":"MICP-2k18","full_name":"vasubits/MICP-2k18","owner":{"login":"vasubits","id":10937438,"avatar_url":"https://avatars1.githubusercontent.com/u/10937438?v=4","gravatar_id":"","url":"https://api.github.com/users/vasubits","html_url":"https://github.com/vasubits","followers_url":"https://api.github.com/users/vasubits/followers","following_url":"https://api.github.com/users/vasubits/following{/other_user}","gists_url":"https://api.github.com/users/vasubits/gists{/gist_id}","starred_url":"https://api.github.com/users/vasubits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasubits/subscriptions","organizations_url":"https://api.github.com/users/vasubits/orgs","repos_url":"https://api.github.com/users/vasubits/repos","events_url":"https://api.github.com/users/vasubits/events{/privacy}","received_events_url":"https://api.github.com/users/vasubits/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vasubits/MICP-2k18","description":"MICP is a coaching Pilot program for technical Interview Prep :)","fork":false,"url":"https://api.github.com/repos/vasubits/MICP-2k18","forks_url":"https://api.github.com/repos/vasubits/MICP-2k18/forks","keys_url":"https://api.github.com/repos/vasubits/MICP-2k18/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vasubits/MICP-2k18/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vasubits/MICP-2k18/teams","hooks_url":"https://api.github.com/repos/vasubits/MICP-2k18/hooks","issue_events_url":"https://api.github.com/repos/vasubits/MICP-2k18/issues/events{/number}","events_url":"https://api.github.com/repos/vasubits/MICP-2k18/events","assignees_url":"https://api.github.com/repos/vasubits/MICP-2k18/assignees{/user}","branches_url":"https://api.github.com/repos/vasubits/MICP-2k18/branches{/branch}","tags_url":"https://api.github.com/repos/vasubits/MICP-2k18/tags","blobs_url":"https://api.github.com/repos/vasubits/MICP-2k18/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vasubits/MICP-2k18/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vasubits/MICP-2k18/git/refs{/sha}","trees_url":"https://api.github.com/repos/vasubits/MICP-2k18/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vasubits/MICP-2k18/statuses/{sha}","languages_url":"https://api.github.com/repos/vasubits/MICP-2k18/languages","stargazers_url":"https://api.github.com/repos/vasubits/MICP-2k18/stargazers","contributors_url":"https://api.github.com/repos/vasubits/MICP-2k18/contributors","subscribers_url":"https://api.github.com/repos/vasubits/MICP-2k18/subscribers","subscription_url":"https://api.github.com/repos/vasubits/MICP-2k18/subscription","commits_url":"https://api.github.com/repos/vasubits/MICP-2k18/commits{/sha}","git_commits_url":"https://api.github.com/repos/vasubits/MICP-2k18/git/commits{/sha}","comments_url":"https://api.github.com/repos/vasubits/MICP-2k18/comments{/number}","issue_comment_url":"https://api.github.com/repos/vasubits/MICP-2k18/issues/comments{/number}","contents_url":"https://api.github.com/repos/vasubits/MICP-2k18/contents/{+path}","compare_url":"https://api.github.com/repos/vasubits/MICP-2k18/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vasubits/MICP-2k18/merges","archive_url":"https://api.github.com/repos/vasubits/MICP-2k18/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vasubits/MICP-2k18/downloads","issues_url":"https://api.github.com/repos/vasubits/MICP-2k18/issues{/number}","pulls_url":"https://api.github.com/repos/vasubits/MICP-2k18/pulls{/number}","milestones_url":"https://api.github.com/repos/vasubits/MICP-2k18/milestones{/number}","notifications_url":"https://api.github.com/repos/vasubits/MICP-2k18/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vasubits/MICP-2k18/labels{/name}","releases_url":"https://api.github.com/repos/vasubits/MICP-2k18/releases{/id}","deployments_url":"https://api.github.com/repos/vasubits/MICP-2k18/deployments","created_at":"2018-02-12T14:54:39Z","updated_at":"2018-02-12T15:20:56Z","pushed_at":"2018-02-26T19:53:56Z","git_url":"git://github.com/vasubits/MICP-2k18.git","ssh_url":"git@github.com:vasubits/MICP-2k18.git","clone_url":"https://github.com/vasubits/MICP-2k18.git","svn_url":"https://github.com/vasubits/MICP-2k18","homepage":"","size":15,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"vasubits:master","ref":"master","sha":"fd3b9b976169809639c9545cf1747f9426b222ee","user":{"login":"vasubits","id":10937438,"avatar_url":"https://avatars1.githubusercontent.com/u/10937438?v=4","gravatar_id":"","url":"https://api.github.com/users/vasubits","html_url":"https://github.com/vasubits","followers_url":"https://api.github.com/users/vasubits/followers","following_url":"https://api.github.com/users/vasubits/following{/other_user}","gists_url":"https://api.github.com/users/vasubits/gists{/gist_id}","starred_url":"https://api.github.com/users/vasubits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasubits/subscriptions","organizations_url":"https://api.github.com/users/vasubits/orgs","repos_url":"https://api.github.com/users/vasubits/repos","events_url":"https://api.github.com/users/vasubits/events{/privacy}","received_events_url":"https://api.github.com/users/vasubits/received_events","type":"User","site_admin":false},"repo":{"id":121259704,"name":"MICP-2k18","full_name":"vasubits/MICP-2k18","owner":{"login":"vasubits","id":10937438,"avatar_url":"https://avatars1.githubusercontent.com/u/10937438?v=4","gravatar_id":"","url":"https://api.github.com/users/vasubits","html_url":"https://github.com/vasubits","followers_url":"https://api.github.com/users/vasubits/followers","following_url":"https://api.github.com/users/vasubits/following{/other_user}","gists_url":"https://api.github.com/users/vasubits/gists{/gist_id}","starred_url":"https://api.github.com/users/vasubits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasubits/subscriptions","organizations_url":"https://api.github.com/users/vasubits/orgs","repos_url":"https://api.github.com/users/vasubits/repos","events_url":"https://api.github.com/users/vasubits/events{/privacy}","received_events_url":"https://api.github.com/users/vasubits/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vasubits/MICP-2k18","description":"MICP is a coaching Pilot program for technical Interview Prep :)","fork":false,"url":"https://api.github.com/repos/vasubits/MICP-2k18","forks_url":"https://api.github.com/repos/vasubits/MICP-2k18/forks","keys_url":"https://api.github.com/repos/vasubits/MICP-2k18/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vasubits/MICP-2k18/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vasubits/MICP-2k18/teams","hooks_url":"https://api.github.com/repos/vasubits/MICP-2k18/hooks","issue_events_url":"https://api.github.com/repos/vasubits/MICP-2k18/issues/events{/number}","events_url":"https://api.github.com/repos/vasubits/MICP-2k18/events","assignees_url":"https://api.github.com/repos/vasubits/MICP-2k18/assignees{/user}","branches_url":"https://api.github.com/repos/vasubits/MICP-2k18/branches{/branch}","tags_url":"https://api.github.com/repos/vasubits/MICP-2k18/tags","blobs_url":"https://api.github.com/repos/vasubits/MICP-2k18/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vasubits/MICP-2k18/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vasubits/MICP-2k18/git/refs{/sha}","trees_url":"https://api.github.com/repos/vasubits/MICP-2k18/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vasubits/MICP-2k18/statuses/{sha}","languages_url":"https://api.github.com/repos/vasubits/MICP-2k18/languages","stargazers_url":"https://api.github.com/repos/vasubits/MICP-2k18/stargazers","contributors_url":"https://api.github.com/repos/vasubits/MICP-2k18/contributors","subscribers_url":"https://api.github.com/repos/vasubits/MICP-2k18/subscribers","subscription_url":"https://api.github.com/repos/vasubits/MICP-2k18/subscription","commits_url":"https://api.github.com/repos/vasubits/MICP-2k18/commits{/sha}","git_commits_url":"https://api.github.com/repos/vasubits/MICP-2k18/git/commits{/sha}","comments_url":"https://api.github.com/repos/vasubits/MICP-2k18/comments{/number}","issue_comment_url":"https://api.github.com/repos/vasubits/MICP-2k18/issues/comments{/number}","contents_url":"https://api.github.com/repos/vasubits/MICP-2k18/contents/{+path}","compare_url":"https://api.github.com/repos/vasubits/MICP-2k18/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vasubits/MICP-2k18/merges","archive_url":"https://api.github.com/repos/vasubits/MICP-2k18/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vasubits/MICP-2k18/downloads","issues_url":"https://api.github.com/repos/vasubits/MICP-2k18/issues{/number}","pulls_url":"https://api.github.com/repos/vasubits/MICP-2k18/pulls{/number}","milestones_url":"https://api.github.com/repos/vasubits/MICP-2k18/milestones{/number}","notifications_url":"https://api.github.com/repos/vasubits/MICP-2k18/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vasubits/MICP-2k18/labels{/name}","releases_url":"https://api.github.com/repos/vasubits/MICP-2k18/releases{/id}","deployments_url":"https://api.github.com/repos/vasubits/MICP-2k18/deployments","created_at":"2018-02-12T14:54:39Z","updated_at":"2018-02-12T15:20:56Z","pushed_at":"2018-02-26T19:53:56Z","git_url":"git://github.com/vasubits/MICP-2k18.git","ssh_url":"git@github.com:vasubits/MICP-2k18.git","clone_url":"https://github.com/vasubits/MICP-2k18.git","svn_url":"https://github.com/vasubits/MICP-2k18","homepage":"","size":15,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vasubits/MICP-2k18/pulls/5"},"html":{"href":"https://github.com/vasubits/MICP-2k18/pull/5"},"issue":{"href":"https://api.github.com/repos/vasubits/MICP-2k18/issues/5"},"comments":{"href":"https://api.github.com/repos/vasubits/MICP-2k18/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/vasubits/MICP-2k18/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/vasubits/MICP-2k18/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vasubits/MICP-2k18/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/vasubits/MICP-2k18/statuses/3524acb121e19629b2a5e5bfc6c8039033b27943"}},"author_association":"OWNER"}}
{"actor":{"display_login":"mooreaarond"}}