Skip to content

Commit c496442

Browse files
committed
deploy: 1dd28cb
1 parent a79a990 commit c496442

File tree

11 files changed

+7991
-7179
lines changed

11 files changed

+7991
-7179
lines changed

contest/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81974,9 +81974,9 @@
8197481974
</li>
8197581975

8197681976
<li class="md-nav__item">
81977-
<a href="#128-2024-04-13-2230-90-2653" class="md-nav__link">
81977+
<a href="#128-2024-04-13-2230-90-2654" class="md-nav__link">
8197881978
<span class="md-ellipsis">
81979-
第 128 场双周赛(2024-04-13 22:30, 90 分钟) 参赛人数 2653
81979+
第 128 场双周赛(2024-04-13 22:30, 90 分钟) 参赛人数 2654
8198081980
</span>
8198181981
</a>
8198281982

@@ -86125,7 +86125,7 @@ <h4 id="393-2024-04-14-1030-90-4219">第 393 场周赛(2024-04-14 10:30, 90 分
8612586125
<li><a href="../lc/3116/">3116. 单面值组合的第 K 小金额</a></li>
8612686126
<li><a href="../lc/3117/">3117. 划分数组得到最小的值之和</a></li>
8612786127
</ul>
86128-
<h4 id="128-2024-04-13-2230-90-2653">第 128 场双周赛(2024-04-13 22:30, 90 分钟) 参赛人数 2653</h4>
86128+
<h4 id="128-2024-04-13-2230-90-2654">第 128 场双周赛(2024-04-13 22:30, 90 分钟) 参赛人数 2654</h4>
8612986129
<ul>
8613086130
<li><a href="../lc/3110/">3110. 字符串的分数</a></li>
8613186131
<li><a href="../lc/3111/">3111. 覆盖所有点的最少矩形数目</a></li>

en/lc/721/index.html

Lines changed: 486 additions & 94 deletions
Large diffs are not rendered by default.

en/lc/91/index.html

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -77269,52 +77269,66 @@ <h1 id="91-decode-ways"><a href="https://leetcode.com/problems/decode-ways">91.
7726977269
<h2 id="description">Description</h2>
7727077270
<!-- description:start -->
7727177271

77272-
<p>A message containing letters from <code>A-Z</code> can be <strong>encoded</strong> into numbers using the following mapping:</p>
77272+
<p>You have intercepted a secret message encoded as a string of numbers. The message is <strong>decoded</strong> via the following mapping:</p>
7727377273

77274-
<pre>
77275-
&#39;A&#39; -&gt; &quot;1&quot;
77276-
&#39;B&#39; -&gt; &quot;2&quot;
77277-
...
77278-
&#39;Z&#39; -&gt; &quot;26&quot;
77279-
</pre>
77274+
<p><code>&quot;1&quot; -&gt; &#39;A&#39;<br />
77275+
&quot;2&quot; -&gt; &#39;B&#39;<br />
77276+
...<br />
77277+
&quot;25&quot; -&gt; &#39;Y&#39;<br />
77278+
&quot;26&quot; -&gt; &#39;Z&#39;</code></p>
7728077279

77281-
<p>To <strong>decode</strong> an encoded message, all the digits must be grouped then mapped back into letters using the reverse of the mapping above (there may be multiple ways). For example, <code>&quot;11106&quot;</code> can be mapped into:</p>
77280+
<p>However, while decoding the message, you realize that there are many different ways you can decode the message because some codes are contained in other codes (<code>&quot;2&quot;</code> and <code>&quot;5&quot;</code> vs <code>&quot;25&quot;</code>).</p>
77281+
77282+
<p>For example, <code>&quot;11106&quot;</code> can be decoded into:</p>
7728277283

7728377284
<ul>
77284-
<li><code>&quot;AAJF&quot;</code> with the grouping <code>(1 1 10 6)</code></li>
77285-
<li><code>&quot;KJF&quot;</code> with the grouping <code>(11 10 6)</code></li>
77285+
<li><code>&quot;AAJF&quot;</code> with the grouping <code>(1, 1, 10, 6)</code></li>
77286+
<li><code>&quot;KJF&quot;</code> with the grouping <code>(11, 10, 6)</code></li>
77287+
<li>The grouping <code>(1, 11, 06)</code> is invalid because <code>&quot;06&quot;</code> is not a valid code (only <code>&quot;6&quot;</code> is valid).</li>
7728677288
</ul>
7728777289

77288-
<p>Note that the grouping <code>(1 11 06)</code> is invalid because <code>&quot;06&quot;</code> cannot be mapped into <code>&#39;F&#39;</code> since <code>&quot;6&quot;</code> is different from <code>&quot;06&quot;</code>.</p>
77289-
77290-
<p>Given a string <code>s</code> containing only digits, return <em>the <strong>number</strong> of ways to <strong>decode</strong> it</em>.</p>
77290+
<p>Note: there may be strings that are impossible to decode.<br />
77291+
<br />
77292+
Given a string s containing only digits, return the <strong>number of ways</strong> to <strong>decode</strong> it. If the entire string cannot be decoded in any valid way, return <code>0</code>.</p>
7729177293

7729277294
<p>The test cases are generated so that the answer fits in a <strong>32-bit</strong> integer.</p>
7729377295

7729477296
<p>&nbsp;</p>
7729577297
<p><strong class="example">Example 1:</strong></p>
7729677298

77297-
<pre>
77298-
<strong>Input:</strong> s = &quot;12&quot;
77299-
<strong>Output:</strong> 2
77300-
<strong>Explanation:</strong> &quot;12&quot; could be decoded as &quot;AB&quot; (1 2) or &quot;L&quot; (12).
77301-
</pre>
77299+
<div class="example-block">
77300+
<p><strong>Input:</strong> <span class="example-io">s = &quot;12&quot;</span></p>
77301+
77302+
<p><strong>Output:</strong> <span class="example-io">2</span></p>
77303+
77304+
<p><strong>Explanation:</strong></p>
77305+
77306+
<p>&quot;12&quot; could be decoded as &quot;AB&quot; (1 2) or &quot;L&quot; (12).</p>
77307+
</div>
7730277308

7730377309
<p><strong class="example">Example 2:</strong></p>
7730477310

77305-
<pre>
77306-
<strong>Input:</strong> s = &quot;226&quot;
77307-
<strong>Output:</strong> 3
77308-
<strong>Explanation:</strong> &quot;226&quot; could be decoded as &quot;BZ&quot; (2 26), &quot;VF&quot; (22 6), or &quot;BBF&quot; (2 2 6).
77309-
</pre>
77311+
<div class="example-block">
77312+
<p><strong>Input:</strong> <span class="example-io">s = &quot;226&quot;</span></p>
77313+
77314+
<p><strong>Output:</strong> <span class="example-io">3</span></p>
77315+
77316+
<p><strong>Explanation:</strong></p>
77317+
77318+
<p>&quot;226&quot; could be decoded as &quot;BZ&quot; (2 26), &quot;VF&quot; (22 6), or &quot;BBF&quot; (2 2 6).</p>
77319+
</div>
7731077320

7731177321
<p><strong class="example">Example 3:</strong></p>
7731277322

77313-
<pre>
77314-
<strong>Input:</strong> s = &quot;06&quot;
77315-
<strong>Output:</strong> 0
77316-
<strong>Explanation:</strong> &quot;06&quot; cannot be mapped to &quot;F&quot; because of the leading zero (&quot;6&quot; is different from &quot;06&quot;).
77317-
</pre>
77323+
<div class="example-block">
77324+
<p><strong>Input:</strong> <span class="example-io">s = &quot;06&quot;</span></p>
77325+
77326+
<p><strong>Output:</strong> <span class="example-io">0</span></p>
77327+
77328+
<p><strong>Explanation:</strong></p>
77329+
77330+
<p>&quot;06&quot; cannot be mapped to &quot;F&quot; because of the leading zero (&quot;6&quot; is different from &quot;06&quot;). In this case, the string is not a valid encoding, so return 0.</p>
77331+
</div>
7731877332

7731977333
<p>&nbsp;</p>
7732077334
<p><strong>Constraints:</strong></p>

en/lc/999/index.html

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -77275,36 +77275,50 @@ <h1 id="999-available-captures-for-rook"><a href="https://leetcode.com/problems/
7727577275
<h2 id="description">Description</h2>
7727677276
<!-- description:start -->
7727777277

77278-
<p>On an <code>8 x 8</code> chessboard, there is <strong>exactly one</strong> white rook <code>&#39;R&#39;</code> and some number of white bishops <code>&#39;B&#39;</code>, black pawns <code>&#39;p&#39;</code>, and empty squares <code>&#39;.&#39;</code>.</p>
77278+
<p>You are given an <code>8 x 8</code> <strong>matrix</strong> representing a chessboard. There is <strong>exactly one</strong> white rook represented by <code>&#39;R&#39;</code>, some number of white bishops <code>&#39;B&#39;</code>, and some number of black pawns <code>&#39;p&#39;</code>. Empty squares are represented by <code>&#39;.&#39;</code>.</p>
7727977279

77280-
<p>When the rook moves, it chooses one of four cardinal directions (north, east, south, or west), then moves in that direction until it chooses to stop, reaches the edge of the board, captures a black pawn, or is blocked by a white bishop. A rook is considered <strong>attacking</strong> a pawn if the rook can capture the pawn on the rook&#39;s turn. The <strong>number of available captures</strong> for the white rook is the number of pawns that the rook is <strong>attacking</strong>.</p>
77280+
<p>A rook can move any number of squares horizontally or vertically (up, down, left, right) until it reaches another piece <em>or</em> the edge of the board. A rook is <strong>attacking</strong> a pawn if it can move to the pawn&#39;s square in one move.</p>
7728177281

77282-
<p>Return <em>the <strong>number of available captures</strong> for the white rook</em>.</p>
77282+
<p>Note: A rook cannot move through other pieces, such as bishops or pawns. This means a rook cannot attack a pawn if there is another piece blocking the path.</p>
77283+
77284+
<p>Return the <strong>number of pawns</strong> the white rook is <strong>attacking</strong>.</p>
7728377285

7728477286
<p>&nbsp;</p>
7728577287
<p><strong class="example">Example 1:</strong></p>
7728677288
<p><a class="glightbox" href="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0900-0999/0999.Available%20Captures%20for%20Rook/images/1253_example_1_improved.png" 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/0900-0999/0999.Available%20Captures%20for%20Rook/images/1253_example_1_improved.png" style="width: 300px; height: 305px;" /></a></p>
77287-
<pre>
77288-
<strong>Input:</strong> board = [[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;R&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;p&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;]]
77289-
<strong>Output:</strong> 3
77290-
<strong>Explanation:</strong> In this example, the rook is attacking all the pawns.
77291-
</pre>
77289+
<div class="example-block">
77290+
<p><strong>Input:</strong> <span class="example-io">board = [[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;R&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;p&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;]]</span></p>
77291+
77292+
<p><strong>Output:</strong> <span class="example-io">3</span></p>
77293+
77294+
<p><strong>Explanation:</strong></p>
77295+
77296+
<p>In this example, the rook is attacking all the pawns.</p>
77297+
</div>
7729277298

7729377299
<p><strong class="example">Example 2:</strong></p>
7729477300
<p><a class="glightbox" href="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0900-0999/0999.Available%20Captures%20for%20Rook/images/1253_example_2_improved.png" 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/0900-0999/0999.Available%20Captures%20for%20Rook/images/1253_example_2_improved.png" style="width: 300px; height: 306px;" /></a></p>
77295-
<pre>
77296-
<strong>Input:</strong> board = [[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;p&quot;,&quot;p&quot;,&quot;p&quot;,&quot;p&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;p&quot;,&quot;p&quot;,&quot;B&quot;,&quot;p&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;p&quot;,&quot;B&quot;,&quot;R&quot;,&quot;B&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;p&quot;,&quot;p&quot;,&quot;B&quot;,&quot;p&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;p&quot;,&quot;p&quot;,&quot;p&quot;,&quot;p&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;]]
77297-
<strong>Output:</strong> 0
77298-
<strong>Explanation:</strong> The bishops are blocking the rook from attacking any of the pawns.
77299-
</pre>
77301+
<div class="example-block">
77302+
<p><strong>Input:</strong> <span class="example-io">board = [[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;p&quot;,&quot;p&quot;,&quot;p&quot;,&quot;p&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;p&quot;,&quot;p&quot;,&quot;B&quot;,&quot;p&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;p&quot;,&quot;B&quot;,&quot;R&quot;,&quot;B&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;p&quot;,&quot;p&quot;,&quot;B&quot;,&quot;p&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;p&quot;,&quot;p&quot;,&quot;p&quot;,&quot;p&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;]]</span></p>
77303+
77304+
<p><strong>Output:</strong> <span class="example-io">0</span></p>
77305+
77306+
<p><strong>Explanation:</strong></p>
77307+
77308+
<p>The bishops are blocking the rook from attacking any of the pawns.</p>
77309+
</div>
7730077310

7730177311
<p><strong class="example">Example 3:</strong></p>
7730277312
<p><a class="glightbox" href="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0900-0999/0999.Available%20Captures%20for%20Rook/images/1253_example_3_improved.png" 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/0900-0999/0999.Available%20Captures%20for%20Rook/images/1253_example_3_improved.png" style="width: 300px; height: 305px;" /></a></p>
77303-
<pre>
77304-
<strong>Input:</strong> board = [[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;p&quot;,&quot;p&quot;,&quot;.&quot;,&quot;R&quot;,&quot;.&quot;,&quot;p&quot;,&quot;B&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;B&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;]]
77305-
<strong>Output:</strong> 3
77306-
<strong>Explanation:</strong> The rook is attacking the pawns at positions b5, d6, and f5.
77307-
</pre>
77313+
<div class="example-block">
77314+
<p><strong>Input:</strong> <span class="example-io">board = [[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;p&quot;,&quot;p&quot;,&quot;.&quot;,&quot;R&quot;,&quot;.&quot;,&quot;p&quot;,&quot;B&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;B&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;]]</span></p>
77315+
77316+
<p><strong>Output:</strong> <span class="example-io">3</span></p>
77317+
77318+
<p><strong>Explanation:</strong></p>
77319+
77320+
<p>The rook is attacking the pawns at positions b5, d6, and f5.</p>
77321+
</div>
7730877322

7730977323
<p>&nbsp;</p>
7731077324
<p><strong>Constraints:</strong></p>

en/search/search_index.json

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

0 commit comments

Comments
 (0)