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.
Fixed.
This task has a solution that works for a constant time and it's realy simple. I'm surprised that not many people got it.
For me, it was because I was checking for empty code before the flush. Flush should be executed 'before execution', so it has to be the first thing that happens.
Great Thanks!
I posted to it's own thread in here, but rollback(2) should truncate the history beyond the rollback point. This means that by the time rollback(3) comes around, the history looks something like:
move #1
move #2
move #3
move #4
move #6
and you would rollback 3 to move #3
For anyone else that was getting stuck on the random tests, it's not tested or mentioned anywhere prior to them, but rollBack is supposed to truncate the history past the point you're rolling back to. Makes sense in hindsight :P
Worse than that, the description seems a bit lacking in this regard. Take the sample case. I went through trying to figure out the best approach to the problem, but solving the sample test on pen and paper and then in ruby, the expected answer doesn't include any distance having to do with A5, the friend in the list that doesn't have a town listed. The total is just the far sides of the triangles summed, plus the distance to the first and last town. So are we visiting every friend in the friends list, or are we only visiting towns we know the distance for, or...?
I can pass the sample tests without issue, but whenever I try to submit a solution for F#, the following error appears:
/home/codewarrior/program.fsx(25,28): error FS0039: The value, constructor, namespace or type 'Join' is not defined.
I think there may be an issue with the tests
There seems to be an issue with the standard ruby tests. [1,[1,1]] not same as [[2,2],2] is present in both the sample tests and the standard ones. I pass the sample test, but the standard one fails, on the same inputs.
There seems to be an issue with the python implementation trying to set up the validation:
File "/home/codewarrior/setup.py", line 42, in hasBulbInBetween
dx,dy = (i>x)-(i<x), (j>y)-(j<y)
TypeError: numpy boolean subtract, the
-
operator, is deprecated, use the bitwise_xor, the^
operator, or the logical_xor function instead.I realize that there's a section in the predefined tests that specifies taht this is supposed to raise an error, but whenever it's encountered in a random test, it fails with the error I've raised and stops the testing. There seems to be a problem at least with the python random tests when rollback exceeds the move history.
So, what are we supposed to do when the argument provided to rollback is greater than the length of the move history? With other illegal values, the tests would have us throw an error, but throwing an error on this is just ending the tests. Is this supposed to happen? Am I missing something?
Thanks for bringing this up. Added the following detail to the Description:
WORK
listed as their purpose on their access permitAlso made an update to specify which documents pertain to what types of entrants (ie. native, foreigner, or both).
There isn't really any information or description of what constitutes a Worker. For required documents, Foreigners are self explanitory (not Arstotzka), so are citizens of (designated) and entrants (everybody), but I can't figure out who requires a work pass. Any chance on getting some clarification?
Rolling back len-n+1 should be correct. I'm guessing that there are some subtleties in your solution that are missing in order to solve the more complex random problems (Some strange combination of resets/passes/rollbacks/moves is breaking your code and is not tested for explicitly in basic tests). It's hard to say what could be throwing your code off. It would be very strange if you could pass all the random tests and not any of the basic ones.
Loading more items...