input: Write a function to replace each string in a list with its length.
  assert replace_by_length(["hello", "world", "coding"]) == [5, 5, 6]
  assert replace_by_length(["a", "ab", "abc"]) == [1, 2, 3]
  assert replace_by_length(["python", "java", "c"]) == [6, 4, 1]
output: def replace_by_length(lst):
      return [len(s) for s in lst]