Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Understand the order in which the indices are removed from the array.
We don’t really need to delete or move the elements, only the array length matters.
Upon removing an index, decide how many steps it takes to move to the next one.
Use a data structure to speed up the calculation.