Skip to content

Commit 28d7631

Browse files
committed
Create README - LeetHub
1 parent 2f9acb6 commit 28d7631

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<h2><a href="https://leetcode.com/problems/binary-prefix-divisible-by-5">1071. Binary Prefix Divisible By 5</a></h2><h3>Easy</h3><hr><p>You are given a binary array <code>nums</code> (<strong>0-indexed</strong>).</p>
2+
3+
<p>We define <code>x<sub>i</sub></code> as the number whose binary representation is the subarray <code>nums[0..i]</code> (from most-significant-bit to least-significant-bit).</p>
4+
5+
<ul>
6+
<li>For example, if <code>nums = [1,0,1]</code>, then <code>x<sub>0</sub> = 1</code>, <code>x<sub>1</sub> = 2</code>, and <code>x<sub>2</sub> = 5</code>.</li>
7+
</ul>
8+
9+
<p>Return <em>an array of booleans </em><code>answer</code><em> where </em><code>answer[i]</code><em> is </em><code>true</code><em> if </em><code>x<sub>i</sub></code><em> is divisible by </em><code>5</code>.</p>
10+
11+
<p>&nbsp;</p>
12+
<p><strong class="example">Example 1:</strong></p>
13+
14+
<pre>
15+
<strong>Input:</strong> nums = [0,1,1]
16+
<strong>Output:</strong> [true,false,false]
17+
<strong>Explanation:</strong> The input numbers in binary are 0, 01, 011; which are 0, 1, and 3 in base-10.
18+
Only the first number is divisible by 5, so answer[0] is true.
19+
</pre>
20+
21+
<p><strong class="example">Example 2:</strong></p>
22+
23+
<pre>
24+
<strong>Input:</strong> nums = [1,1,1]
25+
<strong>Output:</strong> [false,false,false]
26+
</pre>
27+
28+
<p>&nbsp;</p>
29+
<p><strong>Constraints:</strong></p>
30+
31+
<ul>
32+
<li><code>1 &lt;= nums.length &lt;= 10<sup>5</sup></code></li>
33+
<li><code>nums[i]</code> is either <code>0</code> or <code>1</code>.</li>
34+
</ul>

0 commit comments

Comments
 (0)