Meta Interview Question

Leet code medium question using stacks. (Both questions)