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.
@Johan, Why did you approve this one?
No example tests in description
Description requires re-wording and re-formatting
Node 14. should be enabled
Python translation I liked this kata. XD
Returning inconsistent data types is not a best practice.
In this case, it's just cute; normally, special cases often call for either an
Error
to be thrown or a special value of the consistent type that can never result from valid calculation (-1
for anInt
that should have been unsigned is close to the edge already ).Don't worry too much 'bout it - strongly typed languages have sum types for this, so translations are not impossible. But if you're going to return a string for money below zero, you may as well ask for "a week of desserts, doing the dishes, your car keys, your clothes and your dignity".