question: public int search ( char [ ] text ) { int m = pattern . length ; int n = text . length ; int skip ; for ( int i = 0 ; i <= n - m ; i += skip ) { skip = 0 ; for ( int j = m - 1 ; j >= 0 ; j -- ) { if ( pattern [ j ] != text [ i + j ] ) { skip = Math . max ( 1 , j - right [ text [ i + j ] ] ) ; break ; } } if ( skip == 0 ) return i ; } return n ; }
target:  Returns the index of the first occurrrence of the pattern string in the text string.