Time Limit Error

Sir/Mam
I am getting time limit error in one test case while rest test cases are correct. So do i resolve this?
Also if there is any swap function that can be used here?

pls send the code ide link

Create the map by filling the number as the key and the index at which it is present as the value
Iterate over the whole array.
For element at a particular index m we will check if it is present at its best spot or not.
The best spot of any number num is the N-num index of the array.
If the number is not present at its best spot then we will swap the number with element present at that spot.
As we have stored the index of every element in the map we can easily retrieve that from the map to get the swap done.

This is the link to code: https://ide.codingblocks.com/s/163242

Any replies sir, the link to code has been shared

bro pls send qn link also, mujhe qn nahi mil rha hain

sorry, i definitely reply to u
or u can ask the doubt again

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.