Pinterest Interview Question

Simple stack iteration