Skip to content

Commit 7dd6263

Browse files
committed
deploy: a742201
1 parent 71005b6 commit 7dd6263

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1627
-320
lines changed

en/lc/1108/index.html

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87115,19 +87115,30 @@ <h2 id="description">Description</h2>
8711587115
<p>A <em>defanged&nbsp;IP address</em>&nbsp;replaces every period <code>&quot;.&quot;</code> with <code>&quot;[.]&quot;</code>.</p>
8711687116

8711787117
<p>&nbsp;</p>
87118+
8711887119
<p><strong class="example">Example 1:</strong></p>
87120+
8711987121
<pre><strong>Input:</strong> address = "1.1.1.1"
87122+
8712087123
<strong>Output:</strong> "1[.]1[.]1[.]1"
87124+
8712187125
</pre>
8712287126
<p><strong class="example">Example 2:</strong></p>
87127+
8712387128
<pre><strong>Input:</strong> address = "255.100.50.0"
87129+
8712487130
<strong>Output:</strong> "255[.]100[.]50[.]0"
87131+
8712587132
</pre>
87133+
8712687134
<p>&nbsp;</p>
87135+
8712787136
<p><strong>Constraints:</strong></p>
8712887137

8712987138
<ul>
87139+
8713087140
<li>The given <code>address</code> is a valid IPv4 address.</li>
87141+
8713187142
</ul>
8713287143

8713387144
<!-- description:end -->
@@ -87233,14 +87244,14 @@ <h3 id="solution-1-direct-replacement">Solution 1: Direct Replacement</h3>
8723387244

8723487245
<nav>
8723587246

87236-
<a href="https://github.com/acbin" class="md-author" title="@acbin">
87247+
<a href="https://github.com/yanglbme" class="md-author" title="@yanglbme">
8723787248

87238-
<img src="https://avatars.githubusercontent.com/u/44314231?v=4&size=72" alt="acbin">
87249+
<img src="https://avatars.githubusercontent.com/u/21008209?v=4&size=72" alt="yanglbme">
8723987250
</a>
8724087251

87241-
<a href="https://github.com/yanglbme" class="md-author" title="@yanglbme">
87252+
<a href="https://github.com/acbin" class="md-author" title="@acbin">
8724287253

87243-
<img src="https://avatars.githubusercontent.com/u/21008209?v=4&size=72" alt="yanglbme">
87254+
<img src="https://avatars.githubusercontent.com/u/44314231?v=4&size=72" alt="acbin">
8724487255
</a>
8724587256

8724687257
<a href="https://github.com/zhaocchen" class="md-author" title="@zhaocchen">

en/lc/1111/index.html

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87119,17 +87119,25 @@ <h2 id="description">Description</h2>
8711987119
<p>A string is a <em>valid parentheses string</em>&nbsp;(denoted VPS) if and only if it consists of <code>&quot;(&quot;</code> and <code>&quot;)&quot;</code> characters only, and:</p>
8712087120

8712187121
<ul>
87122+
8712287123
<li>It is the empty string, or</li>
87124+
8712387125
<li>It can be written as&nbsp;<code>AB</code>&nbsp;(<code>A</code>&nbsp;concatenated with&nbsp;<code>B</code>), where&nbsp;<code>A</code>&nbsp;and&nbsp;<code>B</code>&nbsp;are VPS&#39;s, or</li>
87126+
8712487127
<li>It can be written as&nbsp;<code>(A)</code>, where&nbsp;<code>A</code>&nbsp;is a VPS.</li>
87128+
8712587129
</ul>
8712687130

8712787131
<p>We can&nbsp;similarly define the <em>nesting depth</em> <code>depth(S)</code> of any VPS <code>S</code> as follows:</p>
8712887132

8712987133
<ul>
87134+
8713087135
<li><code>depth(&quot;&quot;) = 0</code></li>
87136+
8713187137
<li><code>depth(A + B) = max(depth(A), depth(B))</code>, where <code>A</code> and <code>B</code> are VPS&#39;s</li>
87138+
8713287139
<li><code>depth(&quot;(&quot; + A + &quot;)&quot;) = 1 + depth(A)</code>, where <code>A</code> is a VPS.</li>
87140+
8713387141
</ul>
8713487142

