Challenge: Array Sort Using Tries

This lesson is about sorting string arrays using tries.

Problem Statement #

In this problem, you have to implement the sortArray() function which will sort the elements of an array of strings.

Input #

An array of strings.

Output #

Returns the input array in a sorted state.

Sample Input #

keys = ["the", "a", "there", "answer", "any",
                     "by", "bye", "their","abc"]

Sample Output #

['a', 'abc','answer','any','by','bye','the','their','there']

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.