프로그래머스(Level1) K번째수

Luke·2021년 8월 11일
0
function solution(array, commands) {
    let result = [];
    for(let i=0; i<commands.length; i++) {
        result.push(array.slice(commands[i][0]-1,commands[i][1]).sort((a,b)=>a-b)[commands[i][2]-1]);
    }
    return result;
}

0개의 댓글