Morgan Stanley Interview Question

implement a stack