Mohit Sharma interview question

Reverse the substring, sorting the elements in an array for coding test