BullsAndCows implementation