We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Mathematics
- Geometry
- Rectangular Game
- Discussions
Rectangular Game
Rectangular Game
Sort by
recency
|
41 Discussions
|
Please Login in order to post a comment
def solve(steps): # Write your code here first = True for i in steps: if first: minrow = i[0] mincol = i[1] first = False else: if i[0] < minrow: minrow = i[0] if i[1] < mincol: mincol = i[1] return (minrow * mincol)
In Kotlin, I got an overflow error in some test cases. I needed to change the return type for Long to make it pass.
Java :
python code def solve(steps): x = [] y = [] for i in range(n): x.append(steps[i][0]) y.append(steps[i][1]) x1 = min(x) y1 = min(y) result = x1*y1 return result