HCLTech Interview Question

They asked to write a code to reverse a string