Ezvor

2113. Elements in Array After Removing and Replacing Elements

MediumArray Preparing judge… LeetCode
Array

Hints

Hint 1
Try to find a pattern in how nums changes.
Hint 2
Let m be the original length of nums. If time_i / m (integer division) is even, then nums is at its original size or decreasing in size. If it is odd, then it is empty, or increasing in size.
Hint 3
time_i % m can be used to find how many elements are in nums at minute time_i.