Sollicitatievraag bij Walmart Global Tech

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