From f7ea9e8c23e1442edc5a54fd6a40977b8cdd7f54 Mon Sep 17 00:00:00 2001
From: Shuo
Date: Thu, 2 Apr 2020 10:52:08 +0800
Subject: [PATCH] U: tidy
---
.../angle-between-hands-of-a-clock/README.md | 2 +-
.../README.md | 2 +-
problems/find-all-good-strings/README.md | 1 +
problems/h-index/README.md | 2 +-
problems/integer-replacement/README.md | 2 +-
problems/quad-tree-intersection/README.md | 80 -------------------
.../quad_tree_intersection.go | 1 -
.../quad_tree_intersection.py | 16 ----
.../quad_tree_intersection_test.go | 1 -
problems/swap-adjacent-in-lr-string/README.md | 9 ++-
problems/unique-letter-string/README.md | 52 ------------
.../unique_letter_string.go | 1 -
.../unique_letter_string_test.go | 1 -
readme/1-300.md | 4 +-
tag/breadth-first-search/README.md | 2 +-
tag/hash-table/README.md | 2 +-
tag/sort/README.md | 2 +-
tag/tree/README.md | 2 +-
18 files changed, 16 insertions(+), 166 deletions(-)
delete mode 100644 problems/quad-tree-intersection/README.md
delete mode 100644 problems/quad-tree-intersection/quad_tree_intersection.go
delete mode 100755 problems/quad-tree-intersection/quad_tree_intersection.py
delete mode 100644 problems/quad-tree-intersection/quad_tree_intersection_test.go
delete mode 100644 problems/unique-letter-string/README.md
delete mode 100644 problems/unique-letter-string/unique_letter_string.go
delete mode 100644 problems/unique-letter-string/unique_letter_string_test.go
diff --git a/problems/angle-between-hands-of-a-clock/README.md b/problems/angle-between-hands-of-a-clock/README.md
index b78b0d9d9..96ac413ee 100644
--- a/problems/angle-between-hands-of-a-clock/README.md
+++ b/problems/angle-between-hands-of-a-clock/README.md
@@ -11,7 +11,7 @@
## [1344. Angle Between Hands of a Clock (Medium)](https://leetcode.com/problems/angle-between-hands-of-a-clock "时钟指针的夹角")
-Given two numbers, hour
and minutes
. Return the smaller angle (in sexagesimal units) formed between the hour
and the minute
hand.
+Given two numbers, hour
and minutes
. Return the smaller angle (in degrees) formed between the hour
and the minute
hand.
Example 1:
diff --git a/problems/binary-tree-level-order-traversal/README.md b/problems/binary-tree-level-order-traversal/README.md
index d0e34e041..31c4ec7a1 100644
--- a/problems/binary-tree-level-order-traversal/README.md
+++ b/problems/binary-tree-level-order-traversal/README.md
@@ -9,7 +9,7 @@
[Next >](../binary-tree-zigzag-level-order-traversal "Binary Tree Zigzag Level Order Traversal")
-## [102. Binary Tree Level Order Traversal (Medium)](https://leetcode.com/problems/binary-tree-level-order-traversal "二叉树的层次遍历")
+## [102. Binary Tree Level Order Traversal (Medium)](https://leetcode.com/problems/binary-tree-level-order-traversal "二叉树的层序遍历")
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).
diff --git a/problems/find-all-good-strings/README.md b/problems/find-all-good-strings/README.md
index e36911120..a81a4cfc5 100644
--- a/problems/find-all-good-strings/README.md
+++ b/problems/find-all-good-strings/README.md
@@ -45,6 +45,7 @@ Next >
s1.length == n
s2.length == n
+ s1 <= s2
1 <= n <= 500
1 <= evil.length <= 50
- All strings consist of lowercase English letters.
diff --git a/problems/h-index/README.md b/problems/h-index/README.md
index 0858d62f3..734b667b4 100644
--- a/problems/h-index/README.md
+++ b/problems/h-index/README.md
@@ -9,7 +9,7 @@
[Next >](../h-index-ii "H-Index II")
-## [274. H-Index (Medium)](https://leetcode.com/problems/h-index "H指数")
+## [274. H-Index (Medium)](https://leetcode.com/problems/h-index "H 指数")
Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index.
diff --git a/problems/integer-replacement/README.md b/problems/integer-replacement/README.md
index a34ff2c94..db19d0243 100644
--- a/problems/integer-replacement/README.md
+++ b/problems/integer-replacement/README.md
@@ -57,5 +57,5 @@ or
### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
[[Math](../../tag/math/README.md)]
+ [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
diff --git a/problems/quad-tree-intersection/README.md b/problems/quad-tree-intersection/README.md
deleted file mode 100644
index 8eca3810f..000000000
--- a/problems/quad-tree-intersection/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reverse-words-in-a-string-iii "Reverse Words in a String III")
-
-[Next >](../maximum-depth-of-n-ary-tree "Maximum Depth of N-ary Tree")
-
-## [558. Quad Tree Intersection (Easy)](https://leetcode.com/problems/quad-tree-intersection "四叉树交集")
-
-A quadtree is a tree data in which each internal node has exactly four children: topLeft
, topRight
, bottomLeft
and bottomRight
. Quad trees are often used to partition a two-dimensional space by recursively subdividing it into four quadrants or regions.
-
-We want to store True/False information in our quad tree. The quad tree is used to represent a N * N
boolean grid. For each node, it will be subdivided into four children nodes until the values in the region it represents are all the same. Each node has another two boolean attributes : isLeaf
and val
. isLeaf
is true if and only if the node is a leaf node. The val
attribute for a leaf node contains the value of the region it represents.
-
-For example, below are two quad trees A and B:
-
-
-A:
-+-------+-------+ T: true
-| | | F: false
-| T | T |
-| | |
-+-------+-------+
-| | |
-| F | F |
-| | |
-+-------+-------+
-topLeft: T
-topRight: T
-bottomLeft: F
-bottomRight: F
-
-B:
-+-------+---+---+
-| | F | F |
-| T +---+---+
-| | T | T |
-+-------+---+---+
-| | |
-| T | F |
-| | |
-+-------+-------+
-topLeft: T
-topRight:
- topLeft: F
- topRight: F
- bottomLeft: T
- bottomRight: T
-bottomLeft: T
-bottomRight: F
-
-
-
-
-Your task is to implement a function that will take two quadtrees and return a quadtree that represents the logical OR (or union) of the two trees.
-
-
-A: B: C (A or B):
-+-------+-------+ +-------+---+---+ +-------+-------+
-| | | | | F | F | | | |
-| T | T | | T +---+---+ | T | T |
-| | | | | T | T | | | |
-+-------+-------+ +-------+---+---+ +-------+-------+
-| | | | | | | | |
-| F | F | | T | F | | T | F |
-| | | | | | | | |
-+-------+-------+ +-------+-------+ +-------+-------+
-
-
-Note:
-
-
- - Both
A
and B
represent grids of size N * N
.
- N
is guaranteed to be a power of 2.
- - If you want to know more about the quad tree, you can refer to its wiki.
- - The logic OR operation is defined as this: "A or B" is true if
A is true
, or if B is true
, or if both A and B are true
.
-
diff --git a/problems/quad-tree-intersection/quad_tree_intersection.go b/problems/quad-tree-intersection/quad_tree_intersection.go
deleted file mode 100644
index 73dbfbda2..000000000
--- a/problems/quad-tree-intersection/quad_tree_intersection.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem558
diff --git a/problems/quad-tree-intersection/quad_tree_intersection.py b/problems/quad-tree-intersection/quad_tree_intersection.py
deleted file mode 100755
index 67b733294..000000000
--- a/problems/quad-tree-intersection/quad_tree_intersection.py
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env python
-
-"""
-# Definition for a QuadTree node.
-class Node:
- def __init__(self, val, isLeaf, topLeft, topRight, bottomLeft, bottomRight):
- self.val = val
- self.isLeaf = isLeaf
- self.topLeft = topLeft
- self.topRight = topRight
- self.bottomLeft = bottomLeft
- self.bottomRight = bottomRight
-"""
-class Solution:
- def intersect(self, quadTree1: 'Node', quadTree2: 'Node') -> 'Node':
-
\ No newline at end of file
diff --git a/problems/quad-tree-intersection/quad_tree_intersection_test.go b/problems/quad-tree-intersection/quad_tree_intersection_test.go
deleted file mode 100644
index 73dbfbda2..000000000
--- a/problems/quad-tree-intersection/quad_tree_intersection_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem558
diff --git a/problems/swap-adjacent-in-lr-string/README.md b/problems/swap-adjacent-in-lr-string/README.md
index 4294ce3c1..dbd7efcc0 100644
--- a/problems/swap-adjacent-in-lr-string/README.md
+++ b/problems/swap-adjacent-in-lr-string/README.md
@@ -27,12 +27,13 @@ XRLXXRRXL ->
XRLXXRRLX
-Note:
+
+Constraints:
-
- 1 <= len(start) = len(end) <= 10000
.
+
+ 1 <= len(start) == len(end) <= 10000
.
- Both start and end will only consist of characters in
{'L', 'R', 'X'}
.
-
+
### Related Topics
[[Brainteaser](../../tag/brainteaser/README.md)]
diff --git a/problems/unique-letter-string/README.md b/problems/unique-letter-string/README.md
deleted file mode 100644
index a6de633cd..000000000
--- a/problems/unique-letter-string/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../making-a-large-island "Making A Large Island")
-
-[Next >](../consecutive-numbers-sum "Consecutive Numbers Sum")
-
-## [828. Unique Letter String (Hard)](https://leetcode.com/problems/unique-letter-string "独特字符串")
-
-A character is unique in string S
if it occurs exactly once in it.
-
-For example, in string S = "LETTER"
, the only unique characters are "L"
and "R"
.
-
-Let's define UNIQ(S)
as the number of unique characters in string S
.
-
-For example, UNIQ("LETTER") = 2
.
-
-Given a string S
with only uppercases, calculate the sum of UNIQ(substring)
over all non-empty substrings of S
.
-
-If there are two or more equal substrings at different positions in S
, we consider them different.
-
-Since the answer can be very large, return the answer modulo 10 ^ 9 + 7
.
-
-
-
-Example 1:
-
-
-Input: "ABC"
-Output: 10
-Explanation: All possible substrings are: "A","B","C","AB","BC" and "ABC".
-Evey substring is composed with only unique letters.
-Sum of lengths of all substring is 1 + 1 + 1 + 2 + 2 + 3 = 10
-
-Example 2:
-
-
-Input: "ABA"
-Output: 8
-Explanation: The same as example 1, except uni("ABA") = 1.
-
-
-
-
-Note: 0 <= S.length <= 10000
.
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
diff --git a/problems/unique-letter-string/unique_letter_string.go b/problems/unique-letter-string/unique_letter_string.go
deleted file mode 100644
index 66a63083f..000000000
--- a/problems/unique-letter-string/unique_letter_string.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem828
diff --git a/problems/unique-letter-string/unique_letter_string_test.go b/problems/unique-letter-string/unique_letter_string_test.go
deleted file mode 100644
index 66a63083f..000000000
--- a/problems/unique-letter-string/unique_letter_string_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem828
diff --git a/readme/1-300.md b/readme/1-300.md
index ace0725b6..a9af4d825 100644
--- a/readme/1-300.md
+++ b/readme/1-300.md
@@ -163,7 +163,7 @@ LeetCode Problems' Solutions
| 99 | [Recover Binary Search Tree](https://leetcode.com/problems/recover-binary-search-tree "恢复二叉搜索树") | [Go](../problems/recover-binary-search-tree) | Hard |
| 100 | [Same Tree](https://leetcode.com/problems/same-tree "相同的树") | [Go](../problems/same-tree) | Easy |
| 101 | [Symmetric Tree](https://leetcode.com/problems/symmetric-tree "对称二叉树") | [Go](../problems/symmetric-tree) | Easy |
-| 102 | [Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal "二叉树的层次遍历") | [Go](../problems/binary-tree-level-order-traversal) | Medium |
+| 102 | [Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal "二叉树的层序遍历") | [Go](../problems/binary-tree-level-order-traversal) | Medium |
| 103 | [Binary Tree Zigzag Level Order Traversal](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal "二叉树的锯齿形层次遍历") | [Go](../problems/binary-tree-zigzag-level-order-traversal) | Medium |
| 104 | [Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree "二叉树的最大深度") | [Go](../problems/maximum-depth-of-binary-tree) | Easy |
| 105 | [Construct Binary Tree from Preorder and Inorder Traversal](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal "从前序与中序遍历序列构造二叉树") | [Go](../problems/construct-binary-tree-from-preorder-and-inorder-traversal) | Medium |
@@ -335,7 +335,7 @@ LeetCode Problems' Solutions
| 271 | [Encode and Decode Strings](https://leetcode.com/problems/encode-and-decode-strings "字符串的编码与解码") 🔒 | [Go](../problems/encode-and-decode-strings) | Medium |
| 272 | [Closest Binary Search Tree Value II](https://leetcode.com/problems/closest-binary-search-tree-value-ii "最接近的二叉搜索树值 II") 🔒 | [Go](../problems/closest-binary-search-tree-value-ii) | Hard |
| 273 | [Integer to English Words](https://leetcode.com/problems/integer-to-english-words "整数转换英文表示") | [Go](../problems/integer-to-english-words) | Hard |
-| 274 | [H-Index](https://leetcode.com/problems/h-index "H指数") | [Go](../problems/h-index) | Medium |
+| 274 | [H-Index](https://leetcode.com/problems/h-index "H 指数") | [Go](../problems/h-index) | Medium |
| 275 | [H-Index II](https://leetcode.com/problems/h-index-ii "H指数 II") | [Go](../problems/h-index-ii) | Medium |
| 276 | [Paint Fence](https://leetcode.com/problems/paint-fence "栅栏涂色") 🔒 | [Go](../problems/paint-fence) | Easy |
| 277 | [Find the Celebrity](https://leetcode.com/problems/find-the-celebrity "搜寻名人") 🔒 | [Go](../problems/find-the-celebrity) | Medium |
diff --git a/tag/breadth-first-search/README.md b/tag/breadth-first-search/README.md
index c7632435f..5a541ddc1 100644
--- a/tag/breadth-first-search/README.md
+++ b/tag/breadth-first-search/README.md
@@ -74,5 +74,5 @@
| 111 | [二叉树的最小深度](../../problems/minimum-depth-of-binary-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Easy |
| 107 | [二叉树的层次遍历 II](../../problems/binary-tree-level-order-traversal-ii) | [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Easy |
| 103 | [二叉树的锯齿形层次遍历](../../problems/binary-tree-zigzag-level-order-traversal) | [[栈](../stack/README.md)] [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
-| 102 | [二叉树的层次遍历](../../problems/binary-tree-level-order-traversal) | [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
+| 102 | [二叉树的层序遍历](../../problems/binary-tree-level-order-traversal) | [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
| 101 | [对称二叉树](../../problems/symmetric-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Easy |
diff --git a/tag/hash-table/README.md b/tag/hash-table/README.md
index f64eb2adf..048244161 100644
--- a/tag/hash-table/README.md
+++ b/tag/hash-table/README.md
@@ -104,7 +104,7 @@
| 299 | [猜数字游戏](../../problems/bulls-and-cows) | [[哈希表](../hash-table/README.md)] | Easy |
| 290 | [单词规律](../../problems/word-pattern) | [[哈希表](../hash-table/README.md)] | Easy |
| 288 | [单词的唯一缩写](../../problems/unique-word-abbreviation) 🔒 | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium |
-| 274 | [H指数](../../problems/h-index) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] | Medium |
+| 274 | [H 指数](../../problems/h-index) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] | Medium |
| 266 | [回文排列](../../problems/palindrome-permutation) 🔒 | [[哈希表](../hash-table/README.md)] | Easy |
| 249 | [移位字符串分组](../../problems/group-shifted-strings) 🔒 | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Medium |
| 246 | [中心对称数](../../problems/strobogrammatic-number) 🔒 | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Easy |
diff --git a/tag/sort/README.md b/tag/sort/README.md
index 00a686712..02d67afd8 100644
--- a/tag/sort/README.md
+++ b/tag/sort/README.md
@@ -44,7 +44,7 @@
| 315 | [计算右侧小于当前元素的个数](../../problems/count-of-smaller-numbers-after-self) | [[排序](../sort/README.md)] [[树状数组](../binary-indexed-tree/README.md)] [[线段树](../segment-tree/README.md)] [[二分查找](../binary-search/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Hard |
| 296 | [最佳的碰头地点](../../problems/best-meeting-point) 🔒 | [[排序](../sort/README.md)] [[数学](../math/README.md)] | Hard |
| 280 | [摆动排序](../../problems/wiggle-sort) 🔒 | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium |
-| 274 | [H指数](../../problems/h-index) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] | Medium |
+| 274 | [H 指数](../../problems/h-index) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] | Medium |
| 253 | [会议室 II](../../problems/meeting-rooms-ii) 🔒 | [[堆](../heap/README.md)] [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] | Medium |
| 252 | [会议室](../../problems/meeting-rooms) 🔒 | [[排序](../sort/README.md)] | Easy |
| 242 | [有效的字母异位词](../../problems/valid-anagram) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] | Easy |
diff --git a/tag/tree/README.md b/tag/tree/README.md
index 7ae7fed66..8e5a8ad97 100644
--- a/tag/tree/README.md
+++ b/tag/tree/README.md
@@ -132,7 +132,7 @@
| 105 | [从前序与中序遍历序列构造二叉树](../../problems/construct-binary-tree-from-preorder-and-inorder-traversal) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[数组](../array/README.md)] | Medium |
| 104 | [二叉树的最大深度](../../problems/maximum-depth-of-binary-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Easy |
| 103 | [二叉树的锯齿形层次遍历](../../problems/binary-tree-zigzag-level-order-traversal) | [[栈](../stack/README.md)] [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
-| 102 | [二叉树的层次遍历](../../problems/binary-tree-level-order-traversal) | [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
+| 102 | [二叉树的层序遍历](../../problems/binary-tree-level-order-traversal) | [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
| 101 | [对称二叉树](../../problems/symmetric-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Easy |
| 100 | [相同的树](../../problems/same-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Easy |
| 99 | [恢复二叉搜索树](../../problems/recover-binary-search-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Hard |