function inflateMatrix (arr, N) {
    // add columns
    for (let i = 0; i < arr.length; i++) {
      arr[i].push(...Array(N - arr[i].length).fill(0))
    }

    // add rows
    for (let i = arr.length; i < N; i++) {
      arr.push(Array(N).fill(0))
      arr[i][i] = 1
    }

    return arr
  }
Enlarge the matrix from nxn to NxN, setting the new
elements to 1 on diagonal and 0 elsewhere