count number of sets formed by taking one element from each array
Answers
Answered by
0
Given three positive integers n, k and x. The task is to count the number of different array that can be formed of size n such that each element is between 1 to k and two consecutive element are different. Also, the first and last elements of each array should be 1 and x respectively.
Examples :
Input : n = 4, k = 3, x = 2 Output : 3
Examples :
Input : n = 4, k = 3, x = 2 Output : 3
Similar questions