Reverse String
Use a Stack to reverse the order of characters.
Input
HELLO
Output
Empty
Status: Ready
Speed
Algorithm Logic
1function reverse(s):
2 stack = []
3 for char in s:
4 stack.push(char)
5
6 result = ""
7 while !stack.empty:
8 result += stack.pop()
9 return result