Bloomberg Interview Question

candy crush. it's on leetcode