Ninth question in the quiz

how the time and space complexity both are o(N)?what is N here?please explain.

@Rj.25 Can you send the screenshot of the question. Because I can’t access the quiz due to some reason.

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.

Hey @Rj.25
Space complexity is 0(n) since you created a new string rev of same length n
Time complexity in 0(n) because for creating string and == operation you need linear traversal

If your doubt is resolved please mark it as closed.