Skip to content

Commit f3548a8

Browse files
committed
Fixed style
1 parent 48ca70b commit f3548a8

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/main/java/g3201_3300/s3248_snake_in_matrix/Solution.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,24 @@ public int finalPositionOfSnake(int n, List<String> commands) {
1111
for (String command : commands) {
1212
switch (command) {
1313
case "UP":
14-
if (x > 0) x--;
14+
if (x > 0) {
15+
x--;
16+
}
1517
break;
1618
case "DOWN":
17-
if (x < n - 1) x++;
19+
if (x < n - 1) {
20+
x++;
21+
}
1822
break;
1923
case "LEFT":
20-
if (y > 0) y--;
24+
if (y > 0) {
25+
y--;
26+
}
2127
break;
2228
case "RIGHT":
23-
if (y < n - 1) y++;
29+
if (y < n - 1) {
30+
y++;
31+
}
2432
break;
2533
}
2634
}

src/main/java/g3201_3300/s3250_find_the_count_of_monotonic_pairs_i/Solution.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ public int countOfPairs(int[] nums) {
1111
for (int i = 1; i < nums.length; i++) {
1212
currShift = Math.max(currShift, nums[i] - maxShift[i - 1]);
1313
maxShift[i] = Math.min(maxShift[i - 1], nums[i] - currShift);
14-
if (maxShift[i] < 0) return 0;
14+
if (maxShift[i] < 0) {
15+
return 0;
16+
}
1517
}
1618
int[][] cases = getAllCases(nums, maxShift);
1719
return cases[nums.length - 1][maxShift[nums.length - 1]];

0 commit comments

Comments
 (0)