EY interview question

Pattern printing, Reverse a string