---
id: 69c918841987bf16c1d1babc
title: Step 5
challengeType: 1
dashedName: step-5
---

# --description--

You need to store the number of nodes in the graph.

Inside the `shortestPath` function, create a variable named `n` and assign it `matrix.length`.

# --hints--

You should create a variable `n` inside the `shortestPath` function.

```js
assert.match(
  __helpers.removeJSComments(shortestPath.toString()),
  /(const|let|var)\s+n\s*=/
);
```

Your `n` variable should have the value `matrix.length`.

```js
assert.match(
  __helpers.removeJSComments(shortestPath.toString()),
  /(const|let|var)\s+n\s*=\s*matrix\.length/
);
```

# --seed--

## --seed-contents--

```js
const INF = Infinity;
const adjMatrix = [
  [0, 5, 3, INF, 11, INF],
  [5, 0, 1, INF, INF, 2],
  [3, 1, 0, 1, 5, INF],
  [INF, INF, 1, 0, 9, 3],
  [11, INF, 5, 9, 0, INF],
  [INF, 2, INF, 3, INF, 0],
];

--fcc-editable-region--
function shortestPath(matrix, startNode, targetNode = null) {

}
--fcc-editable-region--
```
