BILL interview question

The question was based on Stacks from DSA