Walmart Global Tech interview question

How do I code the most duplicated substring in a given string?