IndiaMART interview question

1. Reverse a string with O(1) space.