Sponsored
Use these hints if you're stuck. Try solving on your own first.
To solve the problem without the extra space, we need to think about how many times each number occurs in relation to the index.
Solve with full IDE support and test cases