Fidelity International interview question

Reverse a string DSA question