In the solution which is documented enough for a good understanding i have reduced the problem to find the sets of the group(offers) which cant be dealt with together and used an array named graph to store this to find the solution.
@randomizer I followed an approach similar to yours in making the m * m matrix denoting intersections but after that i used an exponential solution (of order O(m)*m ) to get the answer. here is link to my solution for reference right now. I will tell you what is wrong with your code in some time.
//this piece finds the possible groups
which can sit starting from the [row]
which has lowest number of 1s because
it will have least number of
collisions
Your criteria for selecting the customer with minimum clash is wrong.
This the test case answer is 3. test
100 9
1 1
3 2 1 9
3 3 1 9
3 4 1 9
3 5 1 9
3 6 1 9
5 2 3 4 5 6
2 6 7
2 7 9
Your program giving 2.