• Custom User Avatar

    This would return False for 4.0, but that should be True based on the constraints in the description (only floats with a decimal part not equal to 0 are uneven).

  • Custom User Avatar

    (If you run out of ammo at the same time as the remaining zombies reach you, return "You shot X zombies before being eaten: overwhelmed.".)

    that is in the details, i think in the case mentioned you run out for ammo at the same time zobies reach you, since you need to mutiply range by 2 because zombies move 0.5 meters

  • Custom User Avatar

    The description is not clear about what is in your mind. Also, not all languages test this edge case.

  • Custom User Avatar

    Thank you for the feedback. I appreciate the thought and detail you put into it.

  • Custom User Avatar

    Like a few other kata I've seen, this is as much a math problem as a coding one. Unlike those, the math problem here is complicated and hard - the square pizza algorithm requires factoring n, which gets much harder as n increases. In combination with the large test numbers and the runtime limit, it becomes a "how many optimization tricks do you know" problem more than a math problem.

    As-is, this is more difficult than I think it really needs to be. Depending on the difficulty level you're aiming for, I would recommend either:

    • Lower the maximum n for test cases to something slightly less absurd, so that less optimized solutions can get past the runtime limit (low difficulty - ~7 kyu).
    • Keep the high n (higher difficulty - ~5 kyu): You may want to reflavor it as a non-pizza-related geometry problem, so us geometry nerds notice it (and to avoid the issue of crusts on square pizzas).

    Additonal suggestions:

    • Instead of having a fixed scenario of 1 circular & 1 square pizza, consider adding an input variable to indicate what kind of pizzas are involved (could be a string "circle" or "square", a list or other type encoding multiple pizzas, etc.). This would require the same algorithms to solve (we would still need to figure out how to evenly divide circular / square pizzas), but would be more flexible and therefore interesting.
  • Custom User Avatar

    That was pretty much it: in my mind "out of ammo" was the situation where you have run out of ammo and are just waiting for the zombies to get to you.

  • Custom User Avatar

    if(zombies==100 and distance==10 and ammo==20)...
    the function returns:'You shot 20 zombies before being eaten: overwhelmed.'
    Am I wrong in thinking the "reason" was loss of ammo?
    there are 20 shots fire. One at each whole second, 1 through 10. One at each half second, 0.5 through 9.5.
    So when the zombies arrive, we are out of ammo. Or, does overwhelmed encompass any situation where it is impossible to kill all the zombies even if we had infinite bullets.

  • Custom User Avatar

    remove ;
    remove (n==101)+(n>101)
    add (n>100)

  • Custom User Avatar

    The description does mention permutations, so perhaps it was my poor reading and comprehension. Nevertheless, I think adding a shorter example to clarify the directions would help.

  • Custom User Avatar

    The description mentions permutations:

    find the sum of all numbers with the same digits(permutations) including duplicates

  • Custom User Avatar
  • Custom User Avatar

    Well, the author is active, maybe he'll consider your suggestion.

  • Custom User Avatar

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

  • Custom User Avatar

    And didn't you read the examples?

    sum_arrangements(123) returns 1332 #123 + 132 + 213 + 231 + 312 + 321 = 1332

    How would that be looking through the numbers 1 through 10**5 for matches?

  • Custom User Avatar

    Wording is confusing. I thought I was looking through the numbers 1 through 10**5 for matches. Instead, we are adding permutations. Adding more clarifying examples might help.
    7 --> 7
    77 --> 7 + 7 = 14
    122 --> 122 + 122 + 212 + 212 + 221 + 221 = 1110

  • Loading more items...