def isOneBitCharacter(bits):
"""
:type bits: List[int]
:rtype: bool
"""
while len(bits)>2:
if bits[0]==1:
bits=bits[2:]
else:
bits=bits[1:]
if bits==[1,0]:
return False
elif bits==[0,0] or bits==[0]:
return True
res=isOneBitCharacter([1,1,1,1,1,0,0,0,0,1,1,1,1,0])
print(res)
转载于:https://www.cnblogs.com/libuda/p/9565992.html