https://tutorial.eyehunts.com/java/black-and-white-hats-puzzle/
Black and White Hats Puzzle