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.
Very nice mathy kata, congratulations.
python (probably others too): one of the following should be part of the final fixed tests:
Otherwise some incomplete solution can pass.
Done by OP
Approved
Pretty challenging kata, keep it up.
A portion of
arr
in random tests should be tested instead of full array to avoid solutions like thispython new test framework is required. updated in this fork
Approved
python new test framework is required. updated in this fork
the more i understand python and enter the solution page,
the more i am amazed thinking how wonderful human brains are!!!
and become curious why people feels threatened by A.I.?!
Nice kata!
b7 -> d6 -> c8, 2 moves. Not a kata issue.
(C++ solution)
Randomized_Fixed_Tests:
b7 -> c8
Expected: equal to 2
Actual: 4
How is it possible?
@modernLifeRock - Hi; at first I thought you were making a silly mistake but your solution is really interesting so I ended up debugging on my IDE.
I think your mistake is due to you introducing another argument to the function, and it seems that the tests then keep the
data_structure_that_you_have_used
between tests. I'm not 100% sure, because the Python tests themselves are a bit out-of-date so I don't completely understand how they are being run.Long story short - try this to see if it works:
replace
cache_sq= XYZ
(where XYZ is the data structure you are using) in your function's arguments withcache_sq = None
then, inside your function as the first base case, put
if cache_sq is None: cache_sq = XYZ
where XYZ is the (empty) data structure you are usingI'm using XYZ to avoid having to spoiler my comment - otherwise you won't be able to see it until you have solved the kata.
get a similar problem with my python implementation. Did you ever figure out what the problem wa?
My (python) solution works on about 100-200 test cases but fails the rest. When I take an example failed test and put try it on my IDE, it works. Anyone know why this might be the case?
Loading more items...