{"action":"created","comment":{"url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/pulls/comments/205512754","pull_request_review_id":140797430,"id":205512754,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTUxMjc1NA==","diff_hunk":"@@ -0,0 +1,80 @@\n+package fixXY;\n+\n+/**\n+ * Contains methods to solve fixXY problem.\n+ * @author Ishita Mathur\n+ *\n+ */\n+public class ArrayFixXY \n+{\n+\t/**\n+\t * Method returns an array that contains exactly the same numbers as the input array,\n+\t * but rearranged so that every X is immediately followed by a Y.\n+\t * It does not move X within array, but every other number may move.\n+\t * \n+\t * @param inputArray, should contain equal number of X and Y \n+\t * & two adjacent X values should not be there & X should not be at the last position. \n+\t * @param arrayLength > 0\n+\t * @param x, this is the value that should not move.\n+\t * @param y, this is the value that should come after x.\n+\t * @return\n+\t */\n+\tpublic int[] fixXY(int[] inputArray, int arrayLength, int x, int y)\n+\t{\n+\t\tif (arrayLength == 0)\n+\t\t\tthrow new AssertionError(\"Array is empty\");\n+\t\tfor(int j = 0; j < arrayLength - 1; j++)\n+\t\t{\n+\t\t\tif (inputArray[j] == inputArray[j + 1] && inputArray[j] == x)\n+\t\t\t\tthrow new AssertionError(\"Two adjacent X values\");\n+\t\t}\n+\t\t\n+\t\tfor(int k = 0; k <= arrayLength - 1; k++)\n+\t\t{\n+\t\t\tif (k == arrayLength - 1 && inputArray[k] == x)\n+\t\t\t\tthrow new AssertionError(\"X is at last position\");\n+\t\t}\n+","path":"SCF-Session-4/fixXY/ArrayFixXY.java","position":37,"original_position":37,"commit_id":"5e6d6fa5ce2b6d0ef5d1cc40309cd6aa57c265e9","original_commit_id":"5e6d6fa5ce2b6d0ef5d1cc40309cd6aa57c265e9","user":{"login":"sandeep-sky","id":28001254,"node_id":"MDQ6VXNlcjI4MDAxMjU0","avatar_url":"https://avatars2.githubusercontent.com/u/28001254?v=4","gravatar_id":"","url":"https://api.github.com/users/sandeep-sky","html_url":"https://github.com/sandeep-sky","followers_url":"https://api.github.com/users/sandeep-sky/followers","following_url":"https://api.github.com/users/sandeep-sky/following{/other_user}","gists_url":"https://api.github.com/users/sandeep-sky/gists{/gist_id}","starred_url":"https://api.github.com/users/sandeep-sky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandeep-sky/subscriptions","organizations_url":"https://api.github.com/users/sandeep-sky/orgs","repos_url":"https://api.github.com/users/sandeep-sky/repos","events_url":"https://api.github.com/users/sandeep-sky/events{/privacy}","received_events_url":"https://api.github.com/users/sandeep-sky/received_events","type":"User","site_admin":false},"body":"Above two `for loops` are not needed to resolve this. Use the single `for loop` to resolve.","created_at":"2018-07-26T16:00:17Z","updated_at":"2018-07-26T16:00:17Z","html_url":"https://github.com/meta-ishita-mathur/GET2018/pull/6#discussion_r205512754","pull_request_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/pulls/6","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/meta-ishita-mathur/GET2018/pulls/comments/205512754"},"html":{"href":"https://github.com/meta-ishita-mathur/GET2018/pull/6#discussion_r205512754"},"pull_request":{"href":"https://api.github.com/repos/meta-ishita-mathur/GET2018/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/pulls/6","id":203200671,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzMjAwNjcx","html_url":"https://github.com/meta-ishita-mathur/GET2018/pull/6","diff_url":"https://github.com/meta-ishita-mathur/GET2018/pull/6.diff","patch_url":"https://github.com/meta-ishita-mathur/GET2018/pull/6.patch","issue_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/issues/6","number":6,"state":"open","locked":false,"title":"SCF-Session-4","user":{"login":"meta-ishita-mathur","id":41181509,"node_id":"MDQ6VXNlcjQxMTgxNTA5","avatar_url":"https://avatars1.githubusercontent.com/u/41181509?v=4","gravatar_id":"","url":"https://api.github.com/users/meta-ishita-mathur","html_url":"https://github.com/meta-ishita-mathur","followers_url":"https://api.github.com/users/meta-ishita-mathur/followers","following_url":"https://api.github.com/users/meta-ishita-mathur/following{/other_user}","gists_url":"https://api.github.com/users/meta-ishita-mathur/gists{/gist_id}","starred_url":"https://api.github.com/users/meta-ishita-mathur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meta-ishita-mathur/subscriptions","organizations_url":"https://api.github.com/users/meta-ishita-mathur/orgs","repos_url":"https://api.github.com/users/meta-ishita-mathur/repos","events_url":"https://api.github.com/users/meta-ishita-mathur/events{/privacy}","received_events_url":"https://api.github.com/users/meta-ishita-mathur/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-23T12:18:30Z","updated_at":"2018-07-26T16:00:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"83accb3de1c09b7642d1a2d2c4cf34833d0c27ad","assignee":{"login":"sandeep-sky","id":28001254,"node_id":"MDQ6VXNlcjI4MDAxMjU0","avatar_url":"https://avatars2.githubusercontent.com/u/28001254?v=4","gravatar_id":"","url":"https://api.github.com/users/sandeep-sky","html_url":"https://github.com/sandeep-sky","followers_url":"https://api.github.com/users/sandeep-sky/followers","following_url":"https://api.github.com/users/sandeep-sky/following{/other_user}","gists_url":"https://api.github.com/users/sandeep-sky/gists{/gist_id}","starred_url":"https://api.github.com/users/sandeep-sky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandeep-sky/subscriptions","organizations_url":"https://api.github.com/users/sandeep-sky/orgs","repos_url":"https://api.github.com/users/sandeep-sky/repos","events_url":"https://api.github.com/users/sandeep-sky/events{/privacy}","received_events_url":"https://api.github.com/users/sandeep-sky/received_events","type":"User","site_admin":false},"assignees":[{"login":"sandeep-sky","id":28001254,"node_id":"MDQ6VXNlcjI4MDAxMjU0","avatar_url":"https://avatars2.githubusercontent.com/u/28001254?v=4","gravatar_id":"","url":"https://api.github.com/users/sandeep-sky","html_url":"https://github.com/sandeep-sky","followers_url":"https://api.github.com/users/sandeep-sky/followers","following_url":"https://api.github.com/users/sandeep-sky/following{/other_user}","gists_url":"https://api.github.com/users/sandeep-sky/gists{/gist_id}","starred_url":"https://api.github.com/users/sandeep-sky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandeep-sky/subscriptions","organizations_url":"https://api.github.com/users/sandeep-sky/orgs","repos_url":"https://api.github.com/users/sandeep-sky/repos","events_url":"https://api.github.com/users/sandeep-sky/events{/privacy}","received_events_url":"https://api.github.com/users/sandeep-sky/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/pulls/6/commits","review_comments_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/pulls/6/comments","review_comment_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/pulls/comments{/number}","comments_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/issues/6/comments","statuses_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/statuses/5e6d6fa5ce2b6d0ef5d1cc40309cd6aa57c265e9","head":{"label":"meta-ishita-mathur:SCF-Session-4","ref":"SCF-Session-4","sha":"5e6d6fa5ce2b6d0ef5d1cc40309cd6aa57c265e9","user":{"login":"meta-ishita-mathur","id":41181509,"node_id":"MDQ6VXNlcjQxMTgxNTA5","avatar_url":"https://avatars1.githubusercontent.com/u/41181509?v=4","gravatar_id":"","url":"https://api.github.com/users/meta-ishita-mathur","html_url":"https://github.com/meta-ishita-mathur","followers_url":"https://api.github.com/users/meta-ishita-mathur/followers","following_url":"https://api.github.com/users/meta-ishita-mathur/following{/other_user}","gists_url":"https://api.github.com/users/meta-ishita-mathur/gists{/gist_id}","starred_url":"https://api.github.com/users/meta-ishita-mathur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meta-ishita-mathur/subscriptions","organizations_url":"https://api.github.com/users/meta-ishita-mathur/orgs","repos_url":"https://api.github.com/users/meta-ishita-mathur/repos","events_url":"https://api.github.com/users/meta-ishita-mathur/events{/privacy}","received_events_url":"https://api.github.com/users/meta-ishita-mathur/received_events","type":"User","site_admin":false},"repo":{"id":140807786,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA4MDc3ODY=","name":"GET2018","full_name":"meta-ishita-mathur/GET2018","owner":{"login":"meta-ishita-mathur","id":41181509,"node_id":"MDQ6VXNlcjQxMTgxNTA5","avatar_url":"https://avatars1.githubusercontent.com/u/41181509?v=4","gravatar_id":"","url":"https://api.github.com/users/meta-ishita-mathur","html_url":"https://github.com/meta-ishita-mathur","followers_url":"https://api.github.com/users/meta-ishita-mathur/followers","following_url":"https://api.github.com/users/meta-ishita-mathur/following{/other_user}","gists_url":"https://api.github.com/users/meta-ishita-mathur/gists{/gist_id}","starred_url":"https://api.github.com/users/meta-ishita-mathur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meta-ishita-mathur/subscriptions","organizations_url":"https://api.github.com/users/meta-ishita-mathur/orgs","repos_url":"https://api.github.com/users/meta-ishita-mathur/repos","events_url":"https://api.github.com/users/meta-ishita-mathur/events{/privacy}","received_events_url":"https://api.github.com/users/meta-ishita-mathur/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/meta-ishita-mathur/GET2018","description":null,"fork":false,"url":"https://api.github.com/repos/meta-ishita-mathur/GET2018","forks_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/forks","keys_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/keys{/key_id}","collaborators_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/teams","hooks_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/hooks","issue_events_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/issues/events{/number}","events_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/events","assignees_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/assignees{/user}","branches_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/branches{/branch}","tags_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/tags","blobs_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/git/refs{/sha}","trees_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/git/trees{/sha}","statuses_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/statuses/{sha}","languages_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/languages","stargazers_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/stargazers","contributors_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/contributors","subscribers_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/subscribers","subscription_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/subscription","commits_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/commits{/sha}","git_commits_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/git/commits{/sha}","comments_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/comments{/number}","issue_comment_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/issues/comments{/number}","contents_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/contents/{+path}","compare_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/compare/{base}...{head}","merges_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/merges","archive_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/downloads","issues_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/issues{/number}","pulls_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/pulls{/number}","milestones_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/milestones{/number}","notifications_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/labels{/name}","releases_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/releases{/id}","deployments_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/deployments","created_at":"2018-07-13T06:41:15Z","updated_at":"2018-07-13T09:23:57Z","pushed_at":"2018-07-26T06:43:52Z","git_url":"git://github.com/meta-ishita-mathur/GET2018.git","ssh_url":"git@github.com:meta-ishita-mathur/GET2018.git","clone_url":"https://github.com/meta-ishita-mathur/GET2018.git","svn_url":"https://github.com/meta-ishita-mathur/GET2018","homepage":null,"size":70,"stargazers_count":0,"watchers_count":0,"language":null,"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":7,"license":null,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"base":{"label":"meta-ishita-mathur:master","ref":"master","sha":"b2c185c240f5afd4aa03b51df99d6bde0ff0eb21","user":{"login":"meta-ishita-mathur","id":41181509,"node_id":"MDQ6VXNlcjQxMTgxNTA5","avatar_url":"https://avatars1.githubusercontent.com/u/41181509?v=4","gravatar_id":"","url":"https://api.github.com/users/meta-ishita-mathur","html_url":"https://github.com/meta-ishita-mathur","followers_url":"https://api.github.com/users/meta-ishita-mathur/followers","following_url":"https://api.github.com/users/meta-ishita-mathur/following{/other_user}","gists_url":"https://api.github.com/users/meta-ishita-mathur/gists{/gist_id}","starred_url":"https://api.github.com/users/meta-ishita-mathur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meta-ishita-mathur/subscriptions","organizations_url":"https://api.github.com/users/meta-ishita-mathur/orgs","repos_url":"https://api.github.com/users/meta-ishita-mathur/repos","events_url":"https://api.github.com/users/meta-ishita-mathur/events{/privacy}","received_events_url":"https://api.github.com/users/meta-ishita-mathur/received_events","type":"User","site_admin":false},"repo":{"id":140807786,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA4MDc3ODY=","name":"GET2018","full_name":"meta-ishita-mathur/GET2018","owner":{"login":"meta-ishita-mathur","id":41181509,"node_id":"MDQ6VXNlcjQxMTgxNTA5","avatar_url":"https://avatars1.githubusercontent.com/u/41181509?v=4","gravatar_id":"","url":"https://api.github.com/users/meta-ishita-mathur","html_url":"https://github.com/meta-ishita-mathur","followers_url":"https://api.github.com/users/meta-ishita-mathur/followers","following_url":"https://api.github.com/users/meta-ishita-mathur/following{/other_user}","gists_url":"https://api.github.com/users/meta-ishita-mathur/gists{/gist_id}","starred_url":"https://api.github.com/users/meta-ishita-mathur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meta-ishita-mathur/subscriptions","organizations_url":"https://api.github.com/users/meta-ishita-mathur/orgs","repos_url":"https://api.github.com/users/meta-ishita-mathur/repos","events_url":"https://api.github.com/users/meta-ishita-mathur/events{/privacy}","received_events_url":"https://api.github.com/users/meta-ishita-mathur/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/meta-ishita-mathur/GET2018","description":null,"fork":false,"url":"https://api.github.com/repos/meta-ishita-mathur/GET2018","forks_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/forks","keys_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/keys{/key_id}","collaborators_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/teams","hooks_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/hooks","issue_events_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/issues/events{/number}","events_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/events","assignees_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/assignees{/user}","branches_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/branches{/branch}","tags_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/tags","blobs_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/git/refs{/sha}","trees_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/git/trees{/sha}","statuses_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/statuses/{sha}","languages_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/languages","stargazers_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/stargazers","contributors_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/contributors","subscribers_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/subscribers","subscription_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/subscription","commits_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/commits{/sha}","git_commits_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/git/commits{/sha}","comments_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/comments{/number}","issue_comment_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/issues/comments{/number}","contents_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/contents/{+path}","compare_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/compare/{base}...{head}","merges_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/merges","archive_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/downloads","issues_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/issues{/number}","pulls_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/pulls{/number}","milestones_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/milestones{/number}","notifications_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/labels{/name}","releases_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/releases{/id}","deployments_url":"https://api.github.com/repos/meta-ishita-mathur/GET2018/deployments","created_at":"2018-07-13T06:41:15Z","updated_at":"2018-07-13T09:23:57Z","pushed_at":"2018-07-26T06:43:52Z","git_url":"git://github.com/meta-ishita-mathur/GET2018.git","ssh_url":"git@github.com:meta-ishita-mathur/GET2018.git","clone_url":"https://github.com/meta-ishita-mathur/GET2018.git","svn_url":"https://github.com/meta-ishita-mathur/GET2018","homepage":null,"size":70,"stargazers_count":0,"watchers_count":0,"language":null,"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":7,"license":null,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/meta-ishita-mathur/GET2018/pulls/6"},"html":{"href":"https://github.com/meta-ishita-mathur/GET2018/pull/6"},"issue":{"href":"https://api.github.com/repos/meta-ishita-mathur/GET2018/issues/6"},"comments":{"href":"https://api.github.com/repos/meta-ishita-mathur/GET2018/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/meta-ishita-mathur/GET2018/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/meta-ishita-mathur/GET2018/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/meta-ishita-mathur/GET2018/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/meta-ishita-mathur/GET2018/statuses/5e6d6fa5ce2b6d0ef5d1cc40309cd6aa57c265e9"}},"author_association":"OWNER"}}
{"actor":{"display_login":"sandeep-sky"}}