The Jonah Group interview question

General data structure and algorithm on leetcode