mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-12 17:05:15 +08:00
update
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
<p>Given an array <code>arr</code> and a chunk size <code>size</code>, return a <strong>chunked</strong> array.</p>
|
||||
<p>Given an array <code>arr</code> and a chunk size <code>size</code>, return a <strong>chunked</strong> array.</p>
|
||||
|
||||
<p>A <strong>chunked</strong> array contains the original elements in <code>arr</code>, but consists of subarrays each of length <code>size</code>. The length of the last subarray may be less than <code>size</code> if <code>arr.length</code> is not evenly divisible by <code>size</code>.</p>
|
||||
<p>A <strong>chunked</strong> array contains the original elements in <code>arr</code>, but consists of subarrays each of length <code>size</code>. The length of the last subarray may be less than <code>size</code> if <code>arr.length</code> is not evenly divisible by <code>size</code>.</p>
|
||||
|
||||
<p>You may assume the array is the output of <code>JSON.parse</code>. In other words, it is valid JSON.</p>
|
||||
|
||||
<p>Please solve it without using lodash's <code>_.chunk</code> function.</p>
|
||||
<p>Please solve it without using lodash's <code>_.chunk</code> function.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong class="example">Example 1:</strong></p>
|
||||
@@ -42,7 +40,7 @@
|
||||
<p><strong>Constraints:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>arr</code> is a valid JSON array</li>
|
||||
<li><code>2 <= JSON.stringify(arr).length <= 10<sup>5</sup></code></li>
|
||||
<li><code>arr</code> is a string representing the array.</li>
|
||||
<li><code>2 <= arr.length <= 10<sup>5</sup></code></li>
|
||||
<li><code>1 <= size <= arr.length + 1</code></li>
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user