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
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.
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 :)
This comment is hidden because it contains spoiler information about the solution
That it why I am suprised to see the result above. I have JS chosen as language, test cases are passed successfully. But once I press attempt this strange error appears.
Someone mentioned below the problems while submitting the solution - maybe the same case here.
Javascript. Nothing is printed to the console
I am getting this error: "Time: 1856ms Passed: 41391 Failed: 0 Exit Code: 137. Max Buffer Size Reached (1.5 MiB)."
I use replace method and left/right indexing, so the solution should be pretty efficient (both in time and space comlpexity).
Any ideas on cause of the error or potential improvements?
This comment is hidden because it contains spoiler information about the solution