Answer:
Push Z
Push Y
Pop Y
Push X
Pop X
Push W
Push V
Pop V
Push U
Pop U
Pop W
Pop Z
Push T
Push S
Pop S
Push R
Pop R
Pop T
Step-by-step explanation:
A stack is a term in computer science that defines an abstract data type that acts as a collection of elements. It has two operations which are mainly push and pop.
Push is used in adding elements to the collection, while pop is used in removing elements from the collection.
If the element A has been pushed to the stack, you check if the top element in the pop[] sequence is A or not.
If it is A, you then pop it right, else top of the push[] sequence will be changed and make the sequences invalid.
So, similarly do the same for all the elements and check if the stack is empty or not in the last.
If empty you then print True else print False.