Problem 2859 · Easy

Sum of Values at Indices With K Set Bits

Count the set bits of each index in binary and add the value at every index whose count equals k.

Open the interactive visualisation