Help needed in recent codeforces rounds 699 DIV2 C problem

Can anyone of you tell me how THIS solution wrong for THIS problem. I have done almost the same thing the editorial tells us to do .
Explanation to code:
in vis array I am storing that whether the ith element occurs in array b. the array cnt stores the no. of time ith painter we need and the cnt1 stores the no. of ith painter we have. vector v[i] stores the position of the ith element in the array b . and po array is for the pointer to the vector of vector.
UPDATE : The mistake has been found