Comment

Comment by shard

Does this formulation work?

You have 6 wooden blocks, each can be 1 of 6 colors. There will always be either (A) 3 blocks of the same color, or (B) 3 blocks of different colors.

Iterating through all possibilities:

6 of 1 color - case A

5 of 1 color, 1 of another - case A

4 of 1 color, 2 of another - case A

4 of 1 color, 1 of another, 1 of yet another - case A and B

3 of 1 color, 3 of another - case A

3 of 1 color, 2 of another, 1 of yet another - case A and B

3 of 1 color, 1 of another, 1 of yet another, 1 of another another - case A and B

2 of 1 color, 2 of another, 2 of yet another - case B

2 of 1 color, 2 of another, 1 of yet another, 1 of another another - case B

2 of 1 color, 1 of another, 1 of yet another, 1 of another another, 1 of another another another - case B

all colors different - case B

parent shard 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton