https://practice.geeksforgeeks.org/problems/longest-prefix-suffix2527/1