Help me in solving DSAJ49 problem

My issue

Not able to solve this problem

Learning course: DSA using Java
Problem Link: Pop Quiz - String reversal Practice Problem in DSA using Java - CodeChef