input: Write a function to sort a list of strings by their length in ascending order. The function should take a list of strings as input and return a new list with the strings sorted by their length. If the list is empty or contains only one string, it should return the original list as it is already considered sorted.
  
  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
  
  assert sort_by_length(["cat", "dog", "apple", "banana"]) == ["cat", "dog", "apple", "banana"]
  assert sort_by_length(["banana", "apple", "dog", "cat"]) == ["cat", "dog", "apple", "banana"]
  assert sort_by_length(["a", "bb", "ccc", "dddd"]) == ["a", "bb", "ccc", "dddd"]
  assert sort_by_length([]) == []
  assert sort_by_length(["single"]) == ["single"]
output: def sort_by_length(strings):
      if len(strings) <= 1:
          return strings
      return sorted(strings, key=len)