problem
class Solution {
fun maxArea(h: Int, w: Int, horizontalCuts: IntArray, verticalCuts: IntArray): Int {
horizontalCuts.sort()
verticalCuts.sort()
var maxH = 0
var row = 0
for (i in horizontalCuts.indices) {
maxH = maxOf(maxH, horizontalCuts[i] - row)
row = horizontalCuts[i]
}
maxH = maxOf(maxH, h - horizontalCuts[horizontalCuts.size - 1])
var maxV = 0
var col = 0
for (i in verticalCuts.indices) {
maxV = maxOf(maxV, verticalCuts[i] - col)
col = verticalCuts[i]
}
maxV = maxOf(maxV, w - verticalCuts[verticalCuts.size - 1])
return ((maxH.toLong() * maxV.toLong()) % 1000000007).toInt()
}
}