KMP and word ladder

difficult~~