Number of Ways to Paint N × 3 Grid(LeetCode 1411):

Problem