Problem involving the Boyer Moore algorithm
I did a substring search in a string using a variation of the Boyer-Moore algorithm. I have a search for a bad character with gain, i.e. I store all the positions in the parser for each character. I do this for the subsequent shift in comparison. I also have a search for a good suffix through the Z-function and then calculate the positions where the repeated substring ends in my string. And in the end, I just find the maximum step by comparing the obtained 2 values and 1 (for safety). But my cat doesn’t work somewhere, but I can’t figure out where, please tell me.