Skip to content

Commit 415623e

Browse files
committed
deploy: da21eee
1 parent a9ce59b commit 415623e

File tree

14 files changed

+7670
-7008
lines changed

14 files changed

+7670
-7008
lines changed

en/lc/1110/index.html

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

en/lc/2293/index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55125,9 +55125,9 @@
5512555125
<ul class="md-nav__list">
5512655126

5512755127
<li class="md-nav__item">
55128-
<a href="#solution-1" class="md-nav__link">
55128+
<a href="#solution-1-simulation" class="md-nav__link">
5512955129
<span class="md-ellipsis">
55130-
Solution 1
55130+
Solution 1: Simulation
5513155131
</span>
5513255132
</a>
5513355133

@@ -77364,7 +77364,9 @@ <h2 id="description">Description</h2>
7736477364
<h2 id="solutions">Solutions</h2>
7736577365
<!-- solution:start -->
7736677366

77367-
<h3 id="solution-1">Solution 1</h3>
77367+
<h3 id="solution-1-simulation">Solution 1: Simulation</h3>
77368+
<p>According to the problem statement, we can simulate the entire process, and the remaining number will be the answer. In implementation, we do not need to create an additional array; we can directly operate on the original array.</p>
77369+
<p>The time complexity is $O(n)$, where $n$ is the length of the array $\textit{nums}$. The space complexity is $O(1)$.</p>
7736877370
<div class="tabbed-set tabbed-alternate" data-tabs="1:7"><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" /><input id="__tabbed_1_7" 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><label for="__tabbed_1_7">C</label></div>
7736977371
<div class="tabbed-content">
7737077372
<div class="tabbed-block">

en/lc/2294/index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55146,9 +55146,9 @@
5514655146
<ul class="md-nav__list">
5514755147

5514855148
<li class="md-nav__item">
55149-
<a href="#solution-1" class="md-nav__link">
55149+
<a href="#solution-1-greedy-sorting" class="md-nav__link">
5515055150
<span class="md-ellipsis">
55151-
Solution 1
55151+
Solution 1: Greedy + Sorting
5515255152
</span>
5515355153
</a>
5515455154

@@ -77379,7 +77379,9 @@ <h2 id="description">Description</h2>
7737977379
<h2 id="solutions">Solutions</h2>
7738077380
<!-- solution:start -->
7738177381

77382-
<h3 id="solution-1">Solution 1</h3>
77382+
<h3 id="solution-1-greedy-sorting">Solution 1: Greedy + Sorting</h3>
77383+
<p>The problem requires dividing into subsequences, not subarrays, so the elements in a subsequence can be non-continuous. We can sort the array $\textit{nums}$. Assuming the first element of the current subsequence is $a$, the difference between the maximum and minimum values in the subsequence will not exceed $k$. Therefore, we can iterate through the array $\textit{nums}$. If the difference between the current element $b$ and $a$ is greater than $k$, then update $a$ to $b$ and increase the number of subsequences by 1. After the iteration, we can obtain the minimum number of subsequences, noting that the initial number of subsequences is $1$.</p>
77384+
<p>The time complexity is $O(n \times \log n)$, and the space complexity is $O(\log n)$. Here, $n$ is the length of the array $\textit{nums}$.</p>
7738377385
<div class="tabbed-set tabbed-alternate" data-tabs="1:5"><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" /><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></div>
7738477386
<div class="tabbed-content">
7738577387
<div class="tabbed-block">

en/lc/2295/index.html

Lines changed: 27 additions & 25 deletions
Large diffs are not rendered by default.

en/search/search_index.json

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

0 commit comments

Comments
 (0)