Write a program to reverse a stack using recursion. You are not allowed to use any extra space other than the internal stack space used by recursion.
{
"stack": [
1,
2,
3,
4,
5
]
}[
5,
4,
3,
2,
1
]{
"stack": [
10,
20,
30
]
}[
30,
20,
10
]{
"stack": [
5
]
}[
5
]Sign in to Run Code and Submit