Google Interview Question

Leetcode medium problem on stacks