Please enter your email address or userHandle.
An string of words is given, the task is to reverse the string using stack.
The first line of input will contains an integer T denoting the no of test cases . Then T test cases follow. Each test case contains a string s of words without spaces.
For each test case ,print the reverse of the string in new line.
Since this is a function problem, you don't need to take any input. Just complete the provided function.
1 <= T <= 100
1 <= length of the string <= 100
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Login to access your submissions.
Please choose 'ReadOnlyMode' if you needn't to 'Edit' the problem e.g. viewing OJ's solution, TestCase Files (TCFs), TimeLimit etc.