Ad
  • Custom User Avatar

    Got it, and solved. Thanks a lot!

  • Custom User Avatar
    Examples of k-primes:
    k = 2 -> 4, 6, 9, 10, 14, 15, 21, 22, …
    k = 3 -> 8, 12, 18, 20, 27, 28, 30, …
    k = 5 -> 32, 48, 72, 80, 108, 112, …
    

    I don't get what a k-prime is, honestly. If it is 1-inclusive, isn't 6 a 3-prime, and isn't 8 a 2-prime? If it is not 1-inclusive, aren't both 4 and 8 1-primes?
    4: prime factors -> (1,) 2
    6: prime factors -> (1,) 2, 3
    8: prime factors -> (1,) 2

    What does counted with multiplicity mean?

  • Custom User Avatar

    Did you finally debug it? Because I have the exact same issue with Python.
    I pass all sample tests, though.

    HIT! 5
    HIT! 15
    HIT! 2
    HIT! 10
    HIT! 4
    

    The above is my result.

    Alien [17] with [3] health
    Alien [19] with [15] health
    Alien [21] with [2] health
    Alien [23] with [10] health
    Alien [24] with [4] health
    : 36 should equal 34
    

    This is the reference result. So far, I've mostly overshot by 2 points, and always at the first alien to hit. :/
    EDIT: My bad. I didn't read the hit-sequence instruction properly.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Why the hell is this a 3kyu? This is 5-6.

  • Custom User Avatar

    I can't see my solution in the solutions list, even though I can see the others. :|

  • Custom User Avatar

    That was definitely fun. Spent a whole day.

    Pretty straightforward algorithmically. But it was tedious and the debugging process was long. 2 kyu!
    I think you can make it more challenging by testing more invalid expressions.

    Thanks for this!

  • Custom User Avatar

    My bad... thanks!

  • Custom User Avatar

    -(-2+3^2)^(5-3)*2 this expression expects -98.0.
    Tell me if I am missing something here:

    -(-2+3^2)^(5-3)*2 
    -> -(-2+9)^(2)*2
    -> -7^2*2
    -> 49*2
    -> 98
    

    Any even-power of a negative number would be positive.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    After a bit of hair-pulling, the answer turned out to be quite easy.
    Now, to do it in Java!

  • Custom User Avatar
    if (size > 2 && size%2 == 0) { answer[size/2][size/2-1] = 1; }
    

    The test cases are wrong for all even sizes > 2. You should use the above code just before you return the answer.
    This is not a spoiler - this is an essential piece of code to finish an annoyingly buggy kata, even if your code is correct.

  • Custom User Avatar
    if (size > 2 && size%2 == 0) { answer[size/2][size/2-1] = 1; }
    

    The test cases are wrong for all even sizes > 2. You should use the above code just before you return the answer.

  • Loading more items...