Sponsored
Use these hints if you're stuck. Try solving on your own first.
Try simulating the entire process.
To reduce space, use a temporary array to update nums in every step instead of creating a new array at each step.
Solve with full IDE support and test cases