Add longestCommonPrefix and longestCommonSuffix