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.
yes, absolutely true! Although I explained this point in a comment before. But then I didn’t know how to use formatting, and it was very difficult to understand the code that I wrote in the comment.
It's a pursuit of brevity.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Yes, thanks, really very stupid mistake.))))
The number finds itself, as in a mirror
You also have O(n), if you want to find solutions with the best result, then there are other sites for this, where this is emphasized. Or you can post 2 solutions. One is short, the other is optimal.
For all arrays of type [0,0,0,1] you have the same result.
I don't think you'll get extra points for fast execution here.
Agree with you! But I did not redo it, just one of the solutions. Monument to curvature. Now I would write it differently
by js guru - OverZealous
This comment is hidden because it contains spoiler information about the solution
I would put "Clever" but too short solution in comparison with other similar ones, just 2 pages))
Ok, I guess I can't understand the task. As I understand it, the results should be as follows:
[SOUTH, EAST, SOUTH, SOUTH, EAST, NORTH, EAST, NORTH]=>[EAST,SOUTH,EAST,EAST].
[NORTH, EAST, SOUTH, NORTH, SOUTH, SOUTH, SOUTH, NORTH, EAST, NORTH, NORTH, EAST, SOUTH, EAST, SOUTH]=>[EAST,EAST,EAST,EAST,SOUTH]
[EAST, NORTH, EAST, SOUTH, NORTH, NORTH, SOUTH, EAST, SOUTH, SOUTH]=>[EAST,EAST,EAST,SOUTH]
I missed "Write a function dirReduc which will take an array of strings and returns an array of strings with the needless directions removed (W<->E or S<->N side by side)."
Sorry, "side by side" by google translator like: "Near", "in the same array".
If there was such an example, I would understand the error right away
C# tests are wrong:
test(7):
input=[SOUTH, EAST, SOUTH, SOUTH, EAST, NORTH, EAST, NORTH]
Test Failed
Expected is <System.String[8]>, actual is <System.String[4]>.
But 4 is right!
test(10):
input=[NORTH, EAST, SOUTH, NORTH, SOUTH, SOUTH, SOUTH, NORTH, EAST, NORTH, NORTH, EAST, SOUTH, EAST, SOUTH]
Test Failed
Expected is <System.String[11]>, actual is <System.String[5]>.
test(8):
input=[EAST, NORTH, EAST, SOUTH, NORTH, NORTH, SOUTH, EAST, SOUTH, SOUTH]
Expected is <System.String[6]>, actual is <System.String[4]>
This comment is hidden because it contains spoiler information about the solution
For C #, the conditions are different. Needed for (t * 2> 9) -> (t minus 9), not return 9. Therefore, tests fail
by formula <ms, brut force 1ms
Loading more items...