Ad
  • Default User Avatar

    A solid math/coding exercise. Very satisfying.

  • Default User Avatar
  • Default User Avatar

    Decently challenging - had to learn some new Python features to do it. Very satisfying in the end.

    Would recommend fixing description as per rge123's suggestions.

  • Default 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.
  • Default User Avatar

    Solid exercise with an elegant solution. Very satisfying.

  • Default User Avatar

    Very satisfying. (You're lucky I like ham and cheese on my pizza.)

  • Default User Avatar

    Interesting & practical exercise. Copying the turkish words from the description into the program was a bit cumbersome, but I can't think of a way around that issue that doesn't (a) pigeonhole users into one kind of solution or (b) change the turkish language to have sensible letters.

  • Default User Avatar

    You're very welcome! I'm glad to hear my compulsive documentation habit is helpful.

  • Default User Avatar

    Very satisfying exercise. Requires some thought / knowledge of numpy, but leads to an elegant solution.

  • Default User Avatar

    A nice little math problem, with an elegant solution. It did strike me as more of a math problem than a coding one - in the sense that once I figured out what the math was, the code was very simple - but maybe that works for 7 kyu. Very satisfied.

  • Default User Avatar

    This is the kind of code we all want to maintain.