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
Copy file name to clipboardExpand all lines: src/main/java/com/fishercoder/solutions/_717.java
-24
Original file line number
Diff line number
Diff line change
@@ -1,29 +1,5 @@
1
1
packagecom.fishercoder.solutions;
2
2
3
-
/**
4
-
* 717. 1-bit and 2-bit Characters
5
-
*
6
-
* 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).
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:
10
-
Input:
11
-
bits = [1, 0, 0]
12
-
Output: True
13
-
Explanation:
14
-
The only way to decode it is two-bit character and one-bit character. So the last character is one-bit character.
15
-
16
-
Example 2:
17
-
Input:
18
-
bits = [1, 1, 1, 0]
19
-
Output: False
20
-
Explanation:
21
-
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