← 返回 google 的题目列表Collect Maximum C's
类型:online_judge
Given a string formed by the characters 'T' and 'C'. You can move 'T' three positions to the right, but cannot move through other 'T's. You can collect the 'C's you encounter. Calculate the maximum number of 'C's that can be collected.
Input:
A string containing only 'T' and 'C'.
Output:
An integer representing the number of 'C's collected.
Example:
Input: 'TCTCTC' Output: 2
Example
Input
TCTCTC