Skip to content

Commit ca2a467

Browse files
committed
deploy: da2ffb8
1 parent de92f6f commit ca2a467

File tree

6 files changed

+297
-23
lines changed

6 files changed

+297
-23
lines changed

en/lc/3325/index.html

Lines changed: 145 additions & 8 deletions
Large diffs are not rendered by default.

en/lc/908/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79778,9 +79778,9 @@ <h2 id="solutions">Solutions</h2>
7977879778
<!-- solution:start -->
7977979779

7978079780
<h3 id="solution-1-mathematics">Solution 1: Mathematics</h3>
79781-
<p>According to the problem description, we can add $k$ to the maximum value in the array and subtract $k$ from the minimum value. This can reduce the difference between the maximum and minimum values in the array.</p>
79782-
<p>Therefore, the final answer is $\max(nums) - \min(nums) - 2 \times k$.</p>
79783-
<p>The time complexity is $O(n)$, where $n$ is the length of the array <code>nums</code>. The space complexity is $O(1)$.</p>
79781+
<p>According to the problem description, we can subtract $k$ from the maximum value in the array and add $k$ to the minimum value in the array, which can reduce the difference between the maximum and minimum values in the array.</p>
79782+
<p>Therefore, the final answer is the larger value between $\max(\textit{nums}) - \min(\textit{nums}) - 2 \times k$ and $0$.</p>
79783+
<p>The time complexity is $O(n)$, where $n$ is the length of the array $\textit{nums}$. The space complexity is $O(1)$.</p>
7978479784
<div class="tabbed-set tabbed-alternate" data-tabs="1:6"><input checked="checked" id="__tabbed_1_1" name="__tabbed_1" type="radio" /><input id="__tabbed_1_2" name="__tabbed_1" type="radio" /><input id="__tabbed_1_3" name="__tabbed_1" type="radio" /><input id="__tabbed_1_4" name="__tabbed_1" type="radio" /><input id="__tabbed_1_5" name="__tabbed_1" type="radio" /><input id="__tabbed_1_6" name="__tabbed_1" type="radio" /><div class="tabbed-labels"><label for="__tabbed_1_1">Python3</label><label for="__tabbed_1_2">Java</label><label for="__tabbed_1_3">C++</label><label for="__tabbed_1_4">Go</label><label for="__tabbed_1_5">TypeScript</label><label for="__tabbed_1_6">Rust</label></div>
7978579785
<div class="tabbed-content">
7978679786
<div class="tabbed-block">

en/search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)