Ad
  • Custom User Avatar

    Glad it helped! If you feel like you don't have any more questions, then please mark your question as resolved (you can do this by replying to my comment and checking the "mark as resolved" checkbox).

  • Custom User Avatar

    You will be given two dictionaries, recipe and available.

    1. recipe is a dictionary containing ingredients and the amount of those ingredients needed to bake a cake.
    2. available is a dictionary containing the ingredients that Pete has, and the amount of those ingredients.

    You should calculate how many cakes Pete can bake using his available ingredients.

    For example, if a cake can be baked using 2 cups of flour + 1 cup of milk and Pete has 6 cups of flour + 3 cups of milk, then Pete can bake 3 cakes since he has 3x the ingredients. But if Pete has 6 cups of flour and 3 cups of milk instead, then he can only bake two cakes. Despite having 3x the amount of flour, he only has 2x the amount of milk, so he can only bake 2 cakes. Always choose the lowest possible amount. Also, if the available dictionary is missing one or more ingredients from the recipe dictionary, the answer should logically be 0 - you can't bake a cake without having all the needed ingredients.

  • Custom User Avatar

    it's hard to tell because you did not use markdown code highlighting, but from what i see, during the for loop, you erase the last most frequent element (vr_digit) with the next one in case of a tie, before checking which one is greater

  • Custom User Avatar

    You have to come up with the correct signature for the function yourself, that's part of the task.