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.
This one was a time consuming kata.
I'm based on provided test cases in the Kotlin language.
"Is the test that you are referring to the one with input = '369' ? "
That's correct.
"Then '333' isn't valid because the last '3' in '333' is not adjacent to the '9' in '369'."
I don't get it. How so 'last 3' is not adjacent? I believe I missing some concept.
I'm confused. Why in the second case 11 is one of the valid numbers but 333 isn't a valid number on the third?
I did with kotlin. I always code my solutions on kotlin play ground. My solution uses Duration class.
Here in code wars it complains because its experimental.
I'm addressing this to the moderator of kotlin to fix this.
The error is:
error: this declaration is experimental and its usage must be marked with '@kotlin.time.ExperimentalTime' or '@OptIn(kotlin.time.ExperimentalTime::class)
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?
Let me try.
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,