mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-04 15:01:40 +08:00
存量题库数据更新
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<p>Given an integer array <code>nums</code>, a reducer function <code>fn</code>, and an intial value <code>init</code>, return a <strong>reduced</strong> array.</p>
|
||||
<p>Given an integer array <code>nums</code>, a reducer function <code>fn</code>, and an initial value <code>init</code>, return a <strong>reduced</strong> array.</p>
|
||||
|
||||
<p>A <strong>reduced</strong> array is created by applying the following operation: <code>val = fn(init, nums[0])</code>, <code>val = fn(val, nums[1])</code>, <code>val = fn(val, arr[2])</code>, <code>...</code> until every element in the array has been processed. The final value of <code>val</code> is returned.</p>
|
||||
<p>A <strong>reduced</strong> array is created by applying the following operation: <code>val = fn(init, nums[0])</code>, <code>val = fn(val, nums[1])</code>, <code>val = fn(val, nums[2])</code>, <code>...</code> until every element in the array has been processed. The final value of <code>val</code> is returned.</p>
|
||||
|
||||
<p>If the length of the array is 0, it should return <code>init</code>.</p>
|
||||
|
||||
|
Reference in New Issue
Block a user