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
|
43 Discussions
|
Please Login in order to post a comment
As a user reading this, it honestly felt like solving a small puzzle game. While going through the grid updates step by step, it reminded me of how I once watched my little cousin build stories and worlds in games like Toca Boca World — simple rules but endless creativity. Experiences like that, which I first learned about through tocabocaa.com, show how even basic logic or games can turn into fun storytelling moments when explained clearly.
The number of squares with the highest 'x' count may exceed the range of a 32 bit integer so use long variables instead.
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.