8713587143
<p>For example,&nbsp; <code>&quot;&quot;</code>,&nbsp;<code>&quot;()()&quot;</code>, and&nbsp;<code>&quot;()(()())&quot;</code>&nbsp;are VPS&#39;s (with nesting depths 0, 1, and 2), and <code>&quot;)(&quot;</code> and <code>&quot;(()&quot;</code> are not VPS&#39;s.</p>
@@ -87352,14 +87360,14 @@ <h3 id="solution-1-greedy">Solution 1: Greedy</h3>
8735287360

8735387361
<nav>
8735487362

87355-
<a href="https://github.com/acbin" class="md-author" title="@acbin">
87363+
<a href="https://github.com/yanglbme" class="md-author" title="@yanglbme">
8735687364

87357-
<img src="https://avatars.githubusercontent.com/u/44314231?v=4&size=72" alt="acbin">
87365+
<img src="https://avatars.githubusercontent.com/u/21008209?v=4&size=72" alt="yanglbme">
8735887366
</a>
8735987367

87360-
<a href="https://github.com/yanglbme" class="md-author" title="@yanglbme">
87368+
<a href="https://github.com/acbin" class="md-author" title="@acbin">
8736187369

87362-
<img src="https://avatars.githubusercontent.com/u/21008209?v=4&size=72" alt="yanglbme">
87370+
<img src="https://avatars.githubusercontent.com/u/44314231?v=4&size=72" alt="acbin">
8736387371
</a>
8736487372

8736587373

en/lc/1138/index.html

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87125,32 +87125,50 @@ <h2 id="description">Description</h2>
8712587125
<p>We may make the following moves:</p>
8712687126

8712787127
<ul>
87128+
8712887129
<li><code>&#39;U&#39;</code> moves our position up one row, if the position exists on the board;</li>
87130+
8712987131
<li><code>&#39;D&#39;</code> moves our position down one row, if the position exists on the board;</li>
87132+
8713087133
<li><code>&#39;L&#39;</code> moves our position left one column, if the position exists on the board;</li>
87134+
8713187135
<li><code>&#39;R&#39;</code> moves our position right one column, if the position exists on the board;</li>
87136+
8713287137
<li><code>&#39;!&#39;</code>&nbsp;adds the character <code>board[r][c]</code> at our current position <code>(r, c)</code>&nbsp;to the&nbsp;answer.</li>
87138+
8713387139
</ul>
8713487140

8713587141
<p>(Here, the only positions that exist on the board are positions with letters on them.)</p>
8713687142

8713787143
<p>Return a sequence of moves that makes our answer equal to <code>target</code>&nbsp;in the minimum number of moves.&nbsp; You may return any path that does so.</p>
8713887144

8713987145
<p>&nbsp;</p>
87146+
8714087147
<p><strong class="example">Example 1:</strong></p>
87148+
8714187149
<pre><strong>Input:</strong> target = "leet"
87150+
8714287151
<strong>Output:</strong> "DDR!UURRR!!DDD!"
87152+
8714387153
</pre>
8714487154
<p><strong class="example">Example 2:</strong></p>
87155+
8714587156
<pre><strong>Input:</strong> target = "code"
87157+
8714687158
<strong>Output:</strong> "RR!DDRR!UUL!R!"
87159+
8714787160
</pre>
87161+
8714887162
<p>&nbsp;</p>
87163+
8714987164
<p><strong>Constraints:</strong></p>
8715087165

8715187166
<ul>
87167+
8715287168
<li><code>1 &lt;= target.length &lt;= 100</code></li>
87169+
8715387170
<li><code>target</code> consists only of English lowercase letters.</li>
87171+
8715487172
</ul>
8715587173

8715687174
<!-- description:end -->
@@ -87412,14 +87430,14 @@ <h3 id="solution-1-simulation">Solution 1: Simulation</h3>
8741287430

