Skip to content

Commit dd9d1b0

Browse files
committed
feat: add solutions to lc problem: No.2464
No.2464.Minimum Subarrays in a Valid Split
1 parent d3cc835 commit dd9d1b0

File tree

38 files changed

+613
-58
lines changed

38 files changed

+613
-58
lines changed

solution/0100-0199/0152.Maximum Product Subarray/README_EN.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44

55
## Description
66

7-
<p>Given an integer array <code>nums</code>, find a contiguous non-empty subarray within the array that has the largest product, and return <em>the product</em>.</p>
7+
<p>Given an integer array <code>nums</code>, find a <span data-keyword="subarray-nonempty">subarray</span> that has the largest product, and return <em>the product</em>.</p>
88

99
<p>The test cases are generated so that the answer will fit in a <strong>32-bit</strong> integer.</p>
1010

11-
<p>A <strong>subarray</strong> is a contiguous subsequence of the array.</p>
12-
1311
<p>&nbsp;</p>
1412
<p><strong class="example">Example 1:</strong></p>
1513

solution/0100-0199/0159.Longest Substring with At Most Two Distinct Characters/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Description
66

7-
<p>Given a string <code>s</code>, return <em>the length of the longest substring that contains at most <strong>two distinct characters</strong></em>.</p>
7+
<p>Given a string <code>s</code>, return <em>the length of the longest </em><span data-keyword="substring-nonempty"><em>substring</em></span><em> that contains at most <strong>two distinct characters</strong></em>.</p>
88

99
<p>&nbsp;</p>
1010
<p><strong class="example">Example 1:</strong></p>

solution/0100-0199/0192.Word Frequency/README_EN.md

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,39 @@
44

55
## Description
66

7-
<p>Write a bash script to calculate the frequency of each word in a text file <code>words.txt</code>.</p>
7+
<p>Write a bash script to calculate the <span data-keyword="frequency-textfile">frequency</span> of each word in a text file <code>words.txt</code>.</p>
88

99
<p>For simplicity sake, you may assume:</p>
1010

1111
<ul>
12-
<li><code>words.txt</code> contains only lowercase characters and space <code>&#39; &#39;</code> characters.</li>
13-
<li>Each word must consist of lowercase characters only.</li>
14-
<li>Words are separated by one or more whitespace characters.</li>
12+
<li><code>words.txt</code> contains only lowercase characters and space <code>&#39; &#39;</code> characters.</li>
13+
<li>Each word must consist of lowercase characters only.</li>
14+
<li>Words are separated by one or more whitespace characters.</li>
1515
</ul>
1616

1717
<p><strong class="example">Example:</strong></p>
1818

1919
<p>Assume that <code>words.txt</code> has the following content:</p>
2020

2121
<pre>
22-
2322
the day is sunny the the
24-
2523
the sunny is is
26-
2724
</pre>
2825

2926
<p>Your script should output the following, sorted by descending frequency:</p>
3027

3128
<pre>
32-
3329
the 4
34-
3530
is 3
36-
3731
sunny 2
38-
3932
day 1
40-
4133
</pre>
4234

4335
<p><b>Note:</b></p>
4436

4537
<ul>
46-
<li>Don&#39;t worry about handling ties, it is guaranteed that each word&#39;s frequency count is unique.</li>
47-
<li>Could you write it in one-line using <a href="http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-4.html">Unix pipes</a>?</li>
38+
<li>Don&#39;t worry about handling ties, it is guaranteed that each word&#39;s frequency count is unique.</li>
39+
<li>Could you write it in one-line using <a href="http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-4.html">Unix pipes</a>?</li>
4840
</ul>
4941

5042
## Solutions

solution/0200-0299/0209.Minimum Size Subarray Sum/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Description
66

7-
<p>Given an array of positive integers <code>nums</code> and a positive integer <code>target</code>, return the minimal length of a <strong>contiguous subarray</strong> <code>[nums<sub>l</sub>, nums<sub>l+1</sub>, ..., nums<sub>r-1</sub>, nums<sub>r</sub>]</code> of which the sum is greater than or equal to <code>target</code>. If there is no such subarray, return <code>0</code> instead.</p>
7+
<p>Given an array of positive integers <code>nums</code> and a positive integer <code>target</code>, return <em>the <strong>minimal length</strong> of a </em><span data-keyword="subarray-nonempty"><em>subarray</em></span><em> whose sum is greater than or equal to</em> <code>target</code>. If there is no such subarray, return <code>0</code> instead.</p>
88

99
<p>&nbsp;</p>
1010
<p><strong class="example">Example 1:</strong></p>

