public boolean isOneBitCharacter(int[] bits) {
int temp = 0;
for (int i=0;i<bits.length;i+=temp) temp = bits[i] + 1;
return temp == 1;
}
Java 3liner


@BatCoder pointer i increase two when meet with '10' or '11', increase one if meets with '0'