Ad
  • Custom User Avatar

    OP solved it by hard-coding, closing :-)

  • Default User Avatar

    I think this was quite fun, but it can be frustrating if you know nothing about baking cakes, and like needed to re-read instructions a couple of times and think about what happens if you lack some ingredient totally. xD

  • Default User Avatar

    funny but good! :D

  • Default User Avatar

    Used TDD and jest for it. Didn't come up with the math clever answer, but was still happy to have used TDD and jest and learned more about that.

    Had some repetition that I could refactor away still...

  • Custom User Avatar

    Looking through translations, Python seems to have fixed tests with zero weight but not zero prices. Haskell seems to lack zero price tests as well in the fixed suite.

    Those cases are clearly not robust enough, however, since there are still incorrect solutions that aren't invalidated.

  • Default User Avatar

    why and how does it influence?

  • Custom User Avatar

    Weights can be zero, because diamonds exist. Prices can also be zero, because bricks exist.

    If Python does not have ( fixed ) tests with zero weights and / or zero prices, these can ( and should ) be added.

  • Default User Avatar

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

  • Custom User Avatar

    The difference would be 2 in either case.

    Number of climb rounds between adjacent locations is defined as difference of location altitudes (ascending or descending).

  • Default User Avatar

    does up and down climbs count equal weight of difference
    if starting from 9 -> 8 -> 7 differences would be still = 3 between these?

    is it the same as going from 7->8->7 differences would still be 3?

  • Default User Avatar

    pro (or noob) tips for C++

    • remember to forward declare if you intend to use class of your own
    • know where to instantiate your object of the class that you need (best practice avoid global variables)
    • know the initial state
  • Default User Avatar

    That's because some items can have a weight of 0 (which is nonsensical), and the solution only checks up to 0 (not inclusive). Change for w in range(n, 0, -1): to for w in range(n, -1, -1): and it will work.

    Also n can be 0 too. This should be fixed or at least mentioned in the description.

  • Custom User Avatar

    The table name you should use is people, you only need to return a single column, age_sum. That is already in the kata's description, read it again. If you have to sum them all, then the result is a single row.

  • Default User Avatar

    +1

    In particular, since this is supposed to be a beginner kata.
    So far, I haven't solved this kata, as the instructions need much more clarification.

    What is the table name? Which columns are expected to be returned, or just one row?

  • Default User Avatar

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

  • Loading more items...