https://ide.codingblocks.com/s/112994.
In this all test cases are passed but it gives time limit error in last case.
Regarding unlock problem
@raushan.raman23011999 hey raushan this is because the last test is very large and it need more optimise method.
Here the step to how to write code for this problem
visit this link.
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.