you give 0indexed string block length n blocksi W B represent color ith block the character W B denote color white black respectivelyYou give integer k desire number consecutive black blocksIn operation recolor white block black blockReturn minimum number operation need occurrence k consecutive black block Example 1input block WBBWWBBWBW k 7Output 3explanationone way achieve 7 consecutive black block recolor 0th 3rd 4th blocksso block BBBBBBBWBW it show way achieve 7 consecutive black block 3 operationstherefore return 3example 2input block WBWBBBW k 2output 0explanationno change need 2 consecutive black block existtherefore return 0 Constraintsn blockslength1 n 100blocksi W B1 k n