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.
There's no failing testcase because your solution apparently returns a correct answer for all test cases. It just makes tests run too long, and they are force-stopped.
I am not sure what you mean by "print and flush", but it will help you if it would make your solution faster, yes. And will not help you if not :)
simple answer is your solution is not efficient enough for the more stringent tests
Read this: https://docs.codewars.com/training/troubleshooting/#no-print
In Python:
print(expression, flush=True)
Adding a path might be helpful, but you can make yourself one. If you do it, your code can timeout, either because constraints or bad implementation. However, shouldn't you be able to follow your algorithm yourself? and consequently 'see' the problem?
Your implementation of A* has a bug. The line
current = min(open_set, key=lambda x: x.f)
unnecessarily introduces additional O(n) level of complexity. For A*, its possible to find minimum node in a better way.Nevertheless it's that easy: it times out because it's too slow.
I don't know what you run on your machine, but there are 500 tests, and the size of the maze can go up to 100 * 100.
Your code is very long, I didn't analyze it in detail but it seems you're doing a lot of useless stuff. Eventually you just need to return
true
orfalse
, no need to compute any distance for example (at least it seems most submitted solutions don't care about that).Your solution times out because it's too slow.
The index is not from the range, it is from the list of all primes:
11 and 17 are in the index 5 and 7. It was already discussed below too.
If you know how to import and use a module which is not installed in Python environment used by Codewars, then go ahead.
A two pair can be beaten by a better two pair regardless of kicker.
For example if player one's hole cards are AA and player two's hole cards are KK and community cards are JJ234, then player one has
('two pair', ['A', 'J', '4'])
and player two has('two pair', ['K', 'J', '4'])
. Both have the same kicker but player one has a better hand.@FrankK If you dont like poker then why make 2 Katas on it in the first place? Your response to criticism killed my interest in this Kata.
(resolved, i guess)
honestly, i think it's fine if they can figure out how to use % with church numerals
Maybe you consider yourself smart but many people noticed and mentioned already. It is because I find poker not interesting at all. The tests though do server their purpose perfectly! Maybe your response is bogus! ;)
Loading more items...