I have two solution for that:

- Find the longest sequence of "G"s and search both side to find enough "G" to make a k length sequence. This will not work for "BGGGBBBBGBBGGBGG" with k=4
- Find the minimum window that contains k "G"s and than calculate the min swap needed. This will not work for "BGGGGGBGGGGBBBBBBBBBGGGGGGGGBBG" with k=9

Then I failed......