We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3dbab61 commit e987e73Copy full SHA for e987e73
LiiNi-coder/202511/17 PGM n^2 배열 자르기
@@ -0,0 +1,18 @@
1
+```java
2
+class Solution {
3
+ public int[] solution(int n, long left, long right) {
4
+ long size = right - left + 1;
5
+ int[] answer = new int[(int)size];
6
+ for(int i = 0; i < size; i++){
7
+ long index = left + i;
8
+ long row = index / n;
9
+ long col = index % n;
10
+ answer[i] = (int)(Math.max(row, col) + 1);
11
+
12
+ // System.out.println(index + " " + row + " " + col);
13
+ }
14
+ return answer;
15
16
+}
17
18
+```
0 commit comments