Swift 프로그래머스 K번째 수
Youtube 풀이영상 Problem 코딩테스트 연습 - K번째수 [1, 5, 2, 6, 3, 7, 4] [[2, 5, 3], [4, 4, 1], [1, 7, 3]] [5, 6, 3] programmers.co.kr Source Code func solution(_ array:[Int], _ commands:[[Int]]) -> [Int] { var answer:[Int] = [] for command in commands { let i = command[0] - 1 let j = command[1] - 1 let k = command[2] - 1 let number = Array(array[i...j]).sorted()[k] answer.append(number) } return answer } fun..
2020. 2. 7.