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.
i have run the simulation step-by-step for this test case and the expected answer is correct. the final state is (with head at
H
, going leftwards and hence colliding):I think your code must get lost in some infinite loop cause I don't think you may exceed the maximum recursion limit with a reasonnable code here. Hard to help you without more elements
@squishy oranges, what do you mean do the summation directly? A double for loop doesnt work for me either. I've tried condensing one of them using sum() and the for loop as a one liner but it still times out.
I'm having trouble with this one. I'm just using the standard dot product algorithm and I always exceed the time limit. When I use recursion, I exceed the max recursion rate and I can't import sys to increase it. I don't understand how to make this faster.
The recently included test case that verifies food is only consumed once is causing a contradiction with other test cases.
Some tests assume food remains in the field after being eaten so this Kata is no longer solvable.
Example:
moves = '7 D 7 R 3 U 1 L 7 U 6 L 1 U 5 L 6 D 3 L 8 U 6 L 2 U 3 R 1 D 5 R 5 D 4 R 4 U 7 R 2 D 4 R 7 U 8 R 4 D'
The test says ((0, 4), 33) should equal ((6, 10), 21) but this could only be true if the snake ate the same food twice and was long enough to collide with itself.
I've found a few other scenarios like this.
"Brilliant?" Are you UK-based too?
Anyway, thanks :)
brilliant