{"action":"created","comment":{"url":"https://api.github.com/repos/Satish-Gupta/java_training/pulls/comments/22572897","id":22572897,"diff_hunk":"@@ -0,0 +1,73 @@\n+package com.lftechnology.jan5;\n+\n+import java.util.logging.Logger;\n+\n+/**\n+ * Compare if two arrays have the same content (doesn't matter if they aren't in order)\n+ * \n+ * @author satish\n+ * \n+ */\n+public class ArrayContentMatch {\n+\tprivate static final Logger LOGGER = Logger.getLogger(ArrayContentMatch.class.getName());\n+\n+\t/**\n+\t * checks if two arrays have same content irrespective of the order\n+\t * \n+\t * @param array1\n+\t * @param array2\n+\t * @return true if two arrays have same content and in same order else return false\n+\t */\n+\tprivate static boolean arrayMatch(String[] comparisionArray1, String[] comparisionArray2) {\n+\t\tint array1Length = comparisionArray1.length;\n+\t\tint array2Length = comparisionArray2.length;\n+\t\t// to track the count of matches between two arrays\n+\t\tint elementMatchCount = 0;\n+\n+\t\tif (array1Length != array2Length) {\n+\t\t\treturn false;\n+\t\t}\n+\t\t/*\n+\t\t * clone array 2 so that it can be marked with null after it has been matched with an element avoiding it to match again for another\n+\t\t * same value element\n+\t\t */\n+\t\tString[] tempArray = comparisionArray2.clone();\n+\n+\t\tfor (int i = 0; i < array1Length; i++) {","path":"java_training/src/com/lftechnology/jan5/ArrayContentMatch.java","position":36,"original_position":36,"commit_id":"7151959b9ec11ccd6cb4cadffe3887dd31c755fe","original_commit_id":"7151959b9ec11ccd6cb4cadffe3887dd31c755fe","user":{"login":"Satish-Gupta","id":6943258,"avatar_url":"https://avatars.githubusercontent.com/u/6943258?v=3","gravatar_id":"","url":"https://api.github.com/users/Satish-Gupta","html_url":"https://github.com/Satish-Gupta","followers_url":"https://api.github.com/users/Satish-Gupta/followers","following_url":"https://api.github.com/users/Satish-Gupta/following{/other_user}","gists_url":"https://api.github.com/users/Satish-Gupta/gists{/gist_id}","starred_url":"https://api.github.com/users/Satish-Gupta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Satish-Gupta/subscriptions","organizations_url":"https://api.github.com/users/Satish-Gupta/orgs","repos_url":"https://api.github.com/users/Satish-Gupta/repos","events_url":"https://api.github.com/users/Satish-Gupta/events{/privacy}","received_events_url":"https://api.github.com/users/Satish-Gupta/received_events","type":"User","site_admin":false},"body":"@adhpawal dai the Array.sort() method does not work for string array if it has a string with two or more digits where the first digit of a two digit number is less than the first digit of another string of single digit number. \r\nFor eg.\r\nString[] array = { \"ab\", \"aa\", \"31\", \"5\", \"23\", \"22\", \"1\" };\r\n\t\tArrays.sort(array);\r\n\r\nwill result the array in following state \r\n1\r\n22\r\n23\r\n31\r\n5\r\naa\r\nab\r\n","created_at":"2015-01-07T06:45:07Z","updated_at":"2015-01-07T06:45:07Z","html_url":"https://github.com/Satish-Gupta/java_training/pull/4#discussion_r22572897","pull_request_url":"https://api.github.com/repos/Satish-Gupta/java_training/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/Satish-Gupta/java_training/pulls/comments/22572897"},"html":{"href":"https://github.com/Satish-Gupta/java_training/pull/4#discussion_r22572897"},"pull_request":{"href":"https://api.github.com/repos/Satish-Gupta/java_training/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/Satish-Gupta/java_training/pulls/4","id":26868260,"html_url":"https://github.com/Satish-Gupta/java_training/pull/4","diff_url":"https://github.com/Satish-Gupta/java_training/pull/4.diff","patch_url":"https://github.com/Satish-Gupta/java_training/pull/4.patch","issue_url":"https://api.github.com/repos/Satish-Gupta/java_training/issues/4","number":4,"state":"open","locked":false,"title":"Jan5 Assignment","user":{"login":"Satish-Gupta","id":6943258,"avatar_url":"https://avatars.githubusercontent.com/u/6943258?v=3","gravatar_id":"","url":"https://api.github.com/users/Satish-Gupta","html_url":"https://github.com/Satish-Gupta","followers_url":"https://api.github.com/users/Satish-Gupta/followers","following_url":"https://api.github.com/users/Satish-Gupta/following{/other_user}","gists_url":"https://api.github.com/users/Satish-Gupta/gists{/gist_id}","starred_url":"https://api.github.com/users/Satish-Gupta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Satish-Gupta/subscriptions","organizations_url":"https://api.github.com/users/Satish-Gupta/orgs","repos_url":"https://api.github.com/users/Satish-Gupta/repos","events_url":"https://api.github.com/users/Satish-Gupta/events{/privacy}","received_events_url":"https://api.github.com/users/Satish-Gupta/received_events","type":"User","site_admin":false},"body":"@leapfrog-dipendra @adhpawal @bhuwang @anishmanandhar @nerisa @Msanjib @bibhushanJoshi @utsabneupane \r\nThis is my assignment given on jan5.\r\nPlease review the codes\r\nThank you for your time and suggestions.\r\n","created_at":"2015-01-06T03:40:11Z","updated_at":"2015-01-07T06:45:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d5e31c056f90af97b27b26f784cba9622dee063b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Satish-Gupta/java_training/pulls/4/commits","review_comments_url":"https://api.github.com/repos/Satish-Gupta/java_training/pulls/4/comments","review_comment_url":"https://api.github.com/repos/Satish-Gupta/java_training/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Satish-Gupta/java_training/issues/4/comments","statuses_url":"https://api.github.com/repos/Satish-Gupta/java_training/statuses/7151959b9ec11ccd6cb4cadffe3887dd31c755fe","head":{"label":"Satish-Gupta:jan5","ref":"jan5","sha":"7151959b9ec11ccd6cb4cadffe3887dd31c755fe","user":{"login":"Satish-Gupta","id":6943258,"avatar_url":"https://avatars.githubusercontent.com/u/6943258?v=3","gravatar_id":"","url":"https://api.github.com/users/Satish-Gupta","html_url":"https://github.com/Satish-Gupta","followers_url":"https://api.github.com/users/Satish-Gupta/followers","following_url":"https://api.github.com/users/Satish-Gupta/following{/other_user}","gists_url":"https://api.github.com/users/Satish-Gupta/gists{/gist_id}","starred_url":"https://api.github.com/users/Satish-Gupta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Satish-Gupta/subscriptions","organizations_url":"https://api.github.com/users/Satish-Gupta/orgs","repos_url":"https://api.github.com/users/Satish-Gupta/repos","events_url":"https://api.github.com/users/Satish-Gupta/events{/privacy}","received_events_url":"https://api.github.com/users/Satish-Gupta/received_events","type":"User","site_admin":false},"repo":{"id":28584635,"name":"java_training","full_name":"Satish-Gupta/java_training","owner":{"login":"Satish-Gupta","id":6943258,"avatar_url":"https://avatars.githubusercontent.com/u/6943258?v=3","gravatar_id":"","url":"https://api.github.com/users/Satish-Gupta","html_url":"https://github.com/Satish-Gupta","followers_url":"https://api.github.com/users/Satish-Gupta/followers","following_url":"https://api.github.com/users/Satish-Gupta/following{/other_user}","gists_url":"https://api.github.com/users/Satish-Gupta/gists{/gist_id}","starred_url":"https://api.github.com/users/Satish-Gupta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Satish-Gupta/subscriptions","organizations_url":"https://api.github.com/users/Satish-Gupta/orgs","repos_url":"https://api.github.com/users/Satish-Gupta/repos","events_url":"https://api.github.com/users/Satish-Gupta/events{/privacy}","received_events_url":"https://api.github.com/users/Satish-Gupta/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Satish-Gupta/java_training","description":"java training at leapfrog technologies","fork":false,"url":"https://api.github.com/repos/Satish-Gupta/java_training","forks_url":"https://api.github.com/repos/Satish-Gupta/java_training/forks","keys_url":"https://api.github.com/repos/Satish-Gupta/java_training/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Satish-Gupta/java_training/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Satish-Gupta/java_training/teams","hooks_url":"https://api.github.com/repos/Satish-Gupta/java_training/hooks","issue_events_url":"https://api.github.com/repos/Satish-Gupta/java_training/issues/events{/number}","events_url":"https://api.github.com/repos/Satish-Gupta/java_training/events","assignees_url":"https://api.github.com/repos/Satish-Gupta/java_training/assignees{/user}","branches_url":"https://api.github.com/repos/Satish-Gupta/java_training/branches{/branch}","tags_url":"https://api.github.com/repos/Satish-Gupta/java_training/tags","blobs_url":"https://api.github.com/repos/Satish-Gupta/java_training/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Satish-Gupta/java_training/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Satish-Gupta/java_training/git/refs{/sha}","trees_url":"https://api.github.com/repos/Satish-Gupta/java_training/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Satish-Gupta/java_training/statuses/{sha}","languages_url":"https://api.github.com/repos/Satish-Gupta/java_training/languages","stargazers_url":"https://api.github.com/repos/Satish-Gupta/java_training/stargazers","contributors_url":"https://api.github.com/repos/Satish-Gupta/java_training/contributors","subscribers_url":"https://api.github.com/repos/Satish-Gupta/java_training/subscribers","subscription_url":"https://api.github.com/repos/Satish-Gupta/java_training/subscription","commits_url":"https://api.github.com/repos/Satish-Gupta/java_training/commits{/sha}","git_commits_url":"https://api.github.com/repos/Satish-Gupta/java_training/git/commits{/sha}","comments_url":"https://api.github.com/repos/Satish-Gupta/java_training/comments{/number}","issue_comment_url":"https://api.github.com/repos/Satish-Gupta/java_training/issues/comments/{number}","contents_url":"https://api.github.com/repos/Satish-Gupta/java_training/contents/{+path}","compare_url":"https://api.github.com/repos/Satish-Gupta/java_training/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Satish-Gupta/java_training/merges","archive_url":"https://api.github.com/repos/Satish-Gupta/java_training/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Satish-Gupta/java_training/downloads","issues_url":"https://api.github.com/repos/Satish-Gupta/java_training/issues{/number}","pulls_url":"https://api.github.com/repos/Satish-Gupta/java_training/pulls{/number}","milestones_url":"https://api.github.com/repos/Satish-Gupta/java_training/milestones{/number}","notifications_url":"https://api.github.com/repos/Satish-Gupta/java_training/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Satish-Gupta/java_training/labels{/name}","releases_url":"https://api.github.com/repos/Satish-Gupta/java_training/releases{/id}","created_at":"2014-12-29T07:47:05Z","updated_at":"2014-12-29T07:47:05Z","pushed_at":"2015-01-06T05:42:21Z","git_url":"git://github.com/Satish-Gupta/java_training.git","ssh_url":"git@github.com:Satish-Gupta/java_training.git","clone_url":"https://github.com/Satish-Gupta/java_training.git","svn_url":"https://github.com/Satish-Gupta/java_training","homepage":null,"size":360,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"dev"}},"base":{"label":"Satish-Gupta:dev","ref":"dev","sha":"b08437d678868ce3d4dc49171848456a3d28d979","user":{"login":"Satish-Gupta","id":6943258,"avatar_url":"https://avatars.githubusercontent.com/u/6943258?v=3","gravatar_id":"","url":"https://api.github.com/users/Satish-Gupta","html_url":"https://github.com/Satish-Gupta","followers_url":"https://api.github.com/users/Satish-Gupta/followers","following_url":"https://api.github.com/users/Satish-Gupta/following{/other_user}","gists_url":"https://api.github.com/users/Satish-Gupta/gists{/gist_id}","starred_url":"https://api.github.com/users/Satish-Gupta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Satish-Gupta/subscriptions","organizations_url":"https://api.github.com/users/Satish-Gupta/orgs","repos_url":"https://api.github.com/users/Satish-Gupta/repos","events_url":"https://api.github.com/users/Satish-Gupta/events{/privacy}","received_events_url":"https://api.github.com/users/Satish-Gupta/received_events","type":"User","site_admin":false},"repo":{"id":28584635,"name":"java_training","full_name":"Satish-Gupta/java_training","owner":{"login":"Satish-Gupta","id":6943258,"avatar_url":"https://avatars.githubusercontent.com/u/6943258?v=3","gravatar_id":"","url":"https://api.github.com/users/Satish-Gupta","html_url":"https://github.com/Satish-Gupta","followers_url":"https://api.github.com/users/Satish-Gupta/followers","following_url":"https://api.github.com/users/Satish-Gupta/following{/other_user}","gists_url":"https://api.github.com/users/Satish-Gupta/gists{/gist_id}","starred_url":"https://api.github.com/users/Satish-Gupta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Satish-Gupta/subscriptions","organizations_url":"https://api.github.com/users/Satish-Gupta/orgs","repos_url":"https://api.github.com/users/Satish-Gupta/repos","events_url":"https://api.github.com/users/Satish-Gupta/events{/privacy}","received_events_url":"https://api.github.com/users/Satish-Gupta/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Satish-Gupta/java_training","description":"java training at leapfrog technologies","fork":false,"url":"https://api.github.com/repos/Satish-Gupta/java_training","forks_url":"https://api.github.com/repos/Satish-Gupta/java_training/forks","keys_url":"https://api.github.com/repos/Satish-Gupta/java_training/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Satish-Gupta/java_training/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Satish-Gupta/java_training/teams","hooks_url":"https://api.github.com/repos/Satish-Gupta/java_training/hooks","issue_events_url":"https://api.github.com/repos/Satish-Gupta/java_training/issues/events{/number}","events_url":"https://api.github.com/repos/Satish-Gupta/java_training/events","assignees_url":"https://api.github.com/repos/Satish-Gupta/java_training/assignees{/user}","branches_url":"https://api.github.com/repos/Satish-Gupta/java_training/branches{/branch}","tags_url":"https://api.github.com/repos/Satish-Gupta/java_training/tags","blobs_url":"https://api.github.com/repos/Satish-Gupta/java_training/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Satish-Gupta/java_training/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Satish-Gupta/java_training/git/refs{/sha}","trees_url":"https://api.github.com/repos/Satish-Gupta/java_training/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Satish-Gupta/java_training/statuses/{sha}","languages_url":"https://api.github.com/repos/Satish-Gupta/java_training/languages","stargazers_url":"https://api.github.com/repos/Satish-Gupta/java_training/stargazers","contributors_url":"https://api.github.com/repos/Satish-Gupta/java_training/contributors","subscribers_url":"https://api.github.com/repos/Satish-Gupta/java_training/subscribers","subscription_url":"https://api.github.com/repos/Satish-Gupta/java_training/subscription","commits_url":"https://api.github.com/repos/Satish-Gupta/java_training/commits{/sha}","git_commits_url":"https://api.github.com/repos/Satish-Gupta/java_training/git/commits{/sha}","comments_url":"https://api.github.com/repos/Satish-Gupta/java_training/comments{/number}","issue_comment_url":"https://api.github.com/repos/Satish-Gupta/java_training/issues/comments/{number}","contents_url":"https://api.github.com/repos/Satish-Gupta/java_training/contents/{+path}","compare_url":"https://api.github.com/repos/Satish-Gupta/java_training/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Satish-Gupta/java_training/merges","archive_url":"https://api.github.com/repos/Satish-Gupta/java_training/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Satish-Gupta/java_training/downloads","issues_url":"https://api.github.com/repos/Satish-Gupta/java_training/issues{/number}","pulls_url":"https://api.github.com/repos/Satish-Gupta/java_training/pulls{/number}","milestones_url":"https://api.github.com/repos/Satish-Gupta/java_training/milestones{/number}","notifications_url":"https://api.github.com/repos/Satish-Gupta/java_training/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Satish-Gupta/java_training/labels{/name}","releases_url":"https://api.github.com/repos/Satish-Gupta/java_training/releases{/id}","created_at":"2014-12-29T07:47:05Z","updated_at":"2014-12-29T07:47:05Z","pushed_at":"2015-01-06T05:42:21Z","git_url":"git://github.com/Satish-Gupta/java_training.git","ssh_url":"git@github.com:Satish-Gupta/java_training.git","clone_url":"https://github.com/Satish-Gupta/java_training.git","svn_url":"https://github.com/Satish-Gupta/java_training","homepage":null,"size":360,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Satish-Gupta/java_training/pulls/4"},"html":{"href":"https://github.com/Satish-Gupta/java_training/pull/4"},"issue":{"href":"https://api.github.com/repos/Satish-Gupta/java_training/issues/4"},"comments":{"href":"https://api.github.com/repos/Satish-Gupta/java_training/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/Satish-Gupta/java_training/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/Satish-Gupta/java_training/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Satish-Gupta/java_training/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/Satish-Gupta/java_training/statuses/7151959b9ec11ccd6cb4cadffe3887dd31c755fe"}}}}