Function that return true if sub is a sub - sequence in s
static boolean checkSub ( String sub , String s ) { int j = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) if ( sub . charAt ( j ) == s . charAt ( i ) ) j ++ ; return j == sub . length ( ) ; }