Function that return true if sub is a sub - sequence in s
int checkSub ( string sub , string s ) { int j = 0 ; for ( int i = 0 ; i < s . size ( ) ; i ++ ) if ( sub [ j ] == s [ i ] ) j ++ ; return j == ( int ) sub . size ( ) ; }