题解 | #求最大连续bit数#
求最大连续bit数
https://www.nowcoder.com/practice/4b1658fd8ffb4217bc3b7e85a38cfaf2
n = int(input())
s = bin(n)[2:].split('0')
print(len(max(s,key=lambda x:len(x))))
s = bin(n)[2:].split('0')
print(len(max(s,key=lambda x:len(x))))
求最大连续bit数
https://www.nowcoder.com/practice/4b1658fd8ffb4217bc3b7e85a38cfaf2
相关推荐