Lime interview question

Leetcode Medium for the most part