Minimax solution to a practice interview question