Ab Initio Interview Question

Solve the mastermind board game algorithmically.