Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1711. Count Good Meals
Count the number of index pairs (i<j) in an array whose values sum to a power of two, returning the result modulo 1e9+7. The challenge is to do this efficiently for up to 1e5 elements and values up to 2^20 by checking a small set of power-of-two targets (≈21) using frequency counting or hashing rather than O(n^2).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.