← 返回 google 的题目列表Single Player Game on a One-Dimensional Board
类型:online_judge
There is a single-player game on a one-dimensional board with n positions. Each position can be empty (.), a Token (T), or a Coin (C). A token can be moved exactly 3 positions to the right, and each token can be moved multiple times. A coin is collected when a token moves onto the coin's position. A token cannot move if another token is already in the position it would move to. Find the maximum number of coins that can be collected.
Example
Input
['.', 'T', '.', 'C', '.', 'T', 'C']