Morgan Stanley Interview Question

data structure and algorithm