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. Sorry, forgot to mention
And what implementation does not work?
I have a question with regard to tests. Test case: matrix - "[[841, 890], [27, 64]]", times - 6428475085 (so basically, there is 1 counter-clockwise turn).
Got the following message: "[[890, 64], [841, 27]] should equal [[64, 27], [890, 841]]".
I do not understand, why my answer is incorrect.
P.S. JS implementation with the same code works fine.
Found the cause of the error. I have not declared res variable locally, so it got mixed with the test cases.
This comment is hidden because it contains spoiler information about the solution
There is an issue with JS tests:
In sample tests it requires an array as an output: Expected: ['(A : 0)', '(B : 114)', '(C : 70)', '(W : 0)'], instead got: '(A : 0) - (B : 114) - (C : 70) - (W : 0)'
Whilst in tests during attempt it requires string (as stated in the kata's description): Test Passed: Value == '(A : 0) - (B : 114) - (C : 70) - (W : 0)'
Elimination of circles (not just concecutive north/south or east/west movements) is exactly the purpose of this kata.
From other examples section in Kata's description: "In ["NORTH", "EAST", "WEST", "SOUTH", "WEST", "WEST"], "NORTH" and "SOUTH" are not directly opposite but they become directly opposite after the reduction of "EAST" and "WEST" so the whole path is reducible to ["WEST", "WEST"].
This comment is hidden because it contains spoiler information about the solution
Thx guys, now it works! I guess that focus on Python made me too loose on declaring let/const inside the function. Will keep it in mind :)
The kata is completable by avoiding the globals, but please fix when you can. I need to go to sleep.
yup, that was it... x) the loop missed its
let
declaration... Correctedfucking JS... XD
I'll edit the kata, lemme some time if you're not already on it.
@smokedsalmon You have many variables in global scope,
i
for example. And the test also usesi
and it's global. That should be the reason for the crazy number of tests.8o
wow... reproducible bug... Crazy. I'll try to see if I can get the reason for it. I'll keep you posted.
This comment is hidden because it contains spoiler information about the solution
Loading more items...