Unlock getting exception, please check

Hi, I am getting exception while testing code in the platfrom but it works fine in my pc please check.

Please share your code through ide.codingblocks.com

ttp://d.cb.lk/t/27195

Hey @dev_emma because of 0 based indexing used by you in the arr array thinks became confusing and thats why you were getting the error.


i have simplified the code and added comments against the things changed in the code. If you are unable to understand something please feel free to ask.

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.