Ad
  • Custom User Avatar

    In this scenario, he is making 2.5 cakes. The description is super misleading.

  • Default User Avatar

    It seems that author doesn't gona fix or explain this issue.
    I also agree that {"eggs":1,"flour":200,"sugar":100} is a correct answer.
    No, seriously, WTF?

  • Custom User Avatar

    That's exactly what came to my mind!
    He just added enough ingredients to bake 2.5 cakes. He has to add some anyway.
    I also think

    {"eggs":1,"flour":200,"sugar":100}

    is the correct output for this case.

  • Custom User Avatar

    also for ruby

  • Custom User Avatar

    And not just for JS. I believe it is no higher than 7 kyu for Python.

  • Default User Avatar

    I feel like this should be a 7 or 8 kyu for JS.

  • Default User Avatar

    what am I not understanding about the last test case of the 2nd advanced set: it's responding:

    recipe: (unmodified)
    { flour: 400, eggs: 2, sugar: 200 }
    added: (unmodified)
    { flour: 1000, eggs: 5, sugar: 500 }
    Expected: {}, instead got: {"eggs":1,"flour":200,"sugar":100}
    

    why would the output be empty? the recipe to make 1 cake requiers 400 flour, we've added 1k already, the next neriest multiple is 1200 ? or am I misunderstanding what is suppose to happen?