Qualcomm interview question

Reverse a string using stack, and then a further optimization was asked where I had to reverse only half a string.

Interview Answer

Anonymous

23 Aug 2021

I went with the very usual approach where you could just push in the whole string in the stack and then poping it would reverse the string. For the latter, I pushed half a string and popped it.