input: Write a function to sort an array of strings by their length in increasing order. The function should modify the input list in place and return it. If the input list is empty, the function should return an empty list.
  assert sort_by_length(["cat", "dog", "apple", "banana"])==["cat", "dog", "apple", "banana"]
  assert sort_by_length(["python", "java", "c", "ruby"])==["c", "java", "ruby", "python"]
  assert sort_by_length(["script", "apple", "almond", "ban"])==["ban", "apple", "almond", "script"]
  assert sort_by_length(["javascript", "html", "css", "mysql"])==["css", "html", "mysql", "javascript"]
  assert sort_by_length([])==[]
output: def sort_by_length(arr):
      arr.sort(key=len)
      return arr