here is the [Problem].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
0 1 2 3 4 0 1 2 5 3
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.