If " geek " and " keeg " are both present in s without over - lapping and " keeg " starts after " geek " ends
if ( ( s . indexOf ( " " ) != - 1 ) && ( s . indexOf ( " " , s . indexOf ( " " ) + 4 ) != - 1 ) ) return true ; return false ; }