🙃 a very simple solution in java


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

Log in to reply
 

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