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.
C# tests seem to be timing out on correct answer. Adding " " to output fails with only that as the error, but leaving it out times out every time.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
The description contains incomplete information about the task; very important information is missing:
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.
This comment is hidden because it contains spoiler information about the solution
Could it be updated to a more recent Node version?
I have finished this on my machine, but I am unable to pass the tests because a bunch of functions and language features are missing.
Things such as:
/(?<number>\d+)/
)Nevertheless, it was fun to complete!
Kotlin version:
My solution passed all the tests but the "Complex2" one: it throws a NoSuchElementException for ListIterator.previous and ListIterator.next. Moreover, for some of the tests, additional functions (so the "interpret" one is excluded) are not visible.
C:
(char *)-1
) is nonsensical, very bad practice and undocumented;(char *)-1
and the actual value is not;Language C:
Looking for some hints for the actual test cases. I'm able to pass all example cases and one of the random ones. However, I keep getting stuck with a SEGFAULT Invalid Memory Access. Obviously I cannot print out the test case during a SEGFAULT, but I'm trying to think of edge cases where my program could SEFAULT. I can't think of weird inputs that would cause an invalid memory access. Are there any "gotcha's" in the submission cases that I'm missing?
My solution uses kotlin.
For the test part it works. But on attempt, always fails on random and complex.
An example of the random test results:
expected:<{w=17, q=-29, a=5, d=-6, z=-7, f=6, l=71, n=75, o=0, r=0, c=-47, u=0, e=-7, x=0, k=33, t=71, b=0, s=0, h=8, j=17, y=2, i=-2, v=-6, g=9, p=6, m=100}> but was:<{w=17, q=-29, a=5, d=-6, z=-7, f=7, l=71, n=75, o=0, r=0, c=-47, u=0, e=-7, x=0, k=33, t=71, b=0, s=0, h=8, j=17, y=2, i=-2, v=-6, g=12, p=6, m=100}>
I can't understand. Is there a way to get random and complex instruction to evaluate?
I really don`t understand the explanation. it says:
"inc x - increases the content of the register x by one
dec x - decreases the content of the register x by one
jnz x y - jumps to an instruction y steps away (positive means"
["mov a 5"; "inc a"; "dec a"; "dec a"; "jnz a -1"; "inc a"]
visualized:
The explanation says (I put results inside parenthesis based on the instructions):
The above code will:
So, the function should return: Map("a"->1)
Why map will be 1 instead of 4?
In my understanding its impossible,
I think the kata description should've mentioned that labels/coroutines themselves can be "run over" and the program should just ignore them. I've spent a lot of unnecessary time trying to wrap my head around that recursive power function due to this (@Blind4Basics and @AnitaK comments helped a lot, but all necessary information should be available in the kata description or tests).
Also, even though it's not tested, I think the kata's description should mention that indentation has no particular meaning, since that implies labels/coroutines can be nested.
This comment is hidden because it contains spoiler information about the solution
Elixir translation revised.
Loading more items...