I was at a technical discussion earlier this morning and the chairperson invited me to play a game with him.
There are a sequence of 'n' blocks, every player on his chance could choose 2 adjacent blocks and mark them as filled. The players continue to do this until the last pair of adjacent blocks is filled. The person filling the last pair loses the game.
Question: I was later asked if I could build a program on C++ that would provide hints to every player at each chance to identify which of the available pairs would give him the maximum chances of winning considering the current status of the board.
I'm sure there is a design / algotithm for this. Just that I'm not able to identify it. Can you please help me with a possible way of approaching the problem. Is there an established problem that covers something similar (like the partition problem)
Aucun commentaire:
Enregistrer un commentaire