Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
© 2023 DesiQnA 2023
Toggle navigation
Desi QnA
Email or Username
Password
Remember
Login
Register
|
I forgot my password
Dynamic Programming
Tutorials
Compiler
Company-wise questions!
Hot
Tags
Categories
Questions by Pujitha
User Pujitha
Recent activity
All questions
All answers
User Pujitha
Recent activity
All questions
All answers
0
like
0
dislike
0
answers
Chocolates - Problem Description Bittu is a chocolate-loving kid playing a game where he can choose bags of chocolates. Each bag has a different number of chocolates Bittu starts with k chocolates and 1 point. He has two choices for each bag: 1. Accept the Bag: • If the chocolates in the bag are fewer than or equal to the chocolates Bittu has, he won't accept the bag Instead, he'll deduct the bag's chocolates from his stash and gain one point. • If the chocolates in the bag are more than what Bittu has, he can accept the bag His chocolate stash increases by the bag's chocolates, and he loses one point. 2. Ignore the Bag: • Bittu can choose to ignore any number of bags without any consequences. The goal is to maximize Bittu's points. Given
asked
Dec 9, 2023
in
Coding Resources
|
495
views