freeCodeCamp Challenge Guide: Incidence Matrix

Incidence Matrix


Solutions

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