Ad
  • Default User Avatar

    Because the description does not make clear that when there is only one number in-between to just return that number as is.
    Quite the opposite, either it's the product of the 2 by itself as return value (hence 4) or "impossible" because there are no two numbers to multiplay with each other and should therefore return "Error".
    As I said, the description lacks information on that part.

  • Default User Avatar

    Description needs a lot more information.
    product(1, 3)
    Expected: 2, instead got: 4
    What.

    There's only 2 in-between.

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    Took me actually longer figuring out what to do than writing the solution...

  • Default User Avatar

    I guess with "complicated" you mean there's an arguably easier way of getting what you are asked of. Well, sure, the shorter the one-liner on CW the better.
    Yet it is difficult to follow your argument if you use a syntax that is a lot less readable and harder to understand on first glimpse.
    Complicated is perhaps the wrong word here as I'd argue your solution is a lot more complicated, even if more clever. ;)

  • Default User Avatar

    The description is still somewhat terrible, or rather misleading.

    Forfeited as I'm not sure what exactly was expected (and my naive approach was too naive obviously).
    But looking at the solutions I have no clue what this particular kata is actually about and why the solutions work as they do.

  • Default User Avatar

    Technically all of the katas from g964 are math problems.
    Encountered in the real world have I never any of these math problems, though.
    In university, yes, in discrete mathematics and similar but otherwise never.
    Especially not in any programming related course or field.

  • Default User Avatar

    You must return the sum of the lowest positive numbers, not the lowest numbers. ;)

  • Default User Avatar

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

  • Default User Avatar

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