Run Error. Isn't the time complexity O(n)?
hello @alien,
your code time complexity is O(n).

you are getting run error becuase u are poping element from stack without checking whether stack is empty or not.
if stack is empty then in that case u cannot pop element from it, in that case u should print No code(check output format of this question).
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.