input: Write a function to sort an array of strings by their length in non-decreasing order. The function should take a list of strings as input and return the sorted list.
  assert sort_by_length(["cat", "dog", "apple", "banana"])==["cat", "dog", "apple", "banana"]
  assert sort_by_length(["python", "java", "c", "rust"])==["c", "java", "rust", "python"]
  assert sort_by_length([])==[]
  assert sort_by_length(["hello"])==["hello"]
  assert sort_by_length(["quick", "brown", "fox"])==["fox", "quick", "brown"]
output: def sort_by_length(strings):
      return sorted(strings, key=len)