Function that returns true if s contains three consecutive 1 's
function check ( s ) { let n = s . length ; for ( let i = 2 ; i < n ; i ++ ) { if ( s [ i ] == ' ' && s [ i - 1 ] == ' ' && s [ i - 2 ] == ' ' ) return true ; } return false ; }