input: Write a function to implement the Gradient Descent Algorithm for linear regression. The function should take in an array of x values, an array of y values, a learning rate, and the number of iterations as parameters. It should return the updated values of the slope and intercept after performing gradient descent. If the input arrays are empty, the function should return (0, 0).
  
  assert gradient_descent([1, 2, 3, 4], [2, 4, 5, 4], 0.01, 100) == (0.701326576211015, 1.3082137754535823)
  assert gradient_descent([1, 3, 5], [3, 5, 7], 0.01, 100) == (1.2160548660616107, 1.5927036437207528)
  assert gradient_descent([], [], 0.01, 100) == (0, 0)
output: def gradient_descent(x, y, learning_rate, iterations):
      if len(x) == 0 or len(y) == 0:
          return (0, 0)
      
      n = len(x)
      slope = 0
      intercept = 0
      
      for _ in range(iterations):
          y_pred = slope * x + intercept
          slope_gradient = (-2/n) * sum(x * (y - y_pred))
          intercept_gradient = (-2/n) * sum(y - y_pred)
          
          slope -= learning_rate * slope_gradient
          intercept -= learning_rate * intercept_gradient
      
      return (slope, intercept)