CoStar Group Interview Question

whiteboarding problem to implement stack and functions