mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-04 06:51:41 +08:00
存量题库数据更新
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<p>Given an integer array <code>nums</code> and two integers <code>k</code> and <code>p</code>, return <em>the number of <strong>distinct subarrays</strong> which have <strong>at most</strong></em> <code>k</code> <em>elements divisible by</em> <code>p</code>.</p>
|
||||
<p>Given an integer array <code>nums</code> and two integers <code>k</code> and <code>p</code>, return <em>the number of <strong>distinct subarrays,</strong> which have <strong>at most</strong></em> <code>k</code> <em>elements </em>that are <em>divisible by</em> <code>p</code>.</p>
|
||||
|
||||
<p>Two arrays <code>nums1</code> and <code>nums2</code> are said to be <strong>distinct</strong> if:</p>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<p>A <strong>subarray</strong> is defined as a <strong>non-empty</strong> contiguous sequence of elements in an array.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
<p><strong class="example">Example 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums = [<u><strong>2</strong></u>,3,3,<u><strong>2</strong></u>,<u><strong>2</strong></u>], k = 2, p = 2
|
||||
@@ -23,7 +23,7 @@ Note that the subarrays [2] and [3] occur more than once in nums, but they shoul
|
||||
The subarray [2,3,3,2,2] should not be counted because it has 3 elements that are divisible by 2.
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
<p><strong class="example">Example 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums = [1,2,3,4], k = 4, p = 1
|
||||
@@ -42,3 +42,8 @@ Since all subarrays are distinct, the total number of subarrays satisfying all t
|
||||
<li><code>1 <= nums[i], p <= 200</code></li>
|
||||
<li><code>1 <= k <= nums.length</code></li>
|
||||
</ul>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Follow up:</strong></p>
|
||||
|
||||
<p>Can you solve this problem in O(n<sup>2</sup>) time complexity?</p>
|
||||
|
Reference in New Issue
Block a user