{"action":"created","comment":{"url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/pulls/comments/240473624","pull_request_review_id":183510887,"id":240473624,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MDQ3MzYyNA==","diff_hunk":"@@ -0,0 +1,66 @@\n+/*K번째수\n+문제 설명\n+배열 array의 i번째 숫자부터 j번째 숫자까지 자르고 정렬했을 때, k번째에 있는 수를 구하려 합니다.\n+\n+예를 들어 array가 [1, 5, 2, 6, 3, 7, 4], i = 2, j = 5, k = 3이라면\n+\n+array의 2번째부터 5번째까지 자르면 [5, 2, 6, 3]입니다.\n+1에서 나온 배열을 정렬하면 [2, 3, 5, 6]입니다.\n+2에서 나온 배열의 3번째 숫자는 5입니다.\n+배열 array, [i, j, k]를 원소로 가진 2차원 배열 commands가 매개변수로 주어질 때,\n+commands의 모든 원소에 대해 앞서 설명한 연산을 적용했을 때 나온 결과를 배열에 담아 return 하도록 solution 함수를 작성해주세요.\n+\n+제한사항\n+array의 길이는 1 이상 100 이하입니다.\n+array의 각 원소는 1 이상 100 이하입니다.\n+commands의 길이는 1 이상 50 이하입니다.\n+commands의 각 원소는 길이가 3입니다.\n+입출력 예\n+array\tcommands\treturn\n+[1, 5, 2, 6, 3, 7, 4]\t[[2, 5, 3], [4, 4, 1], [1, 7, 3]]\t[5, 6, 3]\n+입출력 예 설명\n+[1, 5, 2, 6, 3, 7, 4]를 2번째부터 5번째까지 자른 후 정렬합니다. [2, 3, 5, 6]의 세 번째 숫자는 5입니다.\n+[1, 5, 2, 6, 3, 7, 4]를 4번째부터 4번째까지 자른 후 정렬합니다. [6]의 첫 번째 숫자는 6입니다.\n+[1, 5, 2, 6, 3, 7, 4]를 1번째부터 7번째까지 자릅니다. [1, 2, 3, 4, 5, 6, 7]의 세 번째 숫자는 3입니다.*/\n+\n+import java.util.Arrays;\n+\n+public class Solution8 {\n+    public int[] solution(int[] array, int[][] commands) {\n+\n+        int commandLength = commands.length;\n+        int answer[] = new int[commandLength];\n+        int first = 0, middle = 0, end = 0;\n+\n+        sort(array, commands, commandLength, answer);\n+        return answer;\n+    }\n+\n+    private void sort(int[] array, int[][] commands, int commandLength, int[] answer) {\n+        int first;\n+        int middle;\n+        int end;\n+        for (int i = 0; i < commandLength; i++) {\n+            first = commands[i][0];\n+            middle = commands[i][1];\n+            end = commands[i][2];\n+            int temp[] = new int[middle - first + 1];\n+\n+            for (int z = first - 1; z < middle; z++) {\n+                int a = 0;","path":"seokhun/programmers/kakao/Solution8.java","position":50,"original_position":50,"commit_id":"a021d5a2a848d0e4d7d90cc9b7827ccb90482f7d","original_commit_id":"09de4877db670348e9e4a47a9812fb0512831171","user":{"login":"tudiiii","id":43313866,"node_id":"MDQ6VXNlcjQzMzEzODY2","avatar_url":"https://avatars3.githubusercontent.com/u/43313866?v=4","gravatar_id":"","url":"https://api.github.com/users/tudiiii","html_url":"https://github.com/tudiiii","followers_url":"https://api.github.com/users/tudiiii/followers","following_url":"https://api.github.com/users/tudiiii/following{/other_user}","gists_url":"https://api.github.com/users/tudiiii/gists{/gist_id}","starred_url":"https://api.github.com/users/tudiiii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tudiiii/subscriptions","organizations_url":"https://api.github.com/users/tudiiii/orgs","repos_url":"https://api.github.com/users/tudiiii/repos","events_url":"https://api.github.com/users/tudiiii/events{/privacy}","received_events_url":"https://api.github.com/users/tudiiii/received_events","type":"User","site_admin":false},"body":"for문안에 int a=0;을 선언하시고 다음 줄에 temp[a++]를 하셨는데 결국 for문이 끝나면 다시 a가 0이 돼서 tmp[0]에 array[z]를 넣어주는 것과 같은 것 같은데, 혹시 그렇게 하신 이유가 있는지 궁금합니다..","created_at":"2018-12-11T04:57:06Z","updated_at":"2018-12-11T04:57:07Z","html_url":"https://github.com/AsCE-hyunseung/programming_note/pull/26#discussion_r240473624","pull_request_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/pulls/26","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/AsCE-hyunseung/programming_note/pulls/comments/240473624"},"html":{"href":"https://github.com/AsCE-hyunseung/programming_note/pull/26#discussion_r240473624"},"pull_request":{"href":"https://api.github.com/repos/AsCE-hyunseung/programming_note/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/pulls/26","id":236767925,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2NzY3OTI1","html_url":"https://github.com/AsCE-hyunseung/programming_note/pull/26","diff_url":"https://github.com/AsCE-hyunseung/programming_note/pull/26.diff","patch_url":"https://github.com/AsCE-hyunseung/programming_note/pull/26.patch","issue_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/issues/26","number":26,"state":"open","locked":false,"title":"[프로그래머스] K번째 수 (level 1)","user":{"login":"n1tjrgns","id":34465250,"node_id":"MDQ6VXNlcjM0NDY1MjUw","avatar_url":"https://avatars0.githubusercontent.com/u/34465250?v=4","gravatar_id":"","url":"https://api.github.com/users/n1tjrgns","html_url":"https://github.com/n1tjrgns","followers_url":"https://api.github.com/users/n1tjrgns/followers","following_url":"https://api.github.com/users/n1tjrgns/following{/other_user}","gists_url":"https://api.github.com/users/n1tjrgns/gists{/gist_id}","starred_url":"https://api.github.com/users/n1tjrgns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n1tjrgns/subscriptions","organizations_url":"https://api.github.com/users/n1tjrgns/orgs","repos_url":"https://api.github.com/users/n1tjrgns/repos","events_url":"https://api.github.com/users/n1tjrgns/events{/privacy}","received_events_url":"https://api.github.com/users/n1tjrgns/received_events","type":"User","site_admin":false},"body":"[프로그래머스] K번째 수 (level 1)","created_at":"2018-12-07T06:32:29Z","updated_at":"2018-12-11T04:57:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c3f02b21cf938cfb961b181337fcf7e6dc063fb5","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jhleed","id":13193624,"node_id":"MDQ6VXNlcjEzMTkzNjI0","avatar_url":"https://avatars1.githubusercontent.com/u/13193624?v=4","gravatar_id":"","url":"https://api.github.com/users/jhleed","html_url":"https://github.com/jhleed","followers_url":"https://api.github.com/users/jhleed/followers","following_url":"https://api.github.com/users/jhleed/following{/other_user}","gists_url":"https://api.github.com/users/jhleed/gists{/gist_id}","starred_url":"https://api.github.com/users/jhleed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhleed/subscriptions","organizations_url":"https://api.github.com/users/jhleed/orgs","repos_url":"https://api.github.com/users/jhleed/repos","events_url":"https://api.github.com/users/jhleed/events{/privacy}","received_events_url":"https://api.github.com/users/jhleed/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/pulls/26/commits","review_comments_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/pulls/26/comments","review_comment_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/issues/26/comments","statuses_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/statuses/a021d5a2a848d0e4d7d90cc9b7827ccb90482f7d","head":{"label":"AsCE-hyunseung:seokhun","ref":"seokhun","sha":"a021d5a2a848d0e4d7d90cc9b7827ccb90482f7d","user":{"login":"AsCE-hyunseung","id":42690640,"node_id":"MDQ6VXNlcjQyNjkwNjQw","avatar_url":"https://avatars2.githubusercontent.com/u/42690640?v=4","gravatar_id":"","url":"https://api.github.com/users/AsCE-hyunseung","html_url":"https://github.com/AsCE-hyunseung","followers_url":"https://api.github.com/users/AsCE-hyunseung/followers","following_url":"https://api.github.com/users/AsCE-hyunseung/following{/other_user}","gists_url":"https://api.github.com/users/AsCE-hyunseung/gists{/gist_id}","starred_url":"https://api.github.com/users/AsCE-hyunseung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AsCE-hyunseung/subscriptions","organizations_url":"https://api.github.com/users/AsCE-hyunseung/orgs","repos_url":"https://api.github.com/users/AsCE-hyunseung/repos","events_url":"https://api.github.com/users/AsCE-hyunseung/events{/privacy}","received_events_url":"https://api.github.com/users/AsCE-hyunseung/received_events","type":"User","site_admin":false},"repo":{"id":146076353,"node_id":"MDEwOlJlcG9zaXRvcnkxNDYwNzYzNTM=","name":"programming_note","full_name":"AsCE-hyunseung/programming_note","private":false,"owner":{"login":"AsCE-hyunseung","id":42690640,"node_id":"MDQ6VXNlcjQyNjkwNjQw","avatar_url":"https://avatars2.githubusercontent.com/u/42690640?v=4","gravatar_id":"","url":"https://api.github.com/users/AsCE-hyunseung","html_url":"https://github.com/AsCE-hyunseung","followers_url":"https://api.github.com/users/AsCE-hyunseung/followers","following_url":"https://api.github.com/users/AsCE-hyunseung/following{/other_user}","gists_url":"https://api.github.com/users/AsCE-hyunseung/gists{/gist_id}","starred_url":"https://api.github.com/users/AsCE-hyunseung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AsCE-hyunseung/subscriptions","organizations_url":"https://api.github.com/users/AsCE-hyunseung/orgs","repos_url":"https://api.github.com/users/AsCE-hyunseung/repos","events_url":"https://api.github.com/users/AsCE-hyunseung/events{/privacy}","received_events_url":"https://api.github.com/users/AsCE-hyunseung/received_events","type":"User","site_admin":false},"html_url":"https://github.com/AsCE-hyunseung/programming_note","description":"note.","fork":false,"url":"https://api.github.com/repos/AsCE-hyunseung/programming_note","forks_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/forks","keys_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/teams","hooks_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/hooks","issue_events_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/issues/events{/number}","events_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/events","assignees_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/assignees{/user}","branches_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/branches{/branch}","tags_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/tags","blobs_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/git/refs{/sha}","trees_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/statuses/{sha}","languages_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/languages","stargazers_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/stargazers","contributors_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/contributors","subscribers_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/subscribers","subscription_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/subscription","commits_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/commits{/sha}","git_commits_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/git/commits{/sha}","comments_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/comments{/number}","issue_comment_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/issues/comments{/number}","contents_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/contents/{+path}","compare_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/merges","archive_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/downloads","issues_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/issues{/number}","pulls_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/pulls{/number}","milestones_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/milestones{/number}","notifications_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/labels{/name}","releases_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/releases{/id}","deployments_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/deployments","created_at":"2018-08-25T07:44:51Z","updated_at":"2018-12-10T09:37:10Z","pushed_at":"2018-12-10T09:37:08Z","git_url":"git://github.com/AsCE-hyunseung/programming_note.git","ssh_url":"git@github.com:AsCE-hyunseung/programming_note.git","clone_url":"https://github.com/AsCE-hyunseung/programming_note.git","svn_url":"https://github.com/AsCE-hyunseung/programming_note","homepage":"https://asce-hyunseung.tistory.com","size":638,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":2,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"AsCE-hyunseung:master","ref":"master","sha":"c501354c1c1966ac5058a0c4eb8ff37ebc4bbd6c","user":{"login":"AsCE-hyunseung","id":42690640,"node_id":"MDQ6VXNlcjQyNjkwNjQw","avatar_url":"https://avatars2.githubusercontent.com/u/42690640?v=4","gravatar_id":"","url":"https://api.github.com/users/AsCE-hyunseung","html_url":"https://github.com/AsCE-hyunseung","followers_url":"https://api.github.com/users/AsCE-hyunseung/followers","following_url":"https://api.github.com/users/AsCE-hyunseung/following{/other_user}","gists_url":"https://api.github.com/users/AsCE-hyunseung/gists{/gist_id}","starred_url":"https://api.github.com/users/AsCE-hyunseung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AsCE-hyunseung/subscriptions","organizations_url":"https://api.github.com/users/AsCE-hyunseung/orgs","repos_url":"https://api.github.com/users/AsCE-hyunseung/repos","events_url":"https://api.github.com/users/AsCE-hyunseung/events{/privacy}","received_events_url":"https://api.github.com/users/AsCE-hyunseung/received_events","type":"User","site_admin":false},"repo":{"id":146076353,"node_id":"MDEwOlJlcG9zaXRvcnkxNDYwNzYzNTM=","name":"programming_note","full_name":"AsCE-hyunseung/programming_note","private":false,"owner":{"login":"AsCE-hyunseung","id":42690640,"node_id":"MDQ6VXNlcjQyNjkwNjQw","avatar_url":"https://avatars2.githubusercontent.com/u/42690640?v=4","gravatar_id":"","url":"https://api.github.com/users/AsCE-hyunseung","html_url":"https://github.com/AsCE-hyunseung","followers_url":"https://api.github.com/users/AsCE-hyunseung/followers","following_url":"https://api.github.com/users/AsCE-hyunseung/following{/other_user}","gists_url":"https://api.github.com/users/AsCE-hyunseung/gists{/gist_id}","starred_url":"https://api.github.com/users/AsCE-hyunseung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AsCE-hyunseung/subscriptions","organizations_url":"https://api.github.com/users/AsCE-hyunseung/orgs","repos_url":"https://api.github.com/users/AsCE-hyunseung/repos","events_url":"https://api.github.com/users/AsCE-hyunseung/events{/privacy}","received_events_url":"https://api.github.com/users/AsCE-hyunseung/received_events","type":"User","site_admin":false},"html_url":"https://github.com/AsCE-hyunseung/programming_note","description":"note.","fork":false,"url":"https://api.github.com/repos/AsCE-hyunseung/programming_note","forks_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/forks","keys_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/teams","hooks_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/hooks","issue_events_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/issues/events{/number}","events_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/events","assignees_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/assignees{/user}","branches_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/branches{/branch}","tags_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/tags","blobs_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/git/refs{/sha}","trees_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/statuses/{sha}","languages_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/languages","stargazers_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/stargazers","contributors_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/contributors","subscribers_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/subscribers","subscription_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/subscription","commits_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/commits{/sha}","git_commits_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/git/commits{/sha}","comments_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/comments{/number}","issue_comment_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/issues/comments{/number}","contents_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/contents/{+path}","compare_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/merges","archive_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/downloads","issues_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/issues{/number}","pulls_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/pulls{/number}","milestones_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/milestones{/number}","notifications_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/labels{/name}","releases_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/releases{/id}","deployments_url":"https://api.github.com/repos/AsCE-hyunseung/programming_note/deployments","created_at":"2018-08-25T07:44:51Z","updated_at":"2018-12-10T09:37:10Z","pushed_at":"2018-12-10T09:37:08Z","git_url":"git://github.com/AsCE-hyunseung/programming_note.git","ssh_url":"git@github.com:AsCE-hyunseung/programming_note.git","clone_url":"https://github.com/AsCE-hyunseung/programming_note.git","svn_url":"https://github.com/AsCE-hyunseung/programming_note","homepage":"https://asce-hyunseung.tistory.com","size":638,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":2,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AsCE-hyunseung/programming_note/pulls/26"},"html":{"href":"https://github.com/AsCE-hyunseung/programming_note/pull/26"},"issue":{"href":"https://api.github.com/repos/AsCE-hyunseung/programming_note/issues/26"},"comments":{"href":"https://api.github.com/repos/AsCE-hyunseung/programming_note/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/AsCE-hyunseung/programming_note/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/AsCE-hyunseung/programming_note/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AsCE-hyunseung/programming_note/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/AsCE-hyunseung/programming_note/statuses/a021d5a2a848d0e4d7d90cc9b7827ccb90482f7d"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"tudiiii"}}