Problem: CROWD
Editorial: CROWD Editorial
I just wanted to ask that if there are 5 houses in a row, how are there 8 ways so select conflicting houses? (The answer according to the code given in the editorial).
According to me, conflicting sets of houses would be: {1,2,3} {2,3,4} {3,4,5} {1,2,3,4} {2,3,4,5} {1,2,3,4,5} (6 sets) which would have conflicts.
I solved the problem using the formula: and I can’t understand what’s wrong with this approach!
Any help would be appreciated! Thanks in advance!