Company: Electronic arts _30oct
Difficulty: medium
Adjust Recipe Quantities Problem Description You have the ingredient list of a recipe written for one person, and you want to cook the same dish for nb_persons people, so every quantity has to be multiplied by nb_persons . Each ingredient is one line with exactly this shape: an integer written in digits, the quantity, one space character, some words describing the product. Produce the same list with the leading integer of each line multiplied by nb_persons . The product description is copied unchanged: you do not have to fix singular or plural, and any number that appears inside the description (as in 7up or 80g ) must stay exactly as it is. The order of the lines must be preserved. Complete the function adjust_quantities in the editor below. It has the following parameters: nb_persons : the number of people to cook for. ingredients : the ingredient lines of the one-person recipe. The function must return the adjusted ingredient lines, in the same order. Input The first line contains t