给定一个非负整数n,使用python中的队列以二进制表示返回最长连续运行1s的长度

2024-05-19 03:02:45 发布

您现在位置:Python中文网/ 问答频道 /正文

约束条件

0 ≤ n < 2 ** 31

例1

Input
n = 156
Output
3

解释

156 is10011100 in binary and there's a run of length 3.


Tags: andofrunininputoutputlengththere

热门问题