Challenge 3: List Sort Using Tries

This lesson is about sorting “string lists” 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

This is an array of strings.

Output

It returns the input array in the form of a sorted vector.

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.