Flourish interview question

Leetcode style with predefined skeleton