You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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`).
6
6
7
-
**Example:**
7
+
Now given a string represented by several bits. Return whether the last character must be a one-bit character or not. The given string will always end with a zero.
8
+
9
+
**Example 1:**
8
10
9
11
```
10
-
// 抄Example
12
+
Input:
13
+
bits = [1, 0, 0]
14
+
Output: True
15
+
Explanation:
16
+
The only way to decode it is two-bit character and one-bit character. So the last character is one-bit character.
17
+
```
18
+
19
+
**Example 2:**
20
+
21
+
```
22
+
Input:
23
+
bits = [1, 1, 1, 0]
24
+
Output: False
25
+
Explanation:
26
+
The only way to decode it is two-bit character and two-bit character. So the last character is NOT one-bit character.
0 commit comments