Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use a hash table to efficiently map each number to all of its indices in the container and to map each index to their current number.
In addition, you can use ordered set to store all of the indices for each number to solve the find method. Do not forget to update the ordered set according to the change method.