Available question text
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.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 3583. Count Special Triplets
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source