LinkedIn interview question

Leetcode/CTCI mediums.