Snap Finance interview question

Look for "candy" on leetcode