Changing value of neighbors to weights
Passing all tests for addEdge