PROBLEM:
"Given an array of strings, find the string which is made up of maximum number of other strings contained in the same array."
INPUT :
[ “rat”, ”cat”, “abc”, “xyz”, “abcxyz”, “ratcatabc”, “xyzcatratabc” ]
OUTPUT:
“xyzcatratabc”
Explaination :
“abcxyz” contains 2 other strings
“ratcatabc” contains 3 other strings,
“xyzcatratabc” contains 4 other strings"
I want to know what is the best time complexity with can solve this problem and how
?
I shall be highly thankful to codeforces community!