mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-06 07:51:41 +08:00
存量题库数据更新
This commit is contained in:
@@ -1,9 +1,21 @@
|
||||
<p>Given an integer array <code>nums</code> and an integer <code>k</code>, return <code>true</code> <em>if </em><code>nums</code><em> has a continuous subarray of size <strong>at least two</strong> whose elements sum up to a multiple of</em> <code>k</code><em>, or </em><code>false</code><em> otherwise</em>.</p>
|
||||
<p>Given an integer array nums and an integer k, return <code>true</code> <em>if </em><code>nums</code><em> has a <strong>good subarray</strong> or </em><code>false</code><em> otherwise</em>.</p>
|
||||
|
||||
<p>An integer <code>x</code> is a multiple of <code>k</code> if there exists an integer <code>n</code> such that <code>x = n * k</code>. <code>0</code> is <strong>always</strong> a multiple of <code>k</code>.</p>
|
||||
<p>A <strong>good subarray</strong> is a subarray where:</p>
|
||||
|
||||
<ul>
|
||||
<li>its length is <strong>at least two</strong>, and</li>
|
||||
<li>the sum of the elements of the subarray is a multiple of <code>k</code>.</li>
|
||||
</ul>
|
||||
|
||||
<p><strong>Note</strong> that:</p>
|
||||
|
||||
<ul>
|
||||
<li>A <strong>subarray</strong> is a contiguous part of the array.</li>
|
||||
<li>An integer <code>x</code> is a multiple of <code>k</code> if there exists an integer <code>n</code> such that <code>x = n * k</code>. <code>0</code> is <strong>always</strong> a multiple of <code>k</code>.</li>
|
||||
</ul>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
<p><strong class="example">Example 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums = [23,<u>2,4</u>,6,7], k = 6
|
||||
@@ -11,7 +23,7 @@
|
||||
<strong>Explanation:</strong> [2, 4] is a continuous subarray of size 2 whose elements sum up to 6.
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
<p><strong class="example">Example 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums = [<u>23,2,6,4,7</u>], k = 6
|
||||
@@ -20,7 +32,7 @@
|
||||
42 is a multiple of 6 because 42 = 7 * 6 and 7 is an integer.
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 3:</strong></p>
|
||||
<p><strong class="example">Example 3:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums = [23,2,6,4,7], k = 13
|
||||
|
Reference in New Issue
Block a user