Ad
  • Default User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

    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?