Any hint about the approach please.
1 Count - Dp Challenges
post the question link
Let say array is 1 0 0 1 0 1 1 0 0 1 0 1 …no of flips allowed=3.
So for first flip.
Flip starting 3 bits
array become : 1 1 1 1 1 1 1 0 0 1 0 1->7 // MAximum contigous 1
Flip next 3 bits
array become : 1 0 1 1 1 1 1 1 0 1 0 1->6
Flipk next 3 bits
array become -> 1 0 0 1 1 1 1 1 1 1 0 1 -> 7
Flip next 3 bits ->1 0 0 1 0 1 1 1 1 1 1 1 -> 7
Maximum ans=7
Use 2 pointer approach to solve it in O(n)
Hit like if u get it