Kimi LeetCode 3621. 位计数深度为 K 的整数数目 I Python3实现
LeetCode 3621. 位计数深度为 K 的整数数目 I Python3 实现python
from functools import lru_cacheclass Solution:def popcountDepth(self, n: int, k: int) -> int:# k0:只有 1 的深度为 0if k 0:return 1 if n > 1 else 0# 预处理 1~60 的 popcount-dept…
2026/7/19 0:49:06