8741387431
<nav>
8741487432

87415-
<a href="https://github.com/acbin" class="md-author" title="@acbin">
87433+
<a href="https://github.com/yanglbme" class="md-author" title="@yanglbme">
8741687434

87417-
<img src="https://avatars.githubusercontent.com/u/44314231?v=4&size=72" alt="acbin">
87435+
<img src="https://avatars.githubusercontent.com/u/21008209?v=4&size=72" alt="yanglbme">
8741887436
</a>
8741987437

87420-
<a href="https://github.com/yanglbme" class="md-author" title="@yanglbme">
87438+
<a href="https://github.com/acbin" class="md-author" title="@acbin">
8742187439

87422-
<img src="https://avatars.githubusercontent.com/u/21008209?v=4&size=72" alt="yanglbme">
87440+
<img src="https://avatars.githubusercontent.com/u/44314231?v=4&size=72" alt="acbin">
8742387441
</a>
8742487442

8742587443

en/lc/1139/index.html

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87125,27 +87125,39 @@ <h2 id="description">Description</h2>
8712587125
<p>Given a 2D <code>grid</code> of <code>0</code>s and <code>1</code>s, return the number of elements in&nbsp;the largest <strong>square</strong>&nbsp;subgrid that has all <code>1</code>s on its <strong>border</strong>, or <code>0</code> if such a subgrid&nbsp;doesn&#39;t exist in the <code>grid</code>.</p>
8712687126

8712787127
<p>&nbsp;</p>
87128+
8712887129
<p><strong class="example">Example 1:</strong></p>
8712987130

8713087131
<pre>
87132+
8713187133
<strong>Input:</strong> grid = [[1,1,1],[1,0,1],[1,1,1]]
87134+
8713287135
<strong>Output:</strong> 9
87136+
8713387137
</pre>
8713487138

8713587139
<p><strong class="example">Example 2:</strong></p>
8713687140

8713787141
<pre>
87142+
8713887143
<strong>Input:</strong> grid = [[1,1,0,0]]
87144+
8713987145
<strong>Output:</strong> 1
87146+
8714087147
</pre>
8714187148

8714287149
<p>&nbsp;</p>
87150+
8714387151
<p><strong>Constraints:</strong></p>
8714487152

8714587153
<ul>
87154+
8714687155
<li><code>1 &lt;= grid.length &lt;= 100</code></li>
87156+
8714787157
<li><code>1 &lt;= grid[0].length &lt;= 100</code></li>
87158+
8714887159
<li><code>grid[i][j]</code> is <code>0</code> or <code>1</code></li>
87160+
8714987161
</ul>
8715087162

8715187163
<!-- description:end -->
@@ -87416,14 +87428,14 @@ <h3 id="solution-1-prefix-sum-enumeration">Solution 1: Prefix Sum + Enumeration<
8741687428

8741787429
<nav>
8741887430

87419-
<a href="https://github.com/acbin" class="md-author" title="@acbin">
87431+
<a href="https://github.com/yanglbme" class="md-author" title="@yanglbme">
8742087432

87421-
<img src="https://avatars.githubusercontent.com/u/44314231?v=4&size=72" alt="acbin">
87433+
<img src="https://avatars.githubusercontent.com/u/21008209?v=4&size=72" alt="yanglbme">
8742287434
</a>
8742387435

87424-
<a href="https://github.com/yanglbme" class="md-author" title="@yanglbme">
87436+
<a href="https://github.com/acbin" class="md-author" title="@acbin">
8742587437

87426-
<img src="https://avatars.githubusercontent.com/u/21008209?v=4&size=72" alt="yanglbme">
87438+
<img src="https://avatars.githubusercontent.com/u/44314231?v=4&size=72" alt="acbin">
8742787439
</a>
8742887440

8742987441

en/lc/1184/index.html

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87117,13 +87117,17 @@ <h2 id="description">Description</h2>
8711787117
<p>Return the shortest distance between the given&nbsp;<code>start</code>&nbsp;and <code>destination</code>&nbsp;stops.</p>
8711887118

