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

유지원·2022년 1월 13일
0

프로그래머스

목록 보기
11/66

문제 링크

https://programmers.co.kr/learn/courses/30/lessons/42748?language=javascript


Javascript

function solution(array, commands) {
  return commands.map(c => array.slice(c[0]-1,c[1]).sort((a,b)=>a-b)[c[2]-1])
}
profile
👋 https://github.com/ujw0712

0개의 댓글