input: Write a function to perform linear regression on a dataset to predict the numbers based on given input values. If the input dataset is empty, return an error message.
  assert linear_regression([1,2,3,4,5], [3,5,7,9,13])==[15.]
  assert linear_regression([1,2,3], [4,6,8])==[10.]
  assert linear_regression([1], [2])==[2.]
  assert linear_regression([], [])==None
  assert linear_regression([1,2,3,4,5], [])==None
output: def linear_regression(x, y):
      if not x or not y:
          return None
      n = len(x)
      sum_x = sum(x)
      sum_y = sum(y)
      sum_xy = sum(xi * yi for xi, yi in zip(x, y))
      sum_x2 = sum(xi ** 2 for xi in x)
      slope = (n * sum_xy - sum_x * sum_y) / (n * sum_x2 - sum_x ** 2)
      intercept = (sum_y - slope * sum_x) / n
      return [slope * x[-1] + intercept]