Skip to content

Commit 8a8181e

Browse files
committed
Create README - LeetHub
1 parent 664ec47 commit 8a8181e

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<h2><a href="https://leetcode.com/problems/subarray-sums-divisible-by-k/">974. Subarray Sums Divisible by K</a></h2><h3>Medium</h3><hr><div><p>Given an integer array <code>nums</code> and an integer <code>k</code>, return <em>the number of non-empty <strong>subarrays</strong> that have a sum divisible by </em><code>k</code>.</p>
2+
3+
<p>A <strong>subarray</strong> is a <strong>contiguous</strong> part of an array.</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
8+
<pre><strong>Input:</strong> nums = [4,5,0,-2,-3,1], k = 5
9+
<strong>Output:</strong> 7
10+
<strong>Explanation:</strong> There are 7 subarrays with a sum divisible by k = 5:
11+
[4, 5, 0, -2, -3, 1], [5], [5, 0], [5, 0, -2, -3], [0], [0, -2, -3], [-2, -3]
12+
</pre>
13+
14+
<p><strong class="example">Example 2:</strong></p>
15+
16+
<pre><strong>Input:</strong> nums = [5], k = 9
17+
<strong>Output:</strong> 0
18+
</pre>
19+
20+
<p>&nbsp;</p>
21+
<p><strong>Constraints:</strong></p>
22+
23+
<ul>
24+
<li><code>1 &lt;= nums.length &lt;= 3 * 10<sup>4</sup></code></li>
25+
<li><code>-10<sup>4</sup> &lt;= nums[i] &lt;= 10<sup>4</sup></code></li>
26+
<li><code>2 &lt;= k &lt;= 10<sup>4</sup></code></li>
27+
</ul>
28+
</div>

0 commit comments

Comments
 (0)