Wise interview question

hackerrank type question involving data structures