반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 영속 자료구조
- 스프링 스케쥴러
- @EnableScheduling
- 스택/큐
- 모던 자바 인 액션
- 정렬
- 다리를 지나는 트럭
- 쿠버네티스
- 코딩 테스트
- kubenetes
- 고차원 함수
- @Getter
- 해시
- 알고리즘
- 가장 큰 수
- 기능개발
- K번째수
- 커링
- 프로그래머스
- @Data
- 크론 표현식
- 검색 기능 확장
- 전화번호 목록
- H-index
- Java
- 롬복 어노테이션
- @Setter
- 완주하지 못한 선수
- 루씬 인 액션
- @configuration
Archives
- Today
- Total
목록K번째수 (1)
Today I Learned

자르고, 정렬하고, 뽑고 끝! 코드 import java.util.*; class Solution { public int[] solution(int[] array, int[][] commands) { int[] answer = new int[commands.length]; int[] copyArray = {}; for(int i = 0; i < commands.length; i++){ int[] command = commands[i]; copyArray = Arrays.copyOfRange(array, command[0]-1, command[1]); Arrays.sort(copyArray); answer[i] = copyArray[command[2]-1]; } return answer; } } 결과 자바..
알고리즘 & 코딩테스트
2021. 1. 22. 01:39