Function that finds the minimum number of flips to make the binary string alternating if left circular rotation is allowed
function MinimumFlips ( s , n ) { let a = Array . from ( { length : n + 1 } , ( _ , i ) => 0 ) ; for ( let i = 0 ; i < n ; i ++ ) { a [ i ] = ( s [ i ] == ' ' ? 1 : 0 ) ; }