#3398

Smallest Substring With Identical Characters I

international master · 2195 · lc hard +32 · 20.4% accepted · 96 likes · top 2%

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, each flip costs one operation).

Minimize the length of the longest uniform substring (all characters identical) after the flips.

Return this minimum length.

Code

1
2
3