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