Infosys interview question

How to reverse a string ?

Interview Answer

Anonymous

20 Jun 2019

Take two pointers, one at start and one at end. Start swapping the values at the two pointers and increase start by one and decrease end by one. Repeat the process till start