Skip to content

Commit 141a2c6

Browse files
committed
Fixed sonar
1 parent 1ce3bd8 commit 141a2c6

File tree

1 file changed

+4
-4
lines changed
  • src/main/kotlin/g3501_3600/s3516_find_closest_person

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ class Solution {
88
fun findClosest(x: Int, y: Int, z: Int): Int {
99
val d1 = abs(z - x)
1010
val d2 = abs(z - y)
11-
if (d1 == d2) {
12-
return 0
11+
return if (d1 == d2) {
12+
0
1313
} else if (d1 < d2) {
14-
return 1
14+
1
1515
} else {
16-
return 2
16+
2
1717
}
1818
}
1919
}

0 commit comments

Comments
 (0)