JAVA_LeetCode 406_Queue Reconstruction by Height 풀이 class Solution { public int[][] reconstructQueue(int[][] people) { Arrays.sort(people, (a, b) -> { // 키가 같다면 k 기준 오름차순, 다르면 키 기준 내림차순 정렬 return (a[0] == b[0] ? a[1] - b[1] : b[0] - a[0]); }); List
JAVA_LeetCode 406_Queue Reconstruction by Height 풀이 class Solution { public int[][] reconstructQueue(int[][] people) { Arrays.sort(people, (a, b) -> { // 키가 같다면 k 기준 오름차순, 다르면 키 기준 내림차순 정렬 return (a[0] == b[0] ? a[1] - b[1] : b[0] - a[0]); }); List