#3399

Smallest Substring With Identical Characters II

master · 1710 · lc hard +32 · 40.3% accepted · 44 likes · top 20%

Description

You are given a binary string s of length n and an integer numOps.

You may flip at most numOps characters in s (changing '1' to '0' or vice versa).

Minimize the length of the longest substring in which all characters are identical.

Return the minimum achievable length.

Code

1
2
3