2859. Sum of Values at Indices With K Set Bits Обновлено: 2024-03-12 1 мин Algorithms , LeetCode СодержаниеLeetCode problem 2859class Solution: def sumIndicesWithKSetBits(self, nums: List[int], k: int) -> int: return sum(x for i, x in enumerate(nums) if i.bit_count() == k)