Ad
  • Custom 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.

  • Custom User Avatar

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

    There's only 2 in-between.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom 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. ;)

  • Custom 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.

  • Custom 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.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

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