Data Structures - Adjacency List

the test suite passes this, although after a re-read i think this is wrong

  **Your code so far**
var undirectedAdjList = {
  James: ["Jill", "Jenny", "Jeff"],
  Jill: ["James", "Jenny", "Jeff"],
  Jenny: ["Jill", "James", "Jeff"],
  Jeff: ["Jill", "James", "Jenny"]
};
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36

Challenge: Data Structures - Adjacency List

Link to the challenge:

and this would be right, i think (which also passes):

Summary

var undirectedAdjList = {
  James: ["Jeff"],
  Jill: ["Jenny"],
  Jenny: ["Jill", "Jeff"],
  Jeff: ["Jenny", "James"]
};

You can put whatever you like in the arrays as long as the main edges/relationships of the requirements are satisfied.

https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/10-coding-interview-prep/data-structures/adjacency-list.md

Not sure if I would say it is wrong (or just excessive or unnecessary) but that is how the tests are written.

nah, i think there are excessive edges, as in, non existent edges expressed. github shows its only testing positive edges, not the 0 edges.
maybe i will fork on github but not sure i could get into test suite/assertions file

You can fork the repo and make the changes directly to the .md file, but I wouldn’t suggest that. I’d suggest using Gitpod instead.

https://gitpod.io/#https://github.com/freeCodeCamp/freeCodeCamp

If you install the Gitpod extension you get a Gitpod button on the repo as well.


is that related to github?
i’ll have to have a look tomorrow

Are you asking if Gitpod is related to GitHub? If so, no (as in they are not owned by the same entity). But it is a very handy way of working with repo code.

GitHub has Codespaces but that isn’t free (as far as I know).

1 Like