solution/0200-0299/0214.Shortest Palindrome/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Description
66

7-
<p>You are given a string <code>s</code>. You can convert <code>s</code> to a palindrome by adding characters in front of it.</p>
7+
<p>You are given a string <code>s</code>. You can convert <code>s</code> to a <span data-keyword="palindrome-string">palindrome</span> by adding characters in front of it.</p>
88

99
<p>Return <em>the shortest palindrome you can find by performing this transformation</em>.</p>
1010

solution/0200-0299/0234.Palindrome Linked List/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Description
66

7-
<p>Given the <code>head</code> of a singly linked list, return <code>true</code><em> if it is a palindrome or </em><code>false</code><em> otherwise</em>.</p>
7+
<p>Given the <code>head</code> of a singly linked list, return <code>true</code><em> if it is a </em><span data-keyword="palindrome-sequence"><em>palindrome</em></span><em> or </em><code>false</code><em> otherwise</em>.</p>
88

99
<p>&nbsp;</p>
1010
<p><strong class="example">Example 1:</strong></p>

solution/0200-0299/0250.Count Univalue Subtrees/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Description
66

7-
<p>Given the <code>root</code> of a binary tree, return the number of <strong>uni-value</strong> subtrees.</p>
7+
<p>Given the <code>root</code> of a binary tree, return <em>the number of <strong>uni-value</strong> </em><span data-keyword="subtree"><em>subtrees</em></span>.</p>
88

99
<p>A <strong>uni-value subtree</strong> means all nodes of the subtree have the same value.</p>
1010

solution/0200-0299/0266.Palindrome Permutation/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Description
66

7-
<p>Given a string <code>s</code>, return <code>true</code> if a permutation of the string could form a palindrome.</p>
7+
<p>Given a string <code>s</code>, return <code>true</code> <em>if a permutation of the string could form a </em><span data-keyword="palindrome-string"><em><strong>palindrome</strong></em></span><em> and </em><code>false</code><em> otherwise</em>.</p>
88

99
<p>&nbsp;</p>
1010
<p><strong class="example">Example 1:</strong></p>

solution/0200-0299/0269.Alien Dictionary/README_EN.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66

77
<p>There is a new alien language that uses the English alphabet. However, the order among the letters is unknown to you.</p>
88

9-
<p>You are given a list of strings <code>words</code> from the alien language&#39;s dictionary, where the strings in <code>words</code> are <strong>sorted lexicographically</strong> by the rules of this new language.</p>
9+
<p>You are given a list of strings <code>words</code> from the alien language&#39;s dictionary, where the strings in <code>words</code> are <span data-keyword="lexicographically-smaller-string-alien"><strong>sorted lexicographically</strong></span> by the rules of this new language.</p>
1010

11-
<p>Return <em>a string of the unique letters in the new alien language sorted in <strong>lexicographically increasing order</strong> by the new language&#39;s rules. If there is no solution, return </em><code>&quot;&quot;</code><em>. If there are multiple solutions, return <strong>any of them</strong></em>.</p>
12-
13-
<p>A string <code>s</code> is <strong>lexicographically smaller</strong> than a string <code>t</code> if at the first letter where they differ, the letter in <code>s</code> comes before the letter in <code>t</code> in the alien language. If the first <code>min(s.length, t.length)</code> letters are the same, then <code>s</code> is smaller if and only if <code>s.length &lt; t.length</code>.</p>
11+
<p>Return <em>a string of the unique letters in the new alien language sorted in <strong>lexicographically increasing order</strong> by the new language&#39;s rules. </em>If there is no solution, return <code>&quot;&quot;</code><em>. </em>If there are multiple solutions, return<em> <strong>any of them</strong></em>.</p>
1412

1513
<p>&nbsp;</p>
1614
<p><strong class="example">Example 1:</strong></p>

solution/0300-0399/0300.Longest Increasing Subsequence/README_EN.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
## Description
66

7-
<p>Given an integer array <code>nums</code>, return the length of the longest strictly increasing subsequence.</p>
8-
9-
<p>A <strong>subsequence</strong> is a sequence that can be derived from an array by deleting some or no elements without changing the order of the remaining elements. For example, <code>[3,6,2,7]</code> is a subsequence of the array <code>[0,3,1,6,2,2,7]</code>.</p>
7+
<p>Given an integer array <code>nums</code>, return <em>the length of the longest <strong>strictly increasing </strong></em><span data-keyword="subsequence-array"><em><strong>subsequence</strong></em></span>.</p>
108

119
<p>&nbsp;</p>
1210
<p><strong class="example">Example 1:</strong></p>

0 commit comments

Comments
 (0)