Back to problems

Collect Coins on 1D Board

Algorithm · Google · Medium

Requirements Input consists of one string containing only ., T, and C, with at most 100 characters. On each move, choose one T and shift it exactly three cells to its right. Tokens may travel rightward only; leftward moves are not permitted. The same token may be moved repeatedly. A C is picked up only if a token finishes its move on that cell; jumping across a coin does not pick it up. Once taken, a coin cannot be taken again. Moving a token onto a cell containing another…

Checking your access…