暴力就可以过,因为S最大1000,2的10次方就1024,后面的其实都不行.
class Solution(object): def queryString(self, S, N): if N>1024:return False return all(bin(i)[2:] in S for i in xrange(N,0, -1))
暴力就可以过,因为S最大1000,2的10次方就1024,后面的其实都不行.
class Solution(object): def queryString(self, S, N): if N>1024:return False return all(bin(i)[2:] in S for i in xrange(N,0, -1))
转载于:https://www.cnblogs.com/zywscq/p/10699291.html