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.
thank you!
This kata inspired me to make Mate with King & Queen
In python I wrote up a solution however very occasionally it would fail some random tests for example:
a = 40 b = 47 c = 4 -1.18 should equal -1.17
I think there is something wrong in the reference solution when testing the random cases because
-47/40 = -1.175 and if you round this to 2dp it will be -1.18
Personally I think this is more difficult than kyu 6, but a fun problem nonetheless :)
This comment is hidden because it contains spoiler information about the solution
Are the tests for Python confirmed to be correct now? I wrote a fairly compact solution that used some techniques to simplify the algorithm giving me a lot of confidence in it, and I got all the tests correct except for one of the edge cases. I tested my program on every stalemate and checkmate position in the Wikipedia article, and got them all correct. I investigated my algorithm carefully and included some tests that wouldn't come up in a real game, such as a starting position with both kings in check from the other king and my program behaves what I think is correctly in those cases. I still don't get that one edge case.
feels like a 5 kyu because you need to track and manage a lot of state
I have same problem.
"Checkmate (often shortened to mate) is any game position in chess and other chess-like games in which a player's king is in check (threatened with capture) and there is no possible escape."
Where's the catch?
nice kata :)
but you definitely shouldn't...
Why? you can use BFS to search in matrix minimum path
Thank you for the solution, I will try it. Ah yes, I forgot to provide the spoiler flag.
The solution handled the distance incorrectly.
For example
CT position: [0, 1], Bomb position: [4, 2], Kit position: [0, 0]
Distance of CT to Bomb should be
4
. However, your solution gives1
. Same for Kit to Bomb.Also, next time, put spoiler flag in your post when sending your code so that people who haven't solved it cannot see your solution.
This comment is hidden because it contains spoiler information about the solution
fixed here
Loading more items...