FrontendX
Box Rotation Simulation
medium
Description
AI Assistance
Solution
Test Cases
Test Result
Submissions
Canvas
Box Rotation
Simulation
Simulate gravity on stones and rotate matrix using two pointers per row.
Examples
Example 1
Input:
[1,2,3]
Output:
[]
Example 2
Input:
[1,2,3]
Output:
[]
Hints
Hint 1
Handle gravity first, then rotation - or vice versa, depending on the problem.
Hint 2
Process each row independently with two-pointer technique.
Hint 3
Consider using in-place transformations to avoid extra space.
Box Rotation Simulation
Simulate gravity on stones and rotate matrix using two pointers per row.