Skip to content

Commit 3635744

Browse files
authored
Create 1637-widest-vertical-area-between-two-points-containing-no-points.kt
1 parent 3cb0d51 commit 3635744

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Solution {
2+
fun maxWidthOfVerticalArea(points: Array<IntArray>): Int {
3+
points.sortBy { it[0] }
4+
var res = -1
5+
for (i in 1 until points.size)
6+
res = maxOf(res, points[i][0] - points[i - 1][0])
7+
return res
8+
}
9+
}

0 commit comments

Comments
 (0)