= maximum stones the current player can collect from piles when the parameter is . Base case: if , no piles left, return .
If , current player takes all remaining piles. Transition: try taking piles for to . Stones I get = suffix suffix. Then opponent plays from with . My total = stones taken (remaining opponent's best).