Question d’entretien chez DXC Technology

Q: Given an array of strings, return the common beginning substring.

Réponse à la question d'entretien

Utilisateur anonyme

10 oct. 2022

I sorted the array and took the first element as the answer. Then I looped from second to last element and for each element I compared the answer string with current string to find the common beginning substring.