countP [ ] : Store count of all characters of pattern countTW [ ] : Store count of current window of text
char countP [ ] = new char [ ALL_CHARS ] ; char countTW [ ] = new char [ ALL_CHARS ] ; for ( i = 0 ; i < M ; i ++ ) { ( countP [ pat . charAt ( i ) ] ) ++ ; ( countTW [ txt . charAt ( i ) ] ) ++ ; }