Skip to content

Commit cee73ba

Browse files
committed
Create README - LeetHub
1 parent b74b8e3 commit cee73ba

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<h2><a href="https://leetcode.com/problems/1-bit-and-2-bit-characters">717. 1-bit and 2-bit Characters</a></h2><h3>Easy</h3><hr><p>We have two special characters:</p>
2+
3+
<ul>
4+
<li>The first character can be represented by one bit <code>0</code>.</li>
5+
<li>The second character can be represented by two bits (<code>10</code> or <code>11</code>).</li>
6+
</ul>
7+
8+
<p>Given a binary array <code>bits</code> that ends with <code>0</code>, return <code>true</code> if the last character must be a one-bit character.</p>
9+
10+
<p>&nbsp;</p>
11+
<p><strong class="example">Example 1:</strong></p>
12+
13+
<pre>
14+
<strong>Input:</strong> bits = [1,0,0]
15+
<strong>Output:</strong> true
16+
<strong>Explanation:</strong> The only way to decode it is two-bit character and one-bit character.
17+
So the last character is one-bit character.
18+
</pre>
19+
20+
<p><strong class="example">Example 2:</strong></p>
21+
22+
<pre>
23+
<strong>Input:</strong> bits = [1,1,1,0]
24+
<strong>Output:</strong> false
25+
<strong>Explanation:</strong> The only way to decode it is two-bit character and two-bit character.
26+
So the last character is not one-bit character.
27+
</pre>
28+
29+
<p>&nbsp;</p>
30+
<p><strong>Constraints:</strong></p>
31+
32+
<ul>
33+
<li><code>1 &lt;= bits.length &lt;= 1000</code></li>
34+
<li><code>bits[i]</code> is either <code>0</code> or <code>1</code>.</li>
35+
</ul>

0 commit comments

Comments
 (0)