Practice Count Good Meals
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
A good meal is a meal that contains exactly two different food items with a sum of deliciousness equal to a power of two. You can pick any two different foods to make a good meal. Given an array of integers deliciousness where deliciousness[i] is the deliciousness of the ith item of food, return the number of different good meals you can make from this list modulo 10^9 + 7. Note that items with different indices are considered different even if they have the same deliciousness value.
Source: Count Good Meals on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
deliciousness = [1,3,5,7,9]
4
# Example 2
deliciousness = [1,1,1,3,3,3,7]
15
Constraints
Related LeetCode Problems
Practice more problems similar to Count Good Meals.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.