Available question text
Return the sum of elements nums[i] for all indices i whose binary representation contains exactly k set bits (i.e., popcount(i) == k). Constraints are small (n ≤ 1000, k ≤ 10), so check each index’s bit-count and accumulate.
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 2859. Sum of Values at Indices With K Set Bits
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source