fixed the algorithm in BullsAndCowsNumber