We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Find the nearest clone
- Discussions
Find the nearest clone
Find the nearest clone
Sort by
recency
|
190 Discussions
|
Please Login in order to post a comment
Java 8 solution (passes all test cases):
What the **** is the need for the variable val?
val: an integer, the id of the color to match
the result would be different depending on which colour you choose to find the distance between, so it's important to have this value.
Python
javascript
Test Case 12 has no answer and is the wrong expected output. There is no edge linking the nodes with colour 2 in the graph.
find an indirect route between the two nodes, by traversing through other nodes in the graph