Ad
  • Custom User Avatar

    Hi, I'm new here. Thanks for the Kata :)

    I think, there are some issues with the Random Tests. Or is my execution just wrong?!

    This example sould be valid, no?! flour: 4/4 cup = 1 cup (200g) = 200g = 'enough ingredients'.

    Why does it expect "need flour", though?!

    Log:

      ERROR: Expected: 'Not enough ingredients: need flour', instead got: 'You can bake'
    
      IN:
      available:    { oil: '700 ml', flour: '200 g', sugar: '400 g', milk: '200 ml' }
      recipe:       { oil: '3 cup', flour: '4/4 cup', sugar: '1 tbsp', milk: '24 tsp' }
      
      OUT:
      converted:    { oil: '660 ml', flour: '200 g', sugar: '14 g', milk: '120 ml' }
      isAvailable:  { oil: true, flour: true, sugar: true, milk: true }
      result:       'You can bake'
    
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Thanks for the report. It should be fixed now.

  • Default User Avatar

    First time submitting an issue, hope I'm not going about it the wrong way.

    Final fixed test recipe is:

    { oil: '3 tbsp', flour: '2 cup', sugar: '0.5', milk: '1 cup' }

    'Sugar' has no unit. Instructions don't seem to cover missing units.

  • Custom User Avatar

    You can bake a basic cake is using the following ingredients

    Corrected:
    You can bake a basic cake by using the following ingredients

  • Default User Avatar

    .

  • Custom User Avatar

    Fixed, thanks!

  • Custom User Avatar

    All other are seprated by a space but

     "milk" : randomArr[3] + "ml"
    
  • Custom User Avatar

    A classical question for an interview job and very important to know it. Unfortunately it's a duplicate of a kata previously published: https://www.codewars.com/kata/find-the-duplicated-number-in-a-consecutive-unsorted-list-tougher-version

    And many others with very similar.

  • Custom User Avatar

    Description specifies two different rules for which duplicate to return. The second is wrong.

    Returning -1 is not a good choice. It might be a valid return value as well ( you never specify that the array only contains nonnegative numbers ). undefined or in this case maybe NaN (!) might have been better choices, if you don't want to throw an Error.

    map[] === true ( in the reference solution ) is a bit of an antipattern, isn't it? It's a Boolean already.