구현
https://school.programmers.co.kr/learn/courses/30/lessons/147354
import java.util.*;
class Solution {
public int solution(int[][] data, int col, int row_begin, int row_end) {
int answer = 0;
Arrays.sort(data, (o1, o2) -> {
if(o1[col - 1] == o2[col - 1]) {
return o2[0] - o1[0];
}
return o1[col - 1] - o2[col - 1];
});
for(int i=row_begin - 1; i<row_end; i++) {
int sum = 0;
for(int value : data[i]) {
sum += value % (i + 1);
}
answer ^= sum;
}
return answer;
}
}
30분
람다식을 활용한 정렬 연습 실천!