Sort words by length
easySorting and searching10 XP
Return the words sorted from shortest to longest. Words of the same length keep their original order.
Examples
- Input: words = ["word", "a", "the", "to"]Output: ["a", "to", "the", "word"]
- Input: words = []Output: []
Examples use JSON: true/false/null are True/False/None in Python.