easy java


  • 0
        public boolean isOneBitCharacter(int[] bits) {
            int i = 0;
            while (i < bits.length) {
                if (bits[i] == 1) i += 2;
                else {
                    if (i == bits.length - 1) return true;
                    i++;
                }
            }
            return false;
        }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.