from typing import List


def build_graph(order: int, edges: List[List[int]]) -> List[List[int]]:
    """Builds an adjacency list from the edges of an undirected graph."""
    adj = [[] for _ in range(order)]

    for u, v in edges:
        adj[u].append(v)
        adj[v].append(u)

    return adj