Unlock Problem STL

https://ide.codingblocks.com/s/224551.
Why it is giving wrong answer.

Sir can u please help me out.

@rohit2299
Hi,
Solve this problem by taking into consideration that at most k swaps are required. Not exactly k swaps.

I am considering atmost k swap in my code.

@rohit2299
refer to this