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.
LOL
What about it? The answer is undefined, and JS will give some answer ( either
NaN
or positive or negativeInfinity
, because of IEEE.754 ).There is no need to special case it.
What would you do about it?
How about y = 0 ?
The best solution i've ever seen in my life
XD 100% match, though I don't know if it's best practice or clever
No need to call str() so many times
This comment is hidden because it contains spoiler information about the solution
Slightly more readable, imo.
why?
I thought about it at first, but converting the unbalanced problem into a balanced one is a trivial task programming-wise, so I did not include it.
Oh, sorry, just missed it.
But it can be a real addition to this kata(unbalanced type).
It'll be a little bit harder.
Thanks for the answer.
No, you will never need to add a supplier/consumer.
Will it always be closed(balanced) type of transport optimization task or not?
Should i check the type of task and add supplier or consumer in dependency to the deficiency between total sums of consumers demands and suppliers production?