Tavant interview question

String, Matrix, Greedy, Search and Sorting