Skip to content

Commit 91e648e

Browse files
committed
trailing spaces
1 parent 3a59bd2 commit 91e648e

File tree

60 files changed

+816
-827
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+816
-827
lines changed

vscode/1.two-sum.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import java.util.HashMap;
2-
31
/*
42
* @lc app=leetcode id=1 lang=java
53
*
@@ -15,21 +13,21 @@
1513
*
1614
* Given an array of integers, return indices of the two numbers such that they
1715
* add up to a specific target.
18-
*
16+
*
1917
* You may assume that each input would have exactly one solution, and you may
2018
* not use the same element twice.
21-
*
19+
*
2220
* Example:
23-
*
24-
*
21+
*
22+
*
2523
* Given nums = [2, 7, 11, 15], target = 9,
26-
*
24+
*
2725
* Because nums[0] + nums[1] = 2 + 7 = 9,
2826
* return [0, 1].
29-
*
30-
*
31-
*
32-
*
27+
*
28+
*
29+
*
30+
*
3331
*/
3432
class Solution {
3533
public int[] twoSum(int[] nums, int target) {

vscode/101.symmetric-tree.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,32 @@
1313
*
1414
* Given a binary tree, check whether it is a mirror of itself (ie, symmetric
1515
* around its center).
16-
*
17-
*
16+
*
17+
*
1818
* For example, this binary tree [1,2,2,3,4,4,3] is symmetric:
19-
*
19+
*
2020
* ⁠ 1
2121
* ⁠ / \
2222
* ⁠ 2 2
2323
* ⁠/ \ / \
2424
* 3 4 4 3
25-
*
26-
*
27-
*
25+
*
26+
*
27+
*
2828
* But the following [1,2,2,null,3,null,3] is not:
29-
*
29+
*
3030
* ⁠ 1
3131
* ⁠ / \
3232
* ⁠ 2 2
3333
* ⁠ \ \
3434
* ⁠ 3 3
35-
*
36-
*
37-
*
38-
*
35+
*
36+
*
37+
*
38+
*
3939
* Note:
4040
* Bonus points if you could solve it both recursively and iteratively.
41-
*
41+
*
4242
*/
4343
/**
4444
* Definition for a binary tree node.

vscode/102.binary-tree-level-order-traversal.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,28 @@
1313
*
1414
* Given a binary tree, return the level order traversal of its nodes' values.
1515
* (ie, from left to right, level by level).
16-
*
17-
*
16+
*
17+
*
1818
* For example:
1919
* Given binary tree [3,9,20,null,null,15,7],
20-
*
20+
*
2121
* ⁠ 3
2222
* ⁠ / \
2323
* ⁠ 9 20
2424
* ⁠ / \
2525
* ⁠ 15 7
26-
*
27-
*
28-
*
26+
*
27+
*
28+
*
2929
* return its level order traversal as:
30-
*
30+
*
3131
* [
3232
* ⁠ [3],
3333
* ⁠ [9,20],
3434
* ⁠ [15,7]
3535
* ]
36-
*
37-
*
36+
*
37+
*
3838
*/
3939
/**
4040
* Definition for a binary tree node.
@@ -54,7 +54,7 @@ public List<List<Integer>> levelOrder(TreeNode root) {
5454

5555
Queue<TreeNode> queue = new LinkedList<>();
5656
queue.offer(root);
57-
57+
5858
while (!queue.isEmpty()) {
5959
List<Integer> level = new ArrayList<>();
6060
int size = queue.size();
@@ -70,7 +70,7 @@ public List<List<Integer>> levelOrder(TreeNode root) {
7070
}
7171
result.add(level);
7272
}
73-
73+
7474
return result;
7575
}
7676
}

vscode/104.maximum-depth-of-binary-tree.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@
1212
* Testcase Example: '[3,9,20,null,null,15,7]'
1313
*
1414
* Given a binary tree, find its maximum depth.
15-
*
15+
*
1616
* The maximum depth is the number of nodes along the longest path from the
1717
* root node down to the farthest leaf node.
18-
*
18+
*
1919
* Note: A leaf is a node with no children.
20-
*
20+
*
2121
* Example:
22-
*
22+
*
2323
* Given binary tree [3,9,20,null,null,15,7],
24-
*
25-
*
24+
*
25+
*
2626
* ⁠ 3
2727
* ⁠ / \
2828
* ⁠ 9 20
2929
* ⁠ / \
3030
* ⁠ 15 7
31-
*
31+
*
3232
* return its depth = 3.
33-
*
33+
*
3434
*/
3535
/**
3636
* Definition for a binary tree node.

vscode/108.convert-sorted-array-to-binary-search-tree.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@
1313
*
1414
* Given an array where elements are sorted in ascending order, convert it to a
1515
* height balanced BST.
16-
*
16+
*
1717
* For this problem, a height-balanced binary tree is defined as a binary tree
1818
* in which the depth of the two subtrees of every node never differ by more
1919
* than 1.
20-
*
20+
*
2121
* Example:
22-
*
23-
*
22+
*
23+
*
2424
* Given the sorted array: [-10,-3,0,5,9],
25-
*
25+
*
2626
* One possible answer is: [0,-3,9,-10,null,5], which represents the following
2727
* height balanced BST:
28-
*
28+
*
2929
* ⁠ 0
3030
* ⁠ / \
3131
* ⁠ -3 9
3232
* ⁠ / /
3333
* ⁠-10 5
34-
*
35-
*
34+
*
35+
*
3636
*/
3737
/**
3838
* Definition for a binary tree node.

vscode/110.balanced-binary-tree.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,43 +12,43 @@
1212
* Testcase Example: '[3,9,20,null,null,15,7]'
1313
*
1414
* Given a binary tree, determine if it is height-balanced.
15-
*
15+
*
1616
* For this problem, a height-balanced binary tree is defined as:
17-
*
18-
*
17+
*
18+
*
1919
* a binary tree in which the depth of the two subtrees of every node never
2020
* differ by more than 1.
21-
*
22-
*
21+
*
22+
*
2323
* Example 1:
24-
*
24+
*
2525
* Given the following tree [3,9,20,null,null,15,7]:
26-
*
27-
*
26+
*
27+
*
2828
* ⁠ 3
2929
* ⁠ / \
3030
* ⁠ 9 20
3131
* ⁠ / \
3232
* ⁠ 15 7
33-
*
33+
*
3434
* Return true.
35-
*
35+
*
3636
* Example 2:
37-
*
37+
*
3838
* Given the following tree [1,2,2,3,3,null,null,4,4]:
39-
*
40-
*
39+
*
40+
*
4141
* ⁠ 1
4242
* ⁠ / \
4343
* ⁠ 2 2
4444
* ⁠ / \
4545
* ⁠ 3 3
4646
* ⁠ / \
4747
* ⁠4 4
48-
*
49-
*
48+
*
49+
*
5050
* Return false.
51-
*
51+
*
5252
*/
5353
/**
5454
* Definition for a binary tree node.
@@ -61,7 +61,7 @@
6161
*/
6262
class Solution {
6363
private boolean isBalanced = true;
64-
64+
6565
public boolean isBalanced(TreeNode root) {
6666
getDepth(root);
6767
return isBalanced;

vscode/111.minimum-depth-of-binary-tree.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@
1212
* Testcase Example: '[3,9,20,null,null,15,7]'
1313
*
1414
* Given a binary tree, find its minimum depth.
15-
*
15+
*
1616
* The minimum depth is the number of nodes along the shortest path from the
1717
* root node down to the nearest leaf node.
18-
*
18+
*
1919
* Note: A leaf is a node with no children.
20-
*
20+
*
2121
* Example:
22-
*
22+
*
2323
* Given binary tree [3,9,20,null,null,15,7],
24-
*
25-
*
24+
*
25+
*
2626
* ⁠ 3
2727
* ⁠ / \
2828
* ⁠ 9 20
2929
* ⁠ / \
3030
* ⁠ 15 7
31-
*
31+
*
3232
* return its minimum depth = 2.
33-
*
33+
*
3434
*/
3535
/**
3636
* Definition for a binary tree node.

vscode/125.valid-palindrome.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@
1313
*
1414
* Given a string, determine if it is a palindrome, considering only
1515
* alphanumeric characters and ignoring cases.
16-
*
16+
*
1717
* Note: For the purpose of this problem, we define empty string as valid
1818
* palindrome.
19-
*
19+
*
2020
* Example 1:
21-
*
22-
*
21+
*
22+
*
2323
* Input: "A man, a plan, a canal: Panama"
2424
* Output: true
25-
*
26-
*
25+
*
26+
*
2727
* Example 2:
28-
*
29-
*
28+
*
29+
*
3030
* Input: "race a car"
3131
* Output: false
32-
*
33-
*
32+
*
33+
*
3434
*/
3535
class Solution {
3636
public boolean isPalindrome(String s) {

0 commit comments

Comments
 (0)