You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-3Lines changed: 14 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,17 @@ LeetCode Problems' Solutions
54
54
55
55
| # | Title | Solution | Difficulty |
56
56
| :-: | - | - | :-: |
57
+
| <spanid="1147">1147</span> |[Longest Chunked Palindrome Decomposition](https://leetcode.com/problems/longest-chunked-palindrome-decomposition"段式回文")|[Go](https://github.com/openset/leetcode/tree/master/problems/longest-chunked-palindrome-decomposition)| Hard |
58
+
| <spanid="1146">1146</span> |[Snapshot Array](https://leetcode.com/problems/snapshot-array"快照数组")|[Go](https://github.com/openset/leetcode/tree/master/problems/snapshot-array)| Medium |
59
+
| <spanid="1145">1145</span> |[Binary Tree Coloring Game](https://leetcode.com/problems/binary-tree-coloring-game"二叉树着色游戏")|[Go](https://github.com/openset/leetcode/tree/master/problems/binary-tree-coloring-game)| Medium |
60
+
| <spanid="1144">1144</span> |[Decrease Elements To Make Array Zigzag](https://leetcode.com/problems/decrease-elements-to-make-array-zigzag"递减元素使数组呈锯齿状")|[Go](https://github.com/openset/leetcode/tree/master/problems/decrease-elements-to-make-array-zigzag)| Medium |
61
+
| <spanid="1143">1143</span> |[Longest Common Subsequence](https://leetcode.com/problems/longest-common-subsequence)|[Go](https://github.com/openset/leetcode/tree/master/problems/longest-common-subsequence)| Medium |
62
+
| <spanid="1142">1142</span> |[User Activity for the Past 30 Days II](https://leetcode.com/problems/user-activity-for-the-past-30-days-ii) 🔒 |[MySQL](https://github.com/openset/leetcode/tree/master/problems/user-activity-for-the-past-30-days-ii)| Easy |
63
+
| <spanid="1141">1141</span> |[User Activity for the Past 30 Days I](https://leetcode.com/problems/user-activity-for-the-past-30-days-i) 🔒 |[MySQL](https://github.com/openset/leetcode/tree/master/problems/user-activity-for-the-past-30-days-i)| Easy |
64
+
| <spanid="1140">1140</span> |[Stone Game II](https://leetcode.com/problems/stone-game-ii"石子游戏 II")|[Go](https://github.com/openset/leetcode/tree/master/problems/stone-game-ii)| Medium |
65
+
| <spanid="1139">1139</span> |[Largest 1-Bordered Square](https://leetcode.com/problems/largest-1-bordered-square"最大的以 1 为边界的正方形")|[Go](https://github.com/openset/leetcode/tree/master/problems/largest-1-bordered-square)| Medium |
66
+
| <spanid="1138">1138</span> |[Alphabet Board Path](https://leetcode.com/problems/alphabet-board-path"字母板上的路径")|[Go](https://github.com/openset/leetcode/tree/master/problems/alphabet-board-path)| Medium |
67
+
| <spanid="1137">1137</span> |[N-th Tribonacci Number](https://leetcode.com/problems/n-th-tribonacci-number"第 N 个泰波那契数")|[Go](https://github.com/openset/leetcode/tree/master/problems/n-th-tribonacci-number)| Easy |
57
68
| <spanid="1136">1136</span> |[Parallel Courses](https://leetcode.com/problems/parallel-courses"平行课程") 🔒 |[Go](https://github.com/openset/leetcode/tree/master/problems/parallel-courses)| Hard |
58
69
| <spanid="1135">1135</span> |[Connecting Cities With Minimum Cost](https://leetcode.com/problems/connecting-cities-with-minimum-cost"最低成本联通所有城市") 🔒 |[Go](https://github.com/openset/leetcode/tree/master/problems/connecting-cities-with-minimum-cost)| Medium |
| <spanid="1120">1120</span> |[Maximum Average Subtree](https://leetcode.com/problems/maximum-average-subtree"子树的最大平均值") 🔒 |[Go](https://github.com/openset/leetcode/tree/master/problems/maximum-average-subtree)| Medium |
74
85
| <spanid="1119">1119</span> |[Remove Vowels from a String](https://leetcode.com/problems/remove-vowels-from-a-string"删去字符串中的元音") 🔒 |[Go](https://github.com/openset/leetcode/tree/master/problems/remove-vowels-from-a-string)| Easy |
75
86
| <spanid="1118">1118</span> |[Number of Days in a Month](https://leetcode.com/problems/number-of-days-in-a-month"一月有多少天") 🔒 |[Go](https://github.com/openset/leetcode/tree/master/problems/number-of-days-in-a-month)| Easy |
| <spanid="1116">1116</span> |[Print Zero Even Odd](https://leetcode.com/problems/print-zero-even-odd"打印零与奇偶数")|[Go](https://github.com/openset/leetcode/tree/master/problems/print-zero-even-odd)| Medium |
78
89
| <spanid="1115">1115</span> |[Print FooBar Alternately](https://leetcode.com/problems/print-foobar-alternately"交替打印FooBar")|[Go](https://github.com/openset/leetcode/tree/master/problems/print-foobar-alternately)| Medium |
79
90
| <spanid="1114">1114</span> |[Print in Order](https://leetcode.com/problems/print-in-order"按序打印")|[Go](https://github.com/openset/leetcode/tree/master/problems/print-in-order)| Easy |
@@ -149,7 +160,7 @@ LeetCode Problems' Solutions
149
160
| <spanid="1044">1044</span> |[Longest Duplicate Substring](https://leetcode.com/problems/longest-duplicate-substring"最长重复子串")|[Go](https://github.com/openset/leetcode/tree/master/problems/longest-duplicate-substring)| Hard |
150
161
| <spanid="1043">1043</span> |[Partition Array for Maximum Sum](https://leetcode.com/problems/partition-array-for-maximum-sum"分隔数组以得到最大和")|[Go](https://github.com/openset/leetcode/tree/master/problems/partition-array-for-maximum-sum)| Medium |
151
162
| <spanid="1042">1042</span> |[Flower Planting With No Adjacent](https://leetcode.com/problems/flower-planting-with-no-adjacent"不邻接植花")|[Go](https://github.com/openset/leetcode/tree/master/problems/flower-planting-with-no-adjacent)| Easy |
152
-
| <spanid="1041">1041</span> |[Robot Bounded In Circle](https://leetcode.com/problems/robot-bounded-in-circle"困于环中的机器人")|[Go](https://github.com/openset/leetcode/tree/master/problems/robot-bounded-in-circle)|Easy|
163
+
| <spanid="1041">1041</span> |[Robot Bounded In Circle](https://leetcode.com/problems/robot-bounded-in-circle"困于环中的机器人")|[Go](https://github.com/openset/leetcode/tree/master/problems/robot-bounded-in-circle)|Medium|
153
164
| <spanid="1040">1040</span> |[Moving Stones Until Consecutive II](https://leetcode.com/problems/moving-stones-until-consecutive-ii"移动石子直到连续 II")|[Go](https://github.com/openset/leetcode/tree/master/problems/moving-stones-until-consecutive-ii)| Medium |
154
165
| <spanid="1039">1039</span> |[Minimum Score Triangulation of Polygon](https://leetcode.com/problems/minimum-score-triangulation-of-polygon"多边形三角剖分的最低得分")|[Go](https://github.com/openset/leetcode/tree/master/problems/minimum-score-triangulation-of-polygon)| Medium |
155
166
| <spanid="1038">1038</span> |[Binary Search Tree to Greater Sum Tree](https://leetcode.com/problems/binary-search-tree-to-greater-sum-tree"从二叉搜索树到更大和树")|[Go](https://github.com/openset/leetcode/tree/master/problems/binary-search-tree-to-greater-sum-tree)| Medium |
@@ -558,7 +569,7 @@ LeetCode Problems' Solutions
558
569
| <spanid="635">635</span> |[Design Log Storage System](https://leetcode.com/problems/design-log-storage-system"设计日志存储系统") 🔒 |[Go](https://github.com/openset/leetcode/tree/master/problems/design-log-storage-system)| Medium |
559
570
| <spanid="634">634</span> |[Find the Derangement of An Array](https://leetcode.com/problems/find-the-derangement-of-an-array"寻找数组的错位排列") 🔒 |[Go](https://github.com/openset/leetcode/tree/master/problems/find-the-derangement-of-an-array)| Medium |
560
571
| <spanid="633">633</span> |[Sum of Square Numbers](https://leetcode.com/problems/sum-of-square-numbers"平方数之和")|[Go](https://github.com/openset/leetcode/tree/master/problems/sum-of-square-numbers)| Easy |
561
-
| <spanid="632">632</span> |[Smallest Range](https://leetcode.com/problems/smallest-range"最小区间")|[Go](https://github.com/openset/leetcode/tree/master/problems/smallest-range)| Hard |
572
+
| <spanid="632">632</span> |[Smallest Range Covering Elements from K Lists](https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists"最小区间")|[Go](https://github.com/openset/leetcode/tree/master/problems/smallest-range-covering-elements-from-k-lists)| Hard |
562
573
| <spanid="631">631</span> |[Design Excel Sum Formula](https://leetcode.com/problems/design-excel-sum-formula"设计 Excel 求和公式") 🔒 |[Go](https://github.com/openset/leetcode/tree/master/problems/design-excel-sum-formula)| Hard |
563
574
| <spanid="630">630</span> |[Course Schedule III](https://leetcode.com/problems/course-schedule-iii"课程表 III")|[Go](https://github.com/openset/leetcode/tree/master/problems/course-schedule-iii)| Hard |
564
575
| <spanid="629">629</span> |[K Inverse Pairs Array](https://leetcode.com/problems/k-inverse-pairs-array"K个逆序对数组")|[Go](https://github.com/openset/leetcode/tree/master/problems/k-inverse-pairs-array)| Hard |
<p>On an alphabet board, we start at position <code>(0, 0)</code>, corresponding to character <code>board[0][0]</code>.</p>
15
+
16
+
<p>Here, <code>board = ["abcde", "fghij", "klmno", "pqrst", "uvwxy", "z"]</code>, as shown in the diagram below.</p>
<li><code>'U'</code> moves our position up one row, if the position exists on the board;</li>
24
+
<li><code>'D'</code> moves our position down one row, if the position exists on the board;</li>
25
+
<li><code>'L'</code> moves our position left one column, if the position exists on the board;</li>
26
+
<li><code>'R'</code> moves our position right one column, if the position exists on the board;</li>
27
+
<li><code>'!'</code> adds the character <code>board[r][c]</code> at our current position <code>(r, c)</code> to the answer.</li>
28
+
</ul>
29
+
30
+
<p>(Here, the only positions that exist on the board are positions with letters on them.)</p>
31
+
32
+
<p>Return a sequence of moves that makes our answer equal to <code>target</code> in the minimum number of moves. You may return any path that does so.</p>
<p>Two players play a turn based game on a binary tree. We are given the <code>root</code> of this binary tree, and the number of nodes <code>n</code> in the tree. <code>n</code> is odd, and each node has a distinct value from <code>1</code> to <code>n</code>.</p>
15
+
16
+
<p>Initially, the first player names a value <code>x</code> with <code>1 <= x <= n</code>, and the second player names a value <code>y</code> with <code>1 <= y <= n</code> and <code>y != x</code>. The first player colors the node with value <code>x</code> red, and the second player colors the node with value <code>y</code> blue.</p>
17
+
18
+
<p>Then, the players take turns starting with the first player. In each turn, that player chooses a node of their color (red if player 1, blue if player 2) and colors an <strong>uncolored</strong> neighbor of the chosen node (either the left child, right child, or parent of the chosen node.)</p>
19
+
20
+
<p>If (and only if) a player cannot choose such a node in this way, they must pass their turn. If both players pass their turn, the game ends, and the winner is the player that colored more nodes.</p>
21
+
22
+
<p>You are the second player. If it is possible to choose such a <code>y</code> to ensure you win the game, return <code>true</code>. If it is not possible, return <code>false</code>.</p>
[Next >](https://github.com/openset/leetcode/tree/master/problems/smallest-range-covering-elements-from-k-lists"Smallest Range Covering Elements from K Lists")
[Next >](https://github.com/openset/leetcode/tree/master/problems/stone-game-ii"Stone Game II")
11
+
12
+
## 1139. Largest 1-Bordered Square (Medium)
13
+
14
+
<p>Given a 2D <code>grid</code> of <code>0</code>s and <code>1</code>s, return the number of elements in the largest <strong>square</strong> subgrid that has all <code>1</code>s on its <strong>border</strong>, or <code>0</code> if such a subgrid doesn't exist in the <code>grid</code>.</p>
0 commit comments