There are two arrays named Pushed and Popped. You have tell if the Popped sequence can be a valid sequence for provided Pushed sequence in a stack
e.g. Pushed=[2,4,1,3,5] and Popped=[4,3,5,1,2] is valid but Popped=[3,1,5,2,4] is not. We can pop at any stage after adding certain elements to stack.