Back to the 100
Problem 058Sliding Window
Medium

Maximize the Confusion of An Exam

058

Given an answer key of T/F characters, return the longest run of equal answers after changing at most k characters.

EXAMPLES

Example 1
Input
{
  "answerKey": "TTFF",
  "k": 2
}

Output
4

FUNCTION SHAPE

answerKey: stringk: intint
00:00
3 local tests readyRun with ⌘/Ctrl + Enter. Your code stays in this browser.

Runs solve(...) locally in a browser worker. SWE Playbook does not submit your code. Only run code you trust; Python code may access the network.