What is need of separate code for queue implementation using stack?

Can’t we use ‘reverse a stack’ code to implement dequeue? What I mean is that if we reversed a stack, dequeue will work by just popping the elements from stack right? For example : 5, 4, 3, 2, 1 - Initial stack /n
1, 2, 3, 4, 5 - Desired Dequeue output /n
1, 2, 3, 4, 5 - Reversing Stack /n
1, 2, 3, 4, 5 - popping elements in the above-reversed stack

That’s exactly how this problem is solved

I just watched the entire video just now, got it thanks.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.