Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Python new test framework should be used (Refer this for more detail)
Unpublishing, as duplicate of numerous spanning tree kata (ex: https://www.codewars.com/kata/5ae8e14c1839f14b2c00007a, https://www.codewars.com/kata/64a815e3e96dec077e305750, ...)
(Also, not using the decorator syntax to write the tests)
Re-raising the issue:
Needs edge case with no tunnels and 0/1 locations (aka empty/singleton graph).
The description do not establish any relations between
locations
andtunnels
(not even thatlocations
would be the complete set of locations), which transforms the kata into something else (minimal cost connection between a subset of the graph).Since the graph is guaranteed to be complete,
tunnels
already contain information aboutlocations
anyway, which makes the latter redundant.Description says "a walk that crosses all of the bridges once and only once"
Tests check "a walk that crosses all of the bridges once and only once and visits all land masses"
Sometimes some of the random test cases claim to have neither a circuit or path, but in reality do actually have a path (at least that's how testing the particular graph on paper turned out for me). I tried to find a pattern, but I couldn't. It might very well be my code that's bugged here and I could totally have messed up when figuring out the graph on paper, but maybe you should have another look on the randomized tests.
Test.assert_equals(zombieGone([[1,5],[14,2],[25,6],[6,8],[5,22]]), 53)
How is it not 69?
https://www.wolframalpha.com/input/?i=polygon+%5B%5B1%2C5%5D%2C%5B14%2C2%5D%2C%5B25%2C6%5D%2C%5B6%2C8%5D%2C%5B5%2C22%5D%5D
https://www.wolframalpha.com/input/?i=perimeter+%5B%5B1%2C+5%5D%2C+%5B14%2C+2%5D%2C+%5B25%2C+6%5D%2C+%5B5%2C+22%5D%5D
Random test expect
None
sometimes.Very similar katas:
https://www.codewars.com/kata/59c1d64b9f0cbcf5740001ab
https://www.codewars.com/kata/5657d8bdafec0a27c800000f
Needs random tests.