8711987119
<p>&nbsp;</p>
87120+
8712087121
<p><strong class="example">Example 1:</strong></p>
8712187122

8712287123
<p><a class="glightbox" href="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1100-1199/1184.Distance%20Between%20Bus%20Stops/images/untitled-diagram-1.jpg" data-type="image" data-width="auto" data-height="auto" data-desc-position="bottom"><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1100-1199/1184.Distance%20Between%20Bus%20Stops/images/untitled-diagram-1.jpg" style="width: 388px; height: 240px;" /></a></p>
8712387124

8712487125
<pre>
87126+
8712587127
<strong>Input:</strong> distance = [1,2,3,4], start = 0, destination = 1
87128+
8712687129
<strong>Output:</strong> 1
87130+
8712787131
<strong>Explanation:</strong> Distance between 0 and 1 is 1 or 9, minimum is 1.</pre>
8712887132

8712987133
<p>&nbsp;</p>
@@ -87133,9 +87137,13 @@ <h2 id="description">Description</h2>
8713387137
<p><a class="glightbox" href="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1100-1199/1184.Distance%20Between%20Bus%20Stops/images/untitled-diagram-1-1.jpg" data-type="image" data-width="auto" data-height="auto" data-desc-position="bottom"><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1100-1199/1184.Distance%20Between%20Bus%20Stops/images/untitled-diagram-1-1.jpg" style="width: 388px; height: 240px;" /></a></p>
8713487138

8713587139
<pre>
87140+
8713687141
<strong>Input:</strong> distance = [1,2,3,4], start = 0, destination = 2
87142+
8713787143
<strong>Output:</strong> 3
87144+
8713887145
<strong>Explanation:</strong> Distance between 0 and 2 is 3 or 7, minimum is 3.
87146+
8713987147
</pre>
8714087148

8714187149
<p>&nbsp;</p>
@@ -87145,19 +87153,29 @@ <h2 id="description">Description</h2>
8714587153
<p><a class="glightbox" href="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1100-1199/1184.Distance%20Between%20Bus%20Stops/images/untitled-diagram-1-2.jpg" data-type="image" data-width="auto" data-height="auto" data-desc-position="bottom"><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1100-1199/1184.Distance%20Between%20Bus%20Stops/images/untitled-diagram-1-2.jpg" style="width: 388px; height: 240px;" /></a></p>
8714687154

8714787155
<pre>
87156+
8714887157
<strong>Input:</strong> distance = [1,2,3,4], start = 0, destination = 3
87158+
8714987159
<strong>Output:</strong> 4
87160+
8715087161
<strong>Explanation:</strong> Distance between 0 and 3 is 6 or 4, minimum is 4.
87162+
8715187163
</pre>
8715287164

8715387165
<p>&nbsp;</p>
87166+
8715487167
<p><strong>Constraints:</strong></p>
8715587168

8715687169
<ul>
87170+
8715787171
<li><code>1 &lt;= n&nbsp;&lt;= 10^4</code></li>
87172+
8715887173
<li><code>distance.length == n</code></li>
87174+
8715987175
<li><code>0 &lt;= start, destination &lt; n</code></li>
87176+
8716087177
<li><code>0 &lt;= distance[i] &lt;= 10^4</code></li>
87178+
8716187179
</ul>
8716287180

8716387181
<!-- description:end -->
@@ -87389,14 +87407,14 @@ <h3 id="solution-1-simulation">Solution 1: Simulation</h3>
8738987407

8739087408
<nav>
8739187409

87392-
<a href="https://github.com/acbin" class="md-author" title="@acbin">
87410+
<a href="https://github.com/yanglbme" class="md-author" title="@yanglbme">
8739387411

87394-
<img src="https://avatars.githubusercontent.com/u/44314231?v=4&size=72" alt="acbin">
87412+
<img src="https://avatars.githubusercontent.com/u/21008209?v=4&size=72" alt="yanglbme">
8739587413
</a>
8739687414

