Sum of all LCP of maximum length by selecting any two Strings at a time
Given a list of strings, the task is to find the sum of all LCP (Longest Common Prefix) of maximum length by selecting any two strings at a time. Examples: Input: str[] = {babab, ababb, abbab, aaaaa, babaa, babbb} Output: 6 Explanation: Choose 1st and 5th string => length of LCP = 4, Choose 2nd a