from typing import List
from typing import Dict


def build_nn_architecture(hidden_layer_structure: List[Dict],
                           input_dim: int,
                           output_dim: int,
                           output_layer_activation: str) -> List[Dict]:
    """
    example:
    nn_architecture = [
        {"input_dim": 28*28, "output_dim": 64, "activation": "relu"},
        {"input_dim": 64, "output_dim": 64, "activation": "relu"},
        {"input_dim": 64, "output_dim": 10, "activation": "softmax"},
    ]
    """
    nn_structure = []
    pre = input_dim
    for layer in hidden_layer_structure:
        nn_structure.append({
            'input_dim': pre,
            'output_dim': layer['neurons'],
            'activation': layer['activation']
        })
        pre = layer['neurons']
    nn_structure.append({
        'input_dim': pre,
        'output_dim': output_dim,
        'activation': output_layer_activation
    })
    return nn_structure