DSA Key Problems

Stone Game

Two players alternately take an entire pile from either end of a row of piles. Given the pile sizes and optimal play, determine whether the first player finishes with more stones.