[–] brux 0 points 0 points 0 points (+0|-0) 5.4 years ago
Strings are lists of characters. I.e., words or sentences. See the answer below. :)
[–] hopo 0 points 0 points 0 points (+0|-0) 5.4 years ago
I would have just used a hash set. Does not require sorting and you just have to iterate through the list once for a time complexity of O(n)
This is the answer I look for when I interview someone. Though, putting them in a list and sorting them is also an interesting (but not optimal) answer.
[–] brux ago
Strings are lists of characters. I.e., words or sentences. See the answer below. :)