input: from typing import List
  
  def construct_mnist_model(layers: List[int]) -> keras.Model:
      """ Construct a neural network model in Keras to classify the MNIST data set correctly.
      The input layer will have 784 units, and the output layer will have 10 units with softmax activation.
      The hidden layers will be added based on the provided list of units, each using ReLU activation.
      The model is compiled with the Adam optimizer, sparse categorical crossentropy loss, and accuracy metric.
      >>> model = construct_mnist_model([128])
      >>> model.compile_options['optimizer'] == 'adam'
      True
      >>> model.compile_options['loss'] == 'sparse_categorical_crossentropy'
      True
      >>> model.compile_options['metrics'] == ['accuracy']
      True
      """
      
      # Input layer
      input_layer = keras.layers.Input(shape=(784,))
      
      # Hidden layers
      hidden_layer = input_layer
      for units in layers:
          hidden_layer = keras.layers.Dense(units, activation='relu')(hidden_layer)
      
      # Output layer
      output_layer = keras.layers.Dense(10, activation='softmax')(hidden_layer)
      
      # Model
      model = keras.Model(inputs=input_layer, outputs=output_layer)
      
      # Compile model
      model.compile(optimizer='adam', 
                    loss='sparse_categorical_crossentropy',
                    metrics=['accuracy'])
      
      return model
output:     
      # Input layer
      input_layer = keras.layers.Input(shape=(784,))
      
      # Hidden layers
      hidden_layer = input_layer
      for units in layers:
          hidden_layer = keras.layers.Dense(units, activation='relu')(hidden_layer)
      
      # Output layer
      output_layer = keras.layers.Dense(10, activation='softmax')(hidden_layer)
      
      # Model
      model = keras.Model(inputs=input_layer, outputs=output_layer)
      
      # Compile model
      model.compile(optimizer='adam', 
                    loss='sparse_categorical_crossentropy',
                    metrics=['accuracy'])
      
      return model
  