Question: There are n coins in a line. Two players take turns to take a coin from one of the ends of the line until there are no more coins left. The player with the larger amount of money wins. Assume that you go first, describe an algorithm to compute the maximum amount of money you can win.
Read full article from Get maximum sum from coins in a line | PROGRAMMING INTERVIEWS
No comments:
Post a Comment