Solves a mastermind sequence.