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.
Easier to read than mine for sure. Kudos! I did write some test cases that caused it to fail though. Not sure if these edge cases are worth handling for a Kata. Testing is in my blood. I'm thinking { mush: 0, apples: 3 }, { apples: 7, mush: 0 } should return 2, { apples: null, mush: 1 }, { mush: 1, apples: 0 } should return 1 and { apples: -1, mush: 1 }, { mush: 1, apples: Infinity } should return 1.
Terse and way easier to read than mine for sure. Kudos! I did write some test cases that caused it to fail though. Not sure if these edge cases are worth handling for a Kata. Testing is in my blood. I'm thinking { mush: 0, apples: 3 }, { apples: 7, mush: 0 } should return 2, { apples: null, mush: 1 }, { mush: 1, apples: 0 } should return 1 and { apples: -1, mush: 1 }, { mush: 1, apples: Infinity } should return 1.
The top 3 as of today are all shorter than my solution. I tend to try and account for crazy input. My augmented test cases for this solution return NaN for cakes({ mush: 0, apples: 3 }, { apples: 7, mush: 0 }), cakes({ apples: 0, mush: 0 }, { mush: 0, apples: 0 } and cakes({ apples: null, mush: 1 }, { mush: 1, apples: 0 }). cakes({ apples: -1, mush: 1 }, { mush: 1, apples: Infinity }) returns -Infinity. Are my test cases too edgy for the codewars Kata?