I probably don't understand the problem... because i don't get the same score on two test cases (4 and 10). Could you please explain me for example sample solution for test case 10?
I am using, two adjacent groups should not have the same type and all from one group to get the same cookies...