Approach hintTry it first, then revealHide
Append the string to itself to remove the wrap-around, then sweep from right to left remembering the nearest green. The answer is the largest such distance over all positions showing the current colour.
Append the string to itself to remove the wrap-around, then sweep from right to left remembering the nearest green. The answer is the largest such distance over all positions showing the current colour.