Tap here to switch tabs
Problem
Submissions

Problem: 1-bit and 2-bit Characters

med
30 min
Try to solve the 1-bit and 2-bit Characters problem.

Statement

There are two types of special characters:
The first character is represented by a single bit, 00.
The second character is represented by two bits, either 1010 or 1111.

Given an array of binary digits bits that terminates with 00, return true if the final character must be a one bit character, and false otherwise.

Constraints:

  • 1≤1 \leq bits.length ≤1000\leq 1000

  • bits[i] is either 00 or 11.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: 1-bit and 2-bit Characters

med
30 min
Try to solve the 1-bit and 2-bit Characters problem.

Statement

There are two types of special characters:
The first character is represented by a single bit, 00.
The second character is represented by two bits, either 1010 or 1111.

Given an array of binary digits bits that terminates with 00, return true if the final character must be a one bit character, and false otherwise.

Constraints:

  • 1≤1 \leq bits.length ≤1000\leq 1000

  • bits[i] is either 00 or 11.