87397-
<a href="https://github.com/yanglbme" class="md-author" title="@yanglbme">
87415+
<a href="https://github.com/acbin" class="md-author" title="@acbin">
8739887416

87399-
<img src="https://avatars.githubusercontent.com/u/21008209?v=4&size=72" alt="yanglbme">
87417+
<img src="https://avatars.githubusercontent.com/u/44314231?v=4&size=72" alt="acbin">
8740087418
</a>
8740187419

8740287420
<a href="https://github.com/thinkasany" class="md-author" title="@thinkasany">

en/lc/1238/index.html

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87134,35 +87134,53 @@ <h2 id="description">Description</h2>
8713487134
<p>Given 2 integers <code>n</code> and <code>start</code>. Your task is return <strong>any</strong> permutation <code>p</code>&nbsp;of <code>(0,1,2.....,2^n -1) </code>such that :</p>
8713587135

8713687136
<ul>
87137+
8713787138
<li><code>p[0] = start</code></li>
87139+
8713887140
<li><code>p[i]</code> and <code>p[i+1]</code>&nbsp;differ by only one bit in their binary representation.</li>
87141+
8713987142
<li><code>p[0]</code> and <code>p[2^n -1]</code>&nbsp;must also differ by only one bit in their binary representation.</li>
87143+
8714087144
</ul>
8714187145

8714287146
<p>&nbsp;</p>
87147+
8714387148
<p><strong class="example">Example 1:</strong></p>
8714487149

8714587150
<pre>
87151+
8714687152
<strong>Input:</strong> n = 2, start = 3
87153+
8714787154
<strong>Output:</strong> [3,2,0,1]
87155+
8714887156
<strong>Explanation:</strong> The binary representation of the permutation is (11,10,00,01).
87157+
8714987158
All the adjacent element differ by one bit. Another valid permutation is [3,1,0,2]
87159+
8715087160
</pre>
8715187161

8715287162
<p><strong class="example">Example 2:</strong></p>
8715387163

8715487164
<pre>
87165+
8715587166
<strong>Input:</strong> n = 3, start = 2
87167+
8715687168
<strong>Output:</strong> [2,6,7,5,4,0,1,3]
87169+
8715787170
<strong>Explanation:</strong> The binary representation of the permutation is (010,110,111,101,100,000,001,011).
87171+
8715887172
</pre>
8715987173

8716087174
<p>&nbsp;</p>
87175+
8716187176
<p><strong>Constraints:</strong></p>
8716287177

8716387178
<ul>
87179+
8716487180
<li><code>1 &lt;= n &lt;= 16</code></li>
87181+
8716587182
<li><code>0 &lt;= start&nbsp;&lt;&nbsp;2 ^ n</code></li>
87183+
8716687184
</ul>
8716787185

8716887186
<!-- description:end -->
@@ -87418,14 +87436,14 @@ <h3 id="solution-2-conversion-optimization">Solution 2: Conversion Optimization<
8741887436

8741987437
<nav>
8742087438

87421-
<a href="https://github.com/acbin" class="md-author" title="@acbin">
87439+
<a href="https://github.com/yanglbme" class="md-author" title="@yanglbme">
8742287440

87423-
<img src="https://avatars.githubusercontent.com/u/44314231?v=4&size=72" alt="acbin">
87441+
<img src="https://avatars.githubusercontent.com/u/21008209?v=4&size=72" alt="yanglbme">
8742487442
</a>
8742587443

87426-
<a href="https://github.com/yanglbme" class="md-author" title="@yanglbme">
87444+
<a href="https://github.com/acbin" class="md-author" title="@acbin">
8742787445

87428-
<img src="https://avatars.githubusercontent.com/u/21008209?v=4&size=72" alt="yanglbme">
87446+
<img src="https://avatars.githubusercontent.com/u/44314231?v=4&size=72" alt="acbin">
8742987447
</a>
8743087448

8743187449

0 commit comments

Comments
 (0)