a teacher write test n truefalse question t denote true F denote false he want confuse student maximize number consecutive question answer multiple true multiple false rowyou give string answerkey answerKeyi original answer ith question in addition give integer k maximum number time perform follow operationchange answer key question t F ie set answerKeyi T FReturn maximum number consecutive Ts Fs answer key perform operation k time Example 1input answerkey ttff k 2output 4explanation we replace Fs Ts answerkey TTTTThere consecutive TsExample 2input answerkey TFFT k 1Output 3explanation we replace T F answerkey FFFTAlternatively replace second t F answerkey TFFFIn case consecutive FsExample 3input answerkey ttfttftt k 1output 5explanation we replace F answerKey tttttfttalternatively replace second F answerkey TTFTTTTT in case consecutive Ts Constraintsn answerkeylength1 n 5 104answerkeyi T f1 k n