Unlock Problem - 3rd test case is not passed!

Hello @Bhavya_Goel,

I have corrected your code:

Refer to comments for better understanding.
hope this would help.