input: Write a python function to preprocess MNIST dataset for a neural network.
  assert preprocess_mnist()[0].shape == (60000, 784)
  assert preprocess_mnist()[1].shape == (60000, 10)
  assert preprocess_mnist()[2].shape == (10000, 784)
  assert preprocess_mnist()[3].shape == (10000, 10)
output: def preprocess_mnist():
      import tensorflow as tf
      from tensorflow.keras.datasets import mnist
      from tensorflow.keras.utils import to_categorical
      
      # Load the MNIST dataset
      (x_train, y_train), (x_test, y_test) = mnist.load_data()
      
      # Preprocess the data
      x_train = x_train.reshape(60000, 784).astype('float32') / 255
      x_test = x_test.reshape(10000, 784).astype('float32') / 255
      
      # One-hot encode the labels
      y_train = to_categorical(y_train, 10)
      y_test = to_categorical(y_test, 10)
      
      return x_train, y_train, x_test, y_test