Kimi LeetCode 3677. 统计二进制回文数字的数目 Python3实现
这是可以直接提交到 LeetCode 的完整 Python3 实现:python
class Solution:def countBinaryPalindromes(self, n: int) -> int:if n 0:return 1# 获取 n 的二进制位数(不含前导零)def get_binary_length(x: int) -> int:length 0whil…