276. Paint Fence
276. Paint Fence You are painting a fence of n posts with k different colors. You must paint the posts following these rules: Every post must be painted exactly one color. At most one pair of adjacent fence posts can have the same color. Given the two integers n and k, return the number of ways you can paint the fence. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Example 1: Input: n = 3, k = 2 Output: 6 Explanation: All the possibilities are shown....