Given an undirected graph with n nodes labeled 0..n-1 and a list of edges, build its n x n adjacency matrix where entry [i][j] is 1 if an edge connects i and j, else 0. Return the matrix as a nested array. The input is JSON {n, edges}.
Input: JSON {n, edges}.
Output: Nested array — the n x n adjacency matrix.
Input: {"n":3,"edges":[[0,1],[0,2]]}
Output: [[0,1,1],[1,0,0],[1,0,0]]
Explanation: Symmetric matrix for undirected edges.Input: {"n":1,"edges":[]}
Output: [[0]]
Explanation: Single node, no edges.Input: {"n":2,"edges":[[0,1]]}
Output: [[0,1],[1,0]]
Explanation: One undirected edge.1<=n<=1000undirected