Your Dashboard
- Interview Coaching 
- Learn 
- System Design 
- ML System Design 
- Code 
- Behavioral 
- Salary Negotiation 
- Interview Guides 
Search
⌘K
Get Premium
Leetcode 3583. Count Special Triplets
Count the number of index triplets (i<j<k) where nums[i] and nums[k] both equal 2 * nums[j]; this reduces to, for each j, multiplying the count of 2*nums[j] on the left by the count on the right and summing (mod 1e9+7). Constraints: n up to 1e5 and nums[i] up to 1e5, so use frequency maps/prefix-suffix counts for an O(n) solution.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Currently 30% off
Hello Interview Premium

Your account is free and you can post anonymously if you choose.