here is the [Problem][1].we are given an array. we have to find number of ways to partition array such that mex in each subset is not more than k .

i tried to solve it by first calculating all the ways to partition and then removing the ways which are not valid.

Sample input 1

n=10, k=3;

0 1 2 3 4 0 1 2 5 3

Output

379

total number of ways to partition are 2^(n-1)=2^9=512;

now i am having difficulty in removing the ways which are not valid.

can anyone help me to explain me this sample input.

[1]: https://www.codechef.com/SNCKEL17/problems/MEXDIV