Dell Technologies Interview Question

Dsa question related to the reverse the string