Count the Number of Arrays with K Matching Adjacent Elements | Leetcode 3405