Maximize Exam Confusion

You are given a string answerKey representing a student's answer choices on an exam, consisting of 'T' (true) and 'F' (false). You can flip at most k answers. Flip means changing 'T' to 'F' or 'F' to 'T'.

Find the maximum length of a contiguous substring containing all the same character ('T' or 'F') you can obtain after flipping at most k answers.

Examples
Input: ["TTFF",2]
Output: 4
Hints

Maximize Exam Confusion

You are given a string `answerKey` representing a student's answer choices on an exam, consisting of 'T' (true) and 'F' (false). You can flip at most `k` answers. Flip means changing 'T' to 'F' or 'F' to 'T'.