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: src/main/java/g0301_0400/s0383_ransom_note/readme.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,27 +2,27 @@
2
2
3
3
Easy
4
4
5
-
Given two stings`ransomNote` and `magazine`, return `true`if`ransomNote`can be constructed from `magazine`and`false`otherwise.
5
+
Given two strings`ransomNote` and `magazine`, return `true`_if_`ransomNote`_can be constructed by using the letters from_`magazine`_and_`false`_otherwise_.
6
6
7
7
Each letter in `magazine` can only be used once in `ransomNote`.
Copy file name to clipboardExpand all lines: src/main/java/g0301_0400/s0392_is_subsequence/readme.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,19 @@ Easy
4
4
5
5
Given two strings `s` and `t`, return `true`_if_`s`_is a **subsequence** of_`t`_, or_`false`_otherwise_.
6
6
7
-
A **subsequence** of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (i.e., `"ace"` is a subsequence of `"abcde"` while `"aec"` is not).
7
+
A **subsequence** of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (i.e., `"ace"` is a subsequence of <code>"<ins>a</ins>b<ins>c</ins>d<ins>e</ins>"</code> while `"aec"` is not).
Copy file name to clipboardExpand all lines: src/main/java/g0301_0400/s0394_decode_string/readme.md
+2-8Lines changed: 2 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,9 @@ Given an encoded string, return its decoded string.
6
6
7
7
The encoding rule is: `k[encoded_string]`, where the `encoded_string` inside the square brackets is being repeated exactly `k` times. Note that `k` is guaranteed to be a positive integer.
8
8
9
-
You may assume that the input string is always valid; No extra white spaces, square brackets are well-formed, etc.
9
+
You may assume that the input string is always valid; there are no extra white spaces, square brackets are well-formed, etc. Furthermore, you may assume that the original data does not contain any digits and that digits are only for those repeat numbers, `k`. For example, there will not be input like `3a` or `2[4]`.
10
10
11
-
Furthermore, you may assume that the original data does not contain any digits and that digits are only for those repeat numbers, `k`. For example, there won't be input like `3a` or `2[4]`.
11
+
The test cases are generated so that the length of the output will never exceed <code>10<sup>5</sup></code>.
12
12
13
13
**Example 1:**
14
14
@@ -28,12 +28,6 @@ Furthermore, you may assume that the original data does not contain any digits a
Copy file name to clipboardExpand all lines: src/main/java/g0301_0400/s0399_evaluate_division/readme.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,8 @@ Return _the answers to all queries_. If a single answer cannot be determined, re
10
10
11
11
**Note:** The input is always valid. You may assume that evaluating the queries will not result in division by zero and that there is no contradiction.
12
12
13
+
**Note:** The variables that do not occur in the list of equations are undefined, so the answer cannot be determined for them.
Copy file name to clipboardExpand all lines: src/main/java/g0401_0500/s0416_partition_equal_subset_sum/readme.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Medium
4
4
5
-
Given a **non-empty** array `nums` containing **only positive integers**, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.
5
+
Given an integer array `nums`, return `true`_if you can partition the array into two subsets such that the sum of the elements in both subsets is equal or_`false`_otherwise_.
Copy file name to clipboardExpand all lines: src/main/java/g0401_0500/s0427_construct_quad_tree/readme.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,9 @@
2
2
3
3
Medium
4
4
5
-
Given a `n * n` matrix `grid` of `0's` and `1's` only. We want to represent the `grid` with a Quad-Tree.
5
+
Given a `n * n` matrix `grid` of `0's` and `1's` only. We want to represent `grid` with a Quad-Tree.
6
6
7
-
Return _the root of the Quad-Tree_ representing the `grid`.
8
-
9
-
Notice that you can assign the value of a node to **True** or **False** when `isLeaf` is **False**, and both are **accepted** in the answer.
7
+
Return _the root of the Quad-Tree representing_`grid`.
10
8
11
9
A Quad-Tree is a tree data structure in which each internal node has exactly four children. Besides, each node has two attributes:
12
10
@@ -34,7 +32,7 @@ If you want to know more about the Quad-Tree, you can refer to the [wiki](https:
34
32
35
33
**Quad-Tree format:**
36
34
37
-
The output represents the serialized format of a Quad-Tree using level order traversal, where `null` signifies a path terminator where no node exists below.
35
+
You don't need to read this section for solving the problem. This is only if you want to understand the output format here. The output represents the serialized format of a Quad-Tree using level order traversal, where `null` signifies a path terminator where no node exists below.
38
36
39
37
It is very similar to the serialization of the binary tree. The only difference is that the node is represented as a list `[isLeaf, val]`.
40
38
@@ -75,4 +73,4 @@ If the value of `isLeaf` or `val` is True we represent it as **1** in the list `
75
73
**Constraints:**
76
74
77
75
*`n == grid.length == grid[i].length`
78
-
* <code>n == 2<sup>x</sup></code> where `0 <= x <= 6`
76
+
* <code>n == 2<sup>x</sup></code> where `0 <= x <= 6`
Copy file name to clipboardExpand all lines: src/main/java/g0401_0500/s0433_minimum_genetic_mutation/readme.md
+6-14Lines changed: 6 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,38 +4,30 @@ Medium
4
4
5
5
A gene string can be represented by an 8-character long string, with choices from `'A'`, `'C'`, `'G'`, and `'T'`.
6
6
7
-
Suppose we need to investigate a mutation from a gene string `start` to a gene string `end` where one mutation is defined as one single character changed in the gene string.
7
+
Suppose we need to investigate a mutation from a gene string `startGene` to a gene string `endGene` where one mutation is defined as one single character changed in the gene string.
8
8
9
9
* For example, `"AACCGGTT" --> "AACCGGTA"` is one mutation.
10
10
11
11
There is also a gene bank `bank` that records all the valid gene mutations. A gene must be in `bank` to make it a valid gene string.
12
12
13
-
Given the two gene strings `start` and `end` and the gene bank `bank`, return _the minimum number of mutations needed to mutate from_`start`_to_`end`. If there is no such a mutation, return `-1`.
13
+
Given the two gene strings `startGene` and `endGene` and the gene bank `bank`, return _the minimum number of mutations needed to mutate from_`startGene`_to_`endGene`. If there is no such a mutation, return `-1`.
14
14
15
15
Note that the starting point is assumed to be valid, so it might not be included in the bank.
16
16
17
17
**Example 1:**
18
18
19
-
**Input:**start = "AACCGGTT", end = "AACCGGTA", bank = ["AACCGGTA"]
19
+
**Input:**startGene = "AACCGGTT", endGene = "AACCGGTA", bank = ["AACCGGTA"]
20
20
21
21
**Output:** 1
22
22
23
23
**Example 2:**
24
24
25
-
**Input:**start = "AACCGGTT", end = "AAACGGTA", bank = ["AACCGGTA","AACCGCTA","AAACGGTA"]
25
+
**Input:**startGene = "AACCGGTT", endGene = "AAACGGTA", bank = ["AACCGGTA","AACCGCTA","AAACGGTA"]
26
26
27
27
**Output:** 2
28
28
29
-
**Example 3:**
30
-
31
-
**Input:** start = "AAAAACCC", end = "AACCCCCC", bank = ["AAAACCCC","AAACCCCC","AACCCCCC"]
32
-
33
-
**Output:** 3
34
-
35
29
**Constraints:**
36
30
37
-
*`start.length == 8`
38
-
*`end.length == 8`
39
31
*`0 <= bank.length <= 10`
40
-
*`bank[i].length == 8`
41
-
*`start`, `end`, and `bank[i]` consist of only the characters `['A', 'C', 'G', 'T']`.
0 commit comments