Knuthmorrispratt Algorithm Example Math