Practice Can You Eat Your Favorite Candy on Your Favorite Day?
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
candiesCount[i] gives the number of candies of type i. Start eating on day 0, consuming at least one candy each day until all candies are gone. Finish every candy of each type before moving to the next type, though several types may be eaten on one day. For each independent query [favoriteType,favoriteDay,dailyCap], return whether that type can be eaten on that day while consuming at most dailyCap candies per day. Return the boolean answers in query order.
Source: Can You Eat Your Favorite Candy on Your Favorite Day? on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
candiesCount = [7,4,5,3,8], queries = [[0,2,2],[4,2,4],[2,13,1000000000]]
[true,false,true]
# Example 2
candiesCount = [5,2,6,4,1], queries = [[3,1,2],[4,10,3],[3,10,100],[4,100,30],[1,3,1]]
[false,true,true,false,false]
Constraints
Related LeetCode Problems
Practice more problems similar to Can You Eat Your Favorite Candy on Your Favorite Day?.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.