input: Write a function to sort an array of strings by their length in non-decreasing order. If the given array is empty then return an empty array.
  def sort_by_length(strings):
      for i in range(len(strings) - 1):
          for j in range(i + 1, len(strings)):
              if len(strings[i]) > len(strings[j]):
                  strings[i], strings[j] = strings[j], strings[i]
      return strings
  
  unsorted_list = ["cat", "dog", "apple", "banana"]
  sorted_list = sort_by_length(unsorted_list)
  assert sorted_list == ["cat", "dog", "apple", "banana"]
  
  assert sort_by_length(["apple", "ban", "pineapple", "peach"]) == ["ban", "peach", "apple", "pineapple"]
  assert sort_by_length([]) == []
  assert sort_by_length(["a", "bb", "ccc", "dddd"]) == ["a", "bb", "ccc", "dddd"]
output: def sort_by_length(strings):
      return sorted(strings, key=len)