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 like java-version. There is a little bug (with the word "just") in the test. Hopefully it will be fixed soon. Overall the kata is good.
Yes. It's the first line in the interpret method. variables = new HashMap<>();
I found a bug in my first solution.
But the the solution was accepted.
In my solution helper.pageIndex(7) returns 1 instead of -1.
Eventually I found a solution.
int n = array.length;
if (n == 0 || array[0].length == 0) return new int[]{};
Something is wrong with the test for Java.
When I start my code in IntelliJ IDEA the result is the same as expected.
But when I copy and start the code in the browser the result is like:
"mov a -10", "mov b a", "inc a", "dec b", "jnz a -2"
expected:<{a=0, b=-20}> but was:<{a=0, b=-20, c=409600, d=1}>
The variables "c" and "d" obviously came from the previous test.
The problem was resolved after I put "new HashMap<>();" inside method interpret.
It seems to me the description is obvious, but testing is vague.
1 Yes. Ideally a dash must be the same length as triple space.
2 Yes. If I'm not mistaken there was a test contained only two dashes and a longspace between them (2 letters and space: "T T").
3 Yes. You have to calculate the criteria between length of dots and dashes - how many digits 1 make a dot, and how many make a dash.
Be ready to meet other situations and tests even more vague.
testShortMessages
expected:<E[ ]E> but was:<E[]E>
What do that mean?
In this kata I made up a math formula and put it in the return.
This way timeout is impossible.
The task is not about programming code.
Actually, it is a problem of making up a math formula and putting it into return.
Such kata doesn't improve my coding skills.
Wonderful. The short code works miraculously.
What should be returned for empty array in Java ?
I've tryed return new int[]{} and return new int[0]
My brain is broken.