3339. Find the Number of K-Even Arrays
You are given three integers
n,m, andk.An array
arris called k-even if there are exactlykindices such that, for each of these indicesi(0 <= i < n - 1):
(arr[i] * arr[i + 1]) - arr[i] - arr[i + 1]is even.Return the number of possible k-even arrays of size
nwhere all elements are in the range[1, m].Since the answer may be very large, return it modulo
109 + 7.
1 |