Easy math
KMP algorithm