Number of ways to obtain max length of consecutive ones
Anonymous User
354

Given a string consisting of only 0 & 1. You can replace at most k 0's in the string with 1. Find no of ways to obtain max length of consecutive 1's in the string.
input: length=8, k=2
"01010010"
output: 3

Comments (1)