Getting a tle on running on ide

https://ide.codingblocks.com/s/347520

Hey @Parmeet-Kalsi-1631789033630118
Did 3 changes and mentioned them in comments https://ide.codingblocks.com/s/347528

Thanks for correction,
I want to ask is there any better approach complexity wise or this is fine.

1 Like

This is fine, Your time & space both is O(n) at max.
Please hit a like and mark this as resolved
:slight_smile:

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.