Given an array of n 1s, and an integer k, how do I find the minimum number of turns it takes for me to turn the 1s to 0s, if at each turn I can select the ith integer in the array and conver all k elements to the left and right of it to 0, while also making it a 0.
Can you show an example? Your title says "flip" but your description doesn't talk about flipping at all. I assume by "conver[t] all k elements to the left and right of it to 0", you mean flip them either from 0 to 1 or 1 to 0?
n = 5
k = 2
[ 1 1 1 1 1 ]
choose i = 2
[ 0 0 0 0 0 ]
stop borrowing trouble Ganado! The answer is clearly 1 turn, I like easy problems :) Choose any location set it to zero, set left to zero, set right to zero, look, all zeros!