{"action":"created","comment":{"url":"https://api.github.com/repos/PranayVJain/Chatterbox/pulls/comments/236238740","pull_request_review_id":178269076,"id":236238740,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjIzODc0MA==","diff_hunk":"@@ -0,0 +1,1332 @@\n+package com.messenger.chatterbox.backend.utils;\n+\n+import java.io.BufferedReader;\n+import java.io.File;\n+import java.io.FileNotFoundException;\n+import java.io.FileReader;\n+import java.io.IOException;\n+import java.util.ArrayList;\n+import java.util.Arrays;\n+import java.util.Collections;\n+import java.util.HashSet;\n+import java.util.List;\n+import java.util.Scanner;\n+import java.util.Set;\n+import com.opencsv.CSVReader;\n+\n+public class StringUtils {\n+\n+\tpublic Set<String> palindromes(final String input) {\n+\t\tfinal Set<String> result = new HashSet<String>();\n+\t\tfor (int i = 0; i < input.length(); i++) {\n+\t\t\t// expanding even length palindromes:\n+\t\t\texpandPalindromes(result, input, i, i + 1);\n+\t\t\t// expanding odd length palindromes:\n+\t\t\texpandPalindromes(result, input, i, i);\n+\t\t}\n+\t\treturn result;\n+\t}\n+\n+\tpublic void expandPalindromes(final Set<String> result, final String s, int i, int j) {\n+\t\twhile (i >= 0 && j < s.length() && s.charAt(i) == s.charAt(j)) {\n+\t\t\tresult.add(s.substring(i, j + 1));\n+\t\t\ti--;\n+\t\t\tj++;\n+\t\t}\n+\t}\n+\n+\n+    public Set<String> isPalindromeUsingCenter(String input) {\n+        final Set<String> palindromes = new HashSet<>();\n+        if (input == null || input.isEmpty()) {\n+            return palindromes;\n+        }\n+        if (input.length() == 1) {\n+            palindromes.add(input);\n+            return palindromes;\n+        }\n+        for (int i = 0; i < input.length(); i++) {\n+            findPalindromes(palindromes, input, i, i + 1);\n+            findPalindromes(palindromes, input, i, i);\n+        }\n+        return palindromes;\n+    }\n+\n+    private void findPalindromes(final Set<String> result, final String input, int low, int high) {\n+        while (low >= 0 && high < input.length() && input.charAt(low) == input.charAt(high)) {\n+            result.add(input.substring(low, high + 1));\n+            low--;\n+            high++;\n+        }\n+    }\n+\n+    public Set<String> isPalindromeUsingSubstring(String input) {\n+        Set<String> palindromes = new HashSet<>();\n+        if (input == null || input.isEmpty()) {\n+            return palindromes;\n+        }\n+        if (input.length() == 1) {\n+            palindromes.add(input);\n+            return palindromes;\n+        }\n+        for (int i = 0; i < input.length(); i++) {\n+            for (int j = i + 1; j <= input.length(); j++)\n+                if (isPalindrome(input.substring(i, j))) {\n+                    palindromes.add(input.substring(i, j));\n+                }\n+        }\n+        return palindromes;\n+    }\n+\n+    private boolean isPalindrome(String input) {\n+        StringBuilder plain = new StringBuilder(input);\n+        StringBuilder reverse = plain.reverse();\n+        return (reverse.toString()).equals(input);\n+    }\n+\n+    public Set<String> isPalindromeUsingManachersAlgo(String input) {\n+        Set<String> palindromes = new HashSet<>();\n+        String formattedInput = \"@\" + input + \"#\";\n+        char inputCharArr[] = formattedInput.toCharArray();\n+        int rp;\n+        int radius[][] = new int[2][input.length() + 1];\n+        for (int j = 0; j <= 1; j++) {\n+            radius[j][0] = rp = 0;\n+            int i = 1;\n+            while (i <= input.length()) {\n+                palindromes.add(Character.toString(inputCharArr[i]));\n+                while (inputCharArr[i - rp - 1] == inputCharArr[i + j + rp])\n+                    rp++;\n+                radius[j][i] = rp;\n+                int k = 1;\n+                while ((radius[j][i - k] != rp - k) && (k < rp)) {\n+                    radius[j][i + k] = Math.min(radius[j][i - k], rp - k);\n+                    k++;\n+                }\n+                rp = Math.max(rp - k, 0);\n+                i += k;\n+            }\n+        }\n+        for (int i = 1; i <= input.length(); i++) {\n+            for (int j = 0; j <= 1; j++) {\n+                for (rp = radius[j][i]; rp > 0; rp--) {\n+                    palindromes.add(input.substring(i - rp - 1, (2 * rp + j) + (i - rp - 1)));\n+                }\n+            }\n+        }\n+        return palindromes;\n+    }\n+\n+\n+    public static final String COMMA_DELIMITER = \",\";\n+    public static final String CSV_FILE = \"src/test/resources/book.csv\";\n+    public static final List<List<String>> EXPECTED_ARRAY = Collections.unmodifiableList(new ArrayList<List<String>>() {\n+        {\n+            add(new ArrayList<String>() {\n+                {\n+                    add(\"Mary Kom\");\n+                    add(\"Unbreakable\");\n+                }\n+            });\n+            add(new ArrayList<String>() {\n+                {","path":"backend/src/main/java/com/messenger/chatterbox/backend/utils/StringUtils.java","position":132,"original_position":132,"commit_id":"e73cae16a48e53115598f9e9222e571c16aca109","original_commit_id":"e73cae16a48e53115598f9e9222e571c16aca109","user":{"login":"PranayVJain","id":29925515,"node_id":"MDQ6VXNlcjI5OTI1NTE1","avatar_url":"https://avatars0.githubusercontent.com/u/29925515?v=4","gravatar_id":"","url":"https://api.github.com/users/PranayVJain","html_url":"https://github.com/PranayVJain","followers_url":"https://api.github.com/users/PranayVJain/followers","following_url":"https://api.github.com/users/PranayVJain/following{/other_user}","gists_url":"https://api.github.com/users/PranayVJain/gists{/gist_id}","starred_url":"https://api.github.com/users/PranayVJain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PranayVJain/subscriptions","organizations_url":"https://api.github.com/users/PranayVJain/orgs","repos_url":"https://api.github.com/users/PranayVJain/repos","events_url":"https://api.github.com/users/PranayVJain/events{/privacy}","received_events_url":"https://api.github.com/users/PranayVJain/received_events","type":"User","site_admin":false},"body":"\"Non-static initializers are confusing\"","created_at":"2018-11-26T12:42:37Z","updated_at":"2018-11-26T12:42:42Z","html_url":"https://github.com/PranayVJain/Chatterbox/pull/3#discussion_r236238740","pull_request_url":"https://api.github.com/repos/PranayVJain/Chatterbox/pulls/3","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/PranayVJain/Chatterbox/pulls/comments/236238740"},"html":{"href":"https://github.com/PranayVJain/Chatterbox/pull/3#discussion_r236238740"},"pull_request":{"href":"https://api.github.com/repos/PranayVJain/Chatterbox/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/PranayVJain/Chatterbox/pulls/3","id":232247554,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyMjQ3NTU0","html_url":"https://github.com/PranayVJain/Chatterbox/pull/3","diff_url":"https://github.com/PranayVJain/Chatterbox/pull/3.diff","patch_url":"https://github.com/PranayVJain/Chatterbox/pull/3.patch","issue_url":"https://api.github.com/repos/PranayVJain/Chatterbox/issues/3","number":3,"state":"open","locked":false,"title":"Webhooks test","user":{"login":"PranayVJain","id":29925515,"node_id":"MDQ6VXNlcjI5OTI1NTE1","avatar_url":"https://avatars0.githubusercontent.com/u/29925515?v=4","gravatar_id":"","url":"https://api.github.com/users/PranayVJain","html_url":"https://github.com/PranayVJain","followers_url":"https://api.github.com/users/PranayVJain/followers","following_url":"https://api.github.com/users/PranayVJain/following{/other_user}","gists_url":"https://api.github.com/users/PranayVJain/gists{/gist_id}","starred_url":"https://api.github.com/users/PranayVJain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PranayVJain/subscriptions","organizations_url":"https://api.github.com/users/PranayVJain/orgs","repos_url":"https://api.github.com/users/PranayVJain/repos","events_url":"https://api.github.com/users/PranayVJain/events{/privacy}","received_events_url":"https://api.github.com/users/PranayVJain/received_events","type":"User","site_admin":false},"body":"Testing webhooks","created_at":"2018-11-20T09:35:25Z","updated_at":"2018-11-26T12:42:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"43abdea247ae179c29b354f0a67083a190c6f7f8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/PranayVJain/Chatterbox/pulls/3/commits","review_comments_url":"https://api.github.com/repos/PranayVJain/Chatterbox/pulls/3/comments","review_comment_url":"https://api.github.com/repos/PranayVJain/Chatterbox/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PranayVJain/Chatterbox/issues/3/comments","statuses_url":"https://api.github.com/repos/PranayVJain/Chatterbox/statuses/e73cae16a48e53115598f9e9222e571c16aca109","head":{"label":"PranayVJain:Webhooks_Test","ref":"Webhooks_Test","sha":"e73cae16a48e53115598f9e9222e571c16aca109","user":{"login":"PranayVJain","id":29925515,"node_id":"MDQ6VXNlcjI5OTI1NTE1","avatar_url":"https://avatars0.githubusercontent.com/u/29925515?v=4","gravatar_id":"","url":"https://api.github.com/users/PranayVJain","html_url":"https://github.com/PranayVJain","followers_url":"https://api.github.com/users/PranayVJain/followers","following_url":"https://api.github.com/users/PranayVJain/following{/other_user}","gists_url":"https://api.github.com/users/PranayVJain/gists{/gist_id}","starred_url":"https://api.github.com/users/PranayVJain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PranayVJain/subscriptions","organizations_url":"https://api.github.com/users/PranayVJain/orgs","repos_url":"https://api.github.com/users/PranayVJain/repos","events_url":"https://api.github.com/users/PranayVJain/events{/privacy}","received_events_url":"https://api.github.com/users/PranayVJain/received_events","type":"User","site_admin":false},"repo":{"id":96338924,"node_id":"MDEwOlJlcG9zaXRvcnk5NjMzODkyNA==","name":"Chatterbox","full_name":"PranayVJain/Chatterbox","private":false,"owner":{"login":"PranayVJain","id":29925515,"node_id":"MDQ6VXNlcjI5OTI1NTE1","avatar_url":"https://avatars0.githubusercontent.com/u/29925515?v=4","gravatar_id":"","url":"https://api.github.com/users/PranayVJain","html_url":"https://github.com/PranayVJain","followers_url":"https://api.github.com/users/PranayVJain/followers","following_url":"https://api.github.com/users/PranayVJain/following{/other_user}","gists_url":"https://api.github.com/users/PranayVJain/gists{/gist_id}","starred_url":"https://api.github.com/users/PranayVJain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PranayVJain/subscriptions","organizations_url":"https://api.github.com/users/PranayVJain/orgs","repos_url":"https://api.github.com/users/PranayVJain/repos","events_url":"https://api.github.com/users/PranayVJain/events{/privacy}","received_events_url":"https://api.github.com/users/PranayVJain/received_events","type":"User","site_admin":false},"html_url":"https://github.com/PranayVJain/Chatterbox","description":"A messenger app","fork":false,"url":"https://api.github.com/repos/PranayVJain/Chatterbox","forks_url":"https://api.github.com/repos/PranayVJain/Chatterbox/forks","keys_url":"https://api.github.com/repos/PranayVJain/Chatterbox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PranayVJain/Chatterbox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PranayVJain/Chatterbox/teams","hooks_url":"https://api.github.com/repos/PranayVJain/Chatterbox/hooks","issue_events_url":"https://api.github.com/repos/PranayVJain/Chatterbox/issues/events{/number}","events_url":"https://api.github.com/repos/PranayVJain/Chatterbox/events","assignees_url":"https://api.github.com/repos/PranayVJain/Chatterbox/assignees{/user}","branches_url":"https://api.github.com/repos/PranayVJain/Chatterbox/branches{/branch}","tags_url":"https://api.github.com/repos/PranayVJain/Chatterbox/tags","blobs_url":"https://api.github.com/repos/PranayVJain/Chatterbox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PranayVJain/Chatterbox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PranayVJain/Chatterbox/git/refs{/sha}","trees_url":"https://api.github.com/repos/PranayVJain/Chatterbox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PranayVJain/Chatterbox/statuses/{sha}","languages_url":"https://api.github.com/repos/PranayVJain/Chatterbox/languages","stargazers_url":"https://api.github.com/repos/PranayVJain/Chatterbox/stargazers","contributors_url":"https://api.github.com/repos/PranayVJain/Chatterbox/contributors","subscribers_url":"https://api.github.com/repos/PranayVJain/Chatterbox/subscribers","subscription_url":"https://api.github.com/repos/PranayVJain/Chatterbox/subscription","commits_url":"https://api.github.com/repos/PranayVJain/Chatterbox/commits{/sha}","git_commits_url":"https://api.github.com/repos/PranayVJain/Chatterbox/git/commits{/sha}","comments_url":"https://api.github.com/repos/PranayVJain/Chatterbox/comments{/number}","issue_comment_url":"https://api.github.com/repos/PranayVJain/Chatterbox/issues/comments{/number}","contents_url":"https://api.github.com/repos/PranayVJain/Chatterbox/contents/{+path}","compare_url":"https://api.github.com/repos/PranayVJain/Chatterbox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PranayVJain/Chatterbox/merges","archive_url":"https://api.github.com/repos/PranayVJain/Chatterbox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PranayVJain/Chatterbox/downloads","issues_url":"https://api.github.com/repos/PranayVJain/Chatterbox/issues{/number}","pulls_url":"https://api.github.com/repos/PranayVJain/Chatterbox/pulls{/number}","milestones_url":"https://api.github.com/repos/PranayVJain/Chatterbox/milestones{/number}","notifications_url":"https://api.github.com/repos/PranayVJain/Chatterbox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PranayVJain/Chatterbox/labels{/name}","releases_url":"https://api.github.com/repos/PranayVJain/Chatterbox/releases{/id}","deployments_url":"https://api.github.com/repos/PranayVJain/Chatterbox/deployments","created_at":"2017-07-05T16:19:29Z","updated_at":"2018-09-17T16:27:13Z","pushed_at":"2018-11-26T06:28:09Z","git_url":"git://github.com/PranayVJain/Chatterbox.git","ssh_url":"git@github.com:PranayVJain/Chatterbox.git","clone_url":"https://github.com/PranayVJain/Chatterbox.git","svn_url":"https://github.com/PranayVJain/Chatterbox","homepage":null,"size":21,"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":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"PranayVJain:master","ref":"master","sha":"be8e7cfeff7132cc49e741dad0e242fdb080f582","user":{"login":"PranayVJain","id":29925515,"node_id":"MDQ6VXNlcjI5OTI1NTE1","avatar_url":"https://avatars0.githubusercontent.com/u/29925515?v=4","gravatar_id":"","url":"https://api.github.com/users/PranayVJain","html_url":"https://github.com/PranayVJain","followers_url":"https://api.github.com/users/PranayVJain/followers","following_url":"https://api.github.com/users/PranayVJain/following{/other_user}","gists_url":"https://api.github.com/users/PranayVJain/gists{/gist_id}","starred_url":"https://api.github.com/users/PranayVJain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PranayVJain/subscriptions","organizations_url":"https://api.github.com/users/PranayVJain/orgs","repos_url":"https://api.github.com/users/PranayVJain/repos","events_url":"https://api.github.com/users/PranayVJain/events{/privacy}","received_events_url":"https://api.github.com/users/PranayVJain/received_events","type":"User","site_admin":false},"repo":{"id":96338924,"node_id":"MDEwOlJlcG9zaXRvcnk5NjMzODkyNA==","name":"Chatterbox","full_name":"PranayVJain/Chatterbox","private":false,"owner":{"login":"PranayVJain","id":29925515,"node_id":"MDQ6VXNlcjI5OTI1NTE1","avatar_url":"https://avatars0.githubusercontent.com/u/29925515?v=4","gravatar_id":"","url":"https://api.github.com/users/PranayVJain","html_url":"https://github.com/PranayVJain","followers_url":"https://api.github.com/users/PranayVJain/followers","following_url":"https://api.github.com/users/PranayVJain/following{/other_user}","gists_url":"https://api.github.com/users/PranayVJain/gists{/gist_id}","starred_url":"https://api.github.com/users/PranayVJain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PranayVJain/subscriptions","organizations_url":"https://api.github.com/users/PranayVJain/orgs","repos_url":"https://api.github.com/users/PranayVJain/repos","events_url":"https://api.github.com/users/PranayVJain/events{/privacy}","received_events_url":"https://api.github.com/users/PranayVJain/received_events","type":"User","site_admin":false},"html_url":"https://github.com/PranayVJain/Chatterbox","description":"A messenger app","fork":false,"url":"https://api.github.com/repos/PranayVJain/Chatterbox","forks_url":"https://api.github.com/repos/PranayVJain/Chatterbox/forks","keys_url":"https://api.github.com/repos/PranayVJain/Chatterbox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PranayVJain/Chatterbox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PranayVJain/Chatterbox/teams","hooks_url":"https://api.github.com/repos/PranayVJain/Chatterbox/hooks","issue_events_url":"https://api.github.com/repos/PranayVJain/Chatterbox/issues/events{/number}","events_url":"https://api.github.com/repos/PranayVJain/Chatterbox/events","assignees_url":"https://api.github.com/repos/PranayVJain/Chatterbox/assignees{/user}","branches_url":"https://api.github.com/repos/PranayVJain/Chatterbox/branches{/branch}","tags_url":"https://api.github.com/repos/PranayVJain/Chatterbox/tags","blobs_url":"https://api.github.com/repos/PranayVJain/Chatterbox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PranayVJain/Chatterbox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PranayVJain/Chatterbox/git/refs{/sha}","trees_url":"https://api.github.com/repos/PranayVJain/Chatterbox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PranayVJain/Chatterbox/statuses/{sha}","languages_url":"https://api.github.com/repos/PranayVJain/Chatterbox/languages","stargazers_url":"https://api.github.com/repos/PranayVJain/Chatterbox/stargazers","contributors_url":"https://api.github.com/repos/PranayVJain/Chatterbox/contributors","subscribers_url":"https://api.github.com/repos/PranayVJain/Chatterbox/subscribers","subscription_url":"https://api.github.com/repos/PranayVJain/Chatterbox/subscription","commits_url":"https://api.github.com/repos/PranayVJain/Chatterbox/commits{/sha}","git_commits_url":"https://api.github.com/repos/PranayVJain/Chatterbox/git/commits{/sha}","comments_url":"https://api.github.com/repos/PranayVJain/Chatterbox/comments{/number}","issue_comment_url":"https://api.github.com/repos/PranayVJain/Chatterbox/issues/comments{/number}","contents_url":"https://api.github.com/repos/PranayVJain/Chatterbox/contents/{+path}","compare_url":"https://api.github.com/repos/PranayVJain/Chatterbox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PranayVJain/Chatterbox/merges","archive_url":"https://api.github.com/repos/PranayVJain/Chatterbox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PranayVJain/Chatterbox/downloads","issues_url":"https://api.github.com/repos/PranayVJain/Chatterbox/issues{/number}","pulls_url":"https://api.github.com/repos/PranayVJain/Chatterbox/pulls{/number}","milestones_url":"https://api.github.com/repos/PranayVJain/Chatterbox/milestones{/number}","notifications_url":"https://api.github.com/repos/PranayVJain/Chatterbox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PranayVJain/Chatterbox/labels{/name}","releases_url":"https://api.github.com/repos/PranayVJain/Chatterbox/releases{/id}","deployments_url":"https://api.github.com/repos/PranayVJain/Chatterbox/deployments","created_at":"2017-07-05T16:19:29Z","updated_at":"2018-09-17T16:27:13Z","pushed_at":"2018-11-26T06:28:09Z","git_url":"git://github.com/PranayVJain/Chatterbox.git","ssh_url":"git@github.com:PranayVJain/Chatterbox.git","clone_url":"https://github.com/PranayVJain/Chatterbox.git","svn_url":"https://github.com/PranayVJain/Chatterbox","homepage":null,"size":21,"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":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PranayVJain/Chatterbox/pulls/3"},"html":{"href":"https://github.com/PranayVJain/Chatterbox/pull/3"},"issue":{"href":"https://api.github.com/repos/PranayVJain/Chatterbox/issues/3"},"comments":{"href":"https://api.github.com/repos/PranayVJain/Chatterbox/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/PranayVJain/Chatterbox/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/PranayVJain/Chatterbox/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PranayVJain/Chatterbox/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/PranayVJain/Chatterbox/statuses/e73cae16a48e53115598f9e9222e571c16aca109"}},"author_association":"OWNER"}}
{"actor":{"display_login":"PranayVJain"}}