Motive interview question

Array and string Reverse string problem