Skip to content

Commit c2267f3

Browse files
authored
[20250914] PGM / LV2 / 테이블 해시 함수 / 김수연
[20250914] PGM / LV2 / 테이블 해시 함수 / 김수연
2 parents a31d37a + 9a0bed9 commit c2267f3

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
```java
2+
import java.util.*;
3+
class Solution {
4+
public int solution(int[][] data, int col, int row_begin, int row_end) {
5+
int answer = 0;
6+
Arrays.sort(data, (a, b) -> {
7+
if (a[col-1] == b[col-1]) return b[0] - a[0];
8+
return a[col-1] - b[col-1];
9+
});
10+
for (int i = row_begin-1; i <= row_end-1; i++) {
11+
int S = 0;
12+
for (int j = 0; j < data[0].length; j++) {
13+
S += (data[i][j] % (i+1));
14+
}
15+
answer = answer ^ S;
16+
}
17+
18+
return answer;
19+
}
20+
}
21+
```

0 commit comments

Comments
 (0)