Boyer-Moore algorithm implementation