Welcome back readers!

We hope that you understand the uses of Stack so far. Stacks have a wide range of applications because they make an excellent mechanism for temporary storage of information within procedures.

In this problem we will look at another application of Stack.

**Important Links :**Question Video

Yes! We will be solving this problem using Stack.

But before moving any further it is advised that you give this problem a try and think of possible ways in which you can solve this.

Let's jump to the problem.