Doubt in reversing the stack

the question which was done by sir in video is wrong

question is given a stackarray as 10,20,30,40,50 we have to reverse it by using a helper ,final stack should look like 50,40,30,20,10 but sir has done it wrong he simply use a pop up function firstly and store item in helper and then use pop up function for helper and store item in stack but it doesnot give the output which we want it gives the same array as given in question
plz tell the right approach

Hey @harsh.hj
logic is correct in this video.
you are doing wrong .
Please share your code:

ya i have understood the logic thanks