https://practice.geeksforgeeks.org/problems/optimal-strategy-for-a-game/0