← 返回 google 的题目列表Collect Maximum Coins
类型:online_judge
You are given a one-dimensional board with n positions, where each position may be empty (.), contain a token (T), or contain a coin (C). Tokens can be moved any number of times, but each move must be exactly 3 positions to the right. A coin is collected when a token lands on its position, and each coin can only be collected once. However, a token cannot move into a position already occupied by another token (T). The task is to determine the maximum number of coins that can be collected under these rules.
Example
Input
C....C..TC