Ad
  • Custom User Avatar

    There is no "unretirement". You can create another kata with the problems fixed and give it a try.

  • Default User Avatar

    If you mean the uppercase "Just" in sample tests, it's already fixed! 🙂 I'm not sure it'll help me "unretire" it, though 😔

  • Custom User Avatar

    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.

  • Custom User Avatar

    It's the first line in the interpret method. variables = new HashMap<>();

    What you're not saying is that you put a STATIC in front of it. And that's where your global state is. That hashmap is common to every single call done to your method (common as in "created once only, used by each call in its current state").

  • Custom User Avatar

    Yes. It's the first line in the interpret method. variables = new HashMap<>();

  • Custom User Avatar

    Here having the same issue. Where did you put "new HashMap<>()"?, in the beggining of the interpret method?

  • Custom User Avatar

    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.

  • Custom User Avatar

    Whatever this kata improves, it was much mor fun to solve it, than boring "code all day to get an one digit answer" katas.
    I really glad that this kata exists, it's just fresh air and why I prefer Codewars to Leetcode and other.

  • Custom User Avatar

    Eventually I found a solution.
    int n = array.length;
    if (n == 0 || array[0].length == 0) return new int[]{};

  • Custom User Avatar

    same problem, that's the only test that I couldn't pass

  • Default User Avatar

    An integer array of length "0" should work. It is probably best practice to creat an appropriately sized integer array to begin with, rather than returning the integer array upon receiving an empty input array.

  • Custom User Avatar

    It sounds more like a problem with your solution which seems to mutate some state in a way the function does not work correctly when invoked again.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    description is quite vague, so not every case is obvious
    for example, is it possible that a dash may be the same length as triple space? is situation when only dashes(3) and longspaces(7) are included? the proportion is quite close. Is it given that theres such float number unit, so every sequence up to 2unit is 1 unit long, up to 5unit - 3 units long, others are 7 units long?

  • Loading more items...