Toptal interview question

Question about domino dots in a leetcode style question.