freeCodeCamp Challenge Guide: Adjacency Matrix

Adjacency Matrix


Solutions

Solution 1 (Click to Show/Hide)
const adjMatUndirected = [
  // 1 2 3 4 5
  [0, 0, 1, 1, 0], // 1
  [0, 0, 0, 0, 0], // 2
  [1, 0, 0, 0, 1], // 3
  [1, 0, 0, 0, 1], // 4
  [0, 0, 1, 1, 0]  // 5
];
1 Like