Skip to content

Commit 43c83a7

Browse files
refactor 717
1 parent b1f90b7 commit 43c83a7

File tree

1 file changed

+0
-24
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-24
lines changed

src/main/java/com/fishercoder/solutions/_717.java

-24
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,5 @@
11
package com.fishercoder.solutions;
22

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.
22-
23-
Note:
24-
1 <= len(bits) <= 1000.
25-
bits[i] is always 0 or 1.
26-
*/
273
public class _717 {
284
public static class Solution1 {
295
public boolean isOneBitCharacter(int[] bits) {

0 commit comments

Comments
 (0)