You are given an array A of size N. You need to push the elements of the array into a stack and then print them while popping.
The first line of input contains T denoting the number of testcases. T testcases follow. Each testcase contains two lines of input. The first line of input contains size of array N. The second line of array contains the elements of array separated by spaces.
For each testcase, in a new line, print the required output.
Since this is a function problem, you don't need to take any input. Just complete the provided functions _push() and _pop().
1 <= T <= 100
1 <= Ai <= 107
1 2 3 4 5
1 6 43 1 2 0 5
5 4 3 2 1
5 0 2 1 43 6 1
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.