JMAN Group interview question

How to reverse a string with proper working code.