- 1
Help me to build logic on this python problem of gallons !
This is the problem I got from a website but I am unable to understand the logic behind sample example 2. please help me to understand it. Input : Integer N denoting the supply order of Beer in Gallons Output : Integer denoting the Minimum number of bottles that can fulfil the demand Sample input 1 : 17 Sample Output 1 : 2 Explanation : 17 gallons can be fulfilled using 1 (10 gallons) and 1(7 gallons ) Bottle. Hence minimum number of bottles is 2 Sample input 1 : 13 Sample Output 1 : 3 Explanation : 13 Gallons can be fulfilled using 1 (7 gallon ) + 1 (5 gallon) Bottle + 1(1 gallon) Bottle. Hence Minimum number of bottles is 3. Please help guys !
3 Answers
0
- 5
ă Nicko12 ă no bro I post the whole problem their is nothing like that..
- 6
Maybe are there list or array of possible bottle containers with different volumes?
Like for example: btl_gallons = [10, 7, 5, 3, 1]