您的位置:首页 > 其它

1-bit and 2-bit Characters

2017-11-14 09:33 176 查看
创建一个index 来跟踪判断是否index 会 跳到 n-1 ,如果可以的话  则返回True
否则 返回False。
    if not bits: return False

    n = len(bits)

   

    index = 0

    while index < n:

        if index == n-1 : return True

        if bits[index] == 1:

            index += 2             

        else: index += 1

    return False
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: