mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-05 00:25:22 +08:00
12 lines
167 B
Go
12 lines
167 B
Go
package leetcode
|
|
|
|
func isOneBitCharacter(bits []int) bool {
|
|
var i int
|
|
for i = 0; i < len(bits)-1; i++ {
|
|
if bits[i] == 1 {
|
|
i++
|
|
}
|
|
}
|
|
return i == len(bits)-1
|
|
}
|