4 kyu
SPF Russia
153mattchilders
Loading description...
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Good Kata for graph theory training!
Another kata on dynamic programming to practice and to exercise with, well done.
Cool kata, but not enough performance tests.
Is Dmitry professional sitter on bottle?
I think this is the best graph kata ive solved so far
I am also a graph kata connoisseur.
You might wanna check out these:
https://www.codewars.com/kata/5b98dfa088d44a8b000001c1 https://www.codewars.com/kata/60f5868c7fda34000d556f30 https://www.codewars.com/kata/576986639772456f6f00030c https://www.codewars.com/kata/5f5bef3534d5ad00232c0fa8
C# translation ready. Please review and approve.
New test framework should be used in Python.
Sample tests are broken in Python.
fixed
(Python)
Random tests other than being quite low in number, never generates topologies which have multiple optimal paths.
Other than that, the method should be
snake_case
, this can be done by without invalidating solution by usingtry....except
Nice Kata. Can you change the name of the function to be similar?
def shortest_path(topology, start, end): return 0
orshortestPath(topology, 'a', 'e')
Python version should use snake_case.
Changed it, thanks
Returning inconsistent datatypes is not a best practice. I'd like to translate to Haskell, but this way I can't do it without unreasonable trickery.
Yes, the return value should always be a list of lists, possibly of a single list. There is nothing special about
[ [single solution] ]
.To do this, all previous solutions would be invalidated.
There are still not that many solutions yet, however. (only 18) so maybe it's worth it to change it you think?
Ok, I've changed it.
i really like this akta, but i am kind od stuck. any tips?
What are stuck on? Is your code timing out?
This comment has been hidden.
If there is only one solution, you should return jist that list, not a list of lists (that part of the kata wasn't designed too well, but it's too late to change without invalidating current solutions. Maybe it's worth it to change it?)
This comment has been hidden.
print the input to the console
This comment has been hidden.
nope, read the end of the description again.
This comment has been hidden.
minor typo in sampe test (bottom left should be "c" instead of "d"
#Topology
b--d--g
/ | \
/ | \
a-----e-----h
\ \ /
\ \ /
d-----f
Fixed, thanks
Hi,
OK, done. Very interesting one, thx. But it should be stated in the description that the list of paths has to be sorted in lexicographic order.
Done
Hi,
In the example of the description and the example tests, 'e' and 'h' are linked in the scheme but not in the dictionary ;)
I don't have enough time to try your kata for now, but I sure will do.
Cheers,
B4B
Fixed