Help me to build logic on this python problem of gallons ! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 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 !

2nd Jan 2021, 12:46 PM
Ratnapal Shende
Ratnapal Shende - avatar
3 Answers
0
30th Nov 2021, 9:07 AM
DAD CALLING
- 5
《 Nicko12 》 no bro I post the whole problem their is nothing like that..
2nd Jan 2021, 12:52 PM
Ratnapal Shende
Ratnapal Shende - avatar
- 6
Maybe are there list or array of possible bottle containers with different volumes? Like for example: btl_gallons = [10, 7, 5, 3, 1]
2nd Jan 2021, 12:48 PM
noteve
noteve - avatar