JAVA_1-bit and 2-bit Characters_LeetCode 717


JAVA_1-bit and 2-bit Characters_LeetCode 717

JAVA_1-bit and 2-bit Characters_LeetCode 717 풀이 class Solution { public boolean isOneBitCharacter(int[] bits) { int i = 0; while (i < bits.length - 1) { i = (bits[i] == 1) ? i + 2 : i + 1; } return i == bits.length - 1; } } * 출처 1-bit and 2-bit Characters - LeetCode 1-bit and 2-bit Characters - We have two special characters: * The first character can be represented by one bit 0. * The second character can be represented by two bits (10 or 11). Given a binary array bits that ends with 0, return ...


#1_bitand2_bitCharacters_LeetCode717 #JAVA #JAVA_1_bitand2_bitCharacters #JAVA_1_bitand2_bitCharacters_LeetCode717 #JAVA_LeetCode717

원문링크 : JAVA_1-bit and 2-bit Characters_LeetCode 717