Nisum interview question

Data structures and problem solving