Unlock (using hashing) problem

https://ide.geeksforgeeks.org/987BjnZmnb---what’s the error in the code i m not getting correct ouput

@AbhishekAhlawat1102
you have to change the index of both the swapped elements in hashmap also.
but you have done it for only one element.