Sponsored
Use these hints if you're stuck. Try solving on your own first.
Can you think of a data structure that will allow you to store the position of each number?
Use that data structure to instantly replace a number with its new value.
Solve with full IDE support and test cases