Google Interview Question

Basic stack question with a followup