A little algo to find the largest pattern in the given string