Leetcode: Day 114, Lintcode, #395, Coins in a Line II
Day 114, Lintcode, #395, Coins in a Line II
Coins in a Line II
方法一
coins表示在i点的最大利益
getTwo表示在i点最大利益是否要取2个coin
There are n coins with different value in a line. Two players take turns to take one or two coins from left side until there are no more coins left. The player who take the coins with the most value wins.
Could you please decide the first player will win or lose?
-----------------------------------------------------方法一
coins表示在i点的最大利益
getTwo表示在i点最大利益是否要取2个coin
Read full article from Leetcode: Day 114, Lintcode, #395, Coins in a Line II
No comments:
Post a Comment