input: Write a function to sort a list of strings by their length in non-decreasing order. If the input list is empty, return an empty list. The function should use bubble sort to achieve the sorting.
  
  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([])==[]
output: def sort_by_length(lst):
      n = len(lst)
      if n == 0:
          return []
      for i in range(n):
          for j in range(0, n-i-1):
              if len(lst[j]) > len(lst[j+1]):
                  lst[j], lst[j+1] = lst[j+1], lst[j]
      return lst