Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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.
Description needs a lot more information.
product(1, 3)
Expected: 2, instead got: 4
What.
There's only 2 in-between.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Took me actually longer figuring out what to do than writing the solution...
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. ;)
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.
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.
You must return the sum of the lowest positive numbers, not the lowest numbers. ;)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution