Skip to content

Commit afdeeb8

Browse files
committed
Fixed style
1 parent 1780239 commit afdeeb8

File tree

1 file changed

+14
-4
lines changed
  • src/main/kotlin/g3501_3600/s3548_equal_sum_grid_partition_ii

1 file changed

+14
-4
lines changed

src/main/kotlin/g3501_3600/s3548_equal_sum_grid_partition_ii/Solution.kt

+14-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ class Solution {
2323
var s: Long = 0
2424
for (i in 0..<r.size - 1) {
2525
s += r[i].toLong()
26-
if (s * 2 == total || s * 2 - grid[i][n - 1] == total || s * 2 - grid[i][0] == total || s * 2 - grid[0][0] == total || s * 2 - grid[0][n - 1] == total) {
26+
if (s * 2 == total || s * 2 - grid[i][n - 1] == total ||
27+
s * 2 - grid[i][0] == total || s * 2 - grid[0][0] == total ||
28+
s * 2 - grid[0][n - 1] == total
29+
) {
2730
return true
2831
}
2932
if (s * 2 > total) {
@@ -33,7 +36,10 @@ class Solution {
3336
s = 0
3437
for (i in m - 1 downTo 0) {
3538
s += r[i].toLong()
36-
if (s * 2 == total || s * 2 - grid[i][n - 1] == total || s * 2 - grid[i][0] == total || s * 2 - grid[m - 1][n - 1] == total || s * 2 - grid[m - 1][0] == total) {
39+
if (s * 2 == total || s * 2 - grid[i][n - 1] == total ||
40+
s * 2 - grid[i][0] == total || s * 2 - grid[m - 1][n - 1] == total ||
41+
s * 2 - grid[m - 1][0] == total
42+
) {
3743
return true
3844
}
3945
if (s * 2 > total) {
@@ -45,7 +51,9 @@ class Solution {
4551
for (ints in grid) {
4652
s += ints[i].toLong()
4753
}
48-
if (s * 2 == total || s * 2 - grid[0][0] == total || s * 2 - grid[m - 1][0] == total || s * 2 - grid[0][i] == total || s * 2 - grid[m - 1][i] == total) {
54+
if (s * 2 == total || s * 2 - grid[0][0] == total || s * 2 - grid[m - 1][0] == total ||
55+
s * 2 - grid[0][i] == total || s * 2 - grid[m - 1][i] == total
56+
) {
4957
return true
5058
}
5159
if (s * 2 > total) {
@@ -57,7 +65,9 @@ class Solution {
5765
for (j in m - 1 downTo 0) {
5866
s += grid[j][i].toLong()
5967
}
60-
if (s * 2 == total || s * 2 - grid[m - 1][n - 1] == total || s * 2 - grid[0][n - 1] == total || s * 2 - grid[0][i] == total || s * 2 - grid[m - 1][i] == total) {
68+
if (s * 2 == total || s * 2 - grid[m - 1][n - 1] == total || s * 2 - grid[0][n - 1] == total ||
69+
s * 2 - grid[0][i] == total || s * 2 - grid[m - 1][i] == total
70+
) {
6171
return true
6272
}
6373
if (s * 2 > total) {

0 commit comments

Comments
 (0)