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: solution/0000-0099/0098.Validate Binary Search Tree/README_EN.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,8 +24,8 @@ tags:
24
24
<p>A <strong>valid BST</strong> is defined as follows:</p>
25
25
26
26
<ul>
27
-
<li>The left <span data-keyword="subtree">subtree</span> of a node contains only nodes with keys<strong>less than</strong> the node's key.</li>
28
-
<li>The right subtree of a node contains only nodes with keys <strong>greater than</strong> the node's key.</li>
27
+
<li>The left <span data-keyword="subtree">subtree</span> of a node contains only nodes with keys <strong>strictly less than</strong> the node's key.</li>
28
+
<li>The right subtree of a node contains only nodes with keys <strong>strictly greater than</strong> the node's key.</li>
29
29
<li>Both the left and right subtrees must also be binary search trees.</li>
Copy file name to clipboardExpand all lines: solution/0100-0199/0118.Pascal's Triangle/README_EN.md
+39-24Lines changed: 39 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,9 +44,9 @@ tags:
44
44
45
45
### Solution 1: Simulation
46
46
47
-
First, we create an answer array $f$, and then set the first row of $f$ to $[1]$. Next, starting from the second row, the first and last elements of each row are $1$, and the other elements are calculated by $f[i][j] = f[i - 1][j - 1] + f[i - 1][j]$.
47
+
We first create an answer array $f$, then set the first row of $f$ to $[1]$. Next, starting from the second row, the first and last elements of each row are $1$, and for other elements $f[i][j] = f[i - 1][j - 1] + f[i - 1][j]$.
48
48
49
-
The time complexity is $O(n^2)$, and the space complexity is $O(n^2)$. Here, $n$ is the number of rows.
49
+
The time complexity is $O(n^2)$, where $n$ is the given number of rows. Ignoring the space consumption of the answer, the space complexity is $O(1)$.
0 commit comments