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.
Everytime I come here, I am abused.
i beleave one of the tests has a mistake in C version, my numbers are 4096000 and the results are 409600 every other test passes except for this one, does anyone know if the problem is my code or if there is a mistake of some kind
Not an issue, use
System.out.println
. Also, you probably should read the section of the docs about training on kata.Cheers
Java17, 2 start test complete, other 3 NULLPOINTEREXCEPTION, what te hell??? Let me even see what commands do you enter in this class
1-st 2 kyu kata in my life! Thanks for this xp, that was awesome. :)
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
No, by entire array I meant that if the array has length n, his code runs through 2n elements on average.
I presume you took the time results provided by the test cases which deviate in general, that way the claim can be made either way. If you just run both versions in a properly timed environment you get mine to be about 3x faster, regardless of whether they lists are fully randomized or worst case samples.
He traverses the entire array at most one time.
This solution is faster than your solution: random tests in 390ms vs 450ms.
Is it normal for the C++ "Complex 1" test to be so long? It seems to make nested loops with so many iterations that my program ends up in a timeout. The program is {"mov a 1", "mov b 1", "mov c 0", "mov d 26", "jnz c 2", "jnz 1 5", "mov c 7", "inc d", "dec c", "jnz c -2", "mov c a", "inc a", "dec b", "jnz b -2", "mov b c", "dec d", "jnz d -6", "mov c 18", "mov d 11", "inc a", "dec d", "jnz d -2", "dec c", "jnz c -5" }.
When I test it with a lower value of d for the 4th instruction, the program manages to finish before timing out. For example, with mov d 13, I get [ ("c", 0), ("b", 377), ("d", 0), ("a", 808) ] as a return.
EDIT: Nevermind, for some reason now it works... I guess the servers were a bit too busy at some point.
I've managed to implement this in JS, and seem to have the right answer for the first test, but my map is not being accepted Any suggestions why this is happening, and how I can get around it?
my return: Map(1) { 'a' => 1 }
expected Map{} to deeply equal { a: 1 }
This comment is hidden because it contains spoiler information about the solution
Loved this Kata! (Swift version)
My solution is way over engineered: I ended up creating a full Tokenizer -> Parser -> Interpreter chain. But it was great fun. And something I wanted to explore anyway. Thanks for creating this Kata!
This comment is hidden because it contains spoiler information about the solution
Loading more items...