✅ What You Should Do
1Take a string input from the user.
2Push each character onto a stack.
3Pop characters from the stack and append them to a new string.
4Print the reversed string.
Why does a stack reverse the string? Push order = original order; pop order = the reverse of push order → appending the popped characters gives the reversed string.
Complexity: each character is pushed once and popped once → O(n) time, plus one stack → O(n) space.