Ways to color a 3xN Board
Given a 3 x A board, find the number of ways to color it using at most 4 colors such that no 2 adjacent boxes have same color.
Diagonal neighbors are not treated as adjacent boxes.
Return the ways modulo 109 + 7 as the answer grows quickly.
Input Format:
Output Format:
Constraints:
Examples:
Last updated