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)

版权声明:本文为libuda原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/libuda/p/9565992.html