answers: 'T' means true and 'F' means false. The quiz author wants the key to contain as long a run of identical answers in a row as possible, whether T or F.
They may change at most flips answers in the key (any answer can be switched to the opposite one).
Return the length of the longest run of identical characters that can be obtained.answers="TFTTFT", flips=1 → 4
Flip the F at index 1 to get TTTTFT: four Ts in a row. Five equal answers in a row cannot be made with one change.
answers="FFTF", flips=2 → 4
One change is enough: turning the T into F gives FFFF.
answers="TFTTFT", flips=1
4
Run checks the first 3 tests in your browser. Submit checks all 135 tests on the server, hidden ones included.