Java Very Concise and Easy Solution


  • 0
    K
    class Solution {
        public boolean isOneBitCharacter(int[] bits) {
            int len=bits.length;
            int i=0;
            while(i<len-1){
                if(bits[i]==1) i=i+2;
                else i++;
            }
            return i!=len;
        }
    }
    

Log in to reply
 

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