Skip to content

Commit

Permalink
feat: add metadata info (doocs#2820)
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglbme authored May 16, 2024
1 parent 5dbbd13 commit 7dff3e5
Show file tree
Hide file tree
Showing 3,205 changed files with 3,245 additions and 10 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 3 additions & 3 deletions lcci/17.22.Word Transformer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,15 @@ class Solution {
private var wordList: [String] = []
private var endWord: String = ""
private var vis: [Bool] = []

func findLadders(_ beginWord: String, _ endWord: String, _ wordList: [String]) -> [String] {
self.wordList = wordList
self.endWord = endWord
ans.append(beginWord)
vis = Array(repeating: false, count: wordList.count)
return dfs(beginWord) ? ans : []
}

private func dfs(_ s: String) -> Bool {
if s == endWord {
return true
Expand All @@ -290,7 +290,7 @@ class Solution {
}
return false
}

private func check(_ s: String, _ t: String) -> Bool {
if s.count != t.count {
return false
Expand Down
6 changes: 3 additions & 3 deletions lcci/17.22.Word Transformer/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,15 @@ class Solution {
private var wordList: [String] = []
private var endWord: String = ""
private var vis: [Bool] = []

func findLadders(_ beginWord: String, _ endWord: String, _ wordList: [String]) -> [String] {
self.wordList = wordList
self.endWord = endWord
ans.append(beginWord)
vis = Array(repeating: false, count: wordList.count)
return dfs(beginWord) ? ans : []
}

private func dfs(_ s: String) -> Bool {
if s == endWord {
return true
Expand All @@ -307,7 +307,7 @@ class Solution {
}
return false
}

private func check(_ s: String, _ t: String) -> Bool {
if s.count != t.count {
return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 困难
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1000.Minimum%20Cost%20to%20Merge%20Stones/README.md
rating: 2422
source: 第 126 场周赛 Q4
tags:
- 数组
- 动态规划
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Hard
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1000.Minimum%20Cost%20to%20Merge%20Stones/README_EN.md
rating: 2422
source: Weekly Contest 126 Q4
tags:
- Array
- Dynamic Programming
Expand Down
1 change: 1 addition & 0 deletions solution/1000-1099/1001.Grid Illumination/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 困难
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1001.Grid%20Illumination/README.md
rating: 1873
source: 第 125 场周赛 Q4
tags:
- 数组
- 哈希表
Expand Down
1 change: 1 addition & 0 deletions solution/1000-1099/1001.Grid Illumination/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Hard
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1001.Grid%20Illumination/README_EN.md
rating: 1873
source: Weekly Contest 125 Q4
tags:
- Array
- Hash Table
Expand Down
1 change: 1 addition & 0 deletions solution/1000-1099/1002.Find Common Characters/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 简单
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1002.Find%20Common%20Characters/README.md
rating: 1279
source: 第 126 场周赛 Q1
tags:
- 数组
- 哈希表
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Easy
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1002.Find%20Common%20Characters/README_EN.md
rating: 1279
source: Weekly Contest 126 Q1
tags:
- Array
- Hash Table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1003.Check%20If%20Word%20Is%20Valid%20After%20Substitutions/README.md
rating: 1426
source: 第 126 场周赛 Q2
tags:
-
- 字符串
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1003.Check%20If%20Word%20Is%20Valid%20After%20Substitutions/README_EN.md
rating: 1426
source: Weekly Contest 126 Q2
tags:
- Stack
- String
Expand Down
1 change: 1 addition & 0 deletions solution/1000-1099/1004.Max Consecutive Ones III/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1004.Max%20Consecutive%20Ones%20III/README.md
rating: 1655
source: 第 126 场周赛 Q3
tags:
- 数组
- 二分查找
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1004.Max%20Consecutive%20Ones%20III/README_EN.md
rating: 1655
source: Weekly Contest 126 Q3
tags:
- Array
- Binary Search
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 简单
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1005.Maximize%20Sum%20Of%20Array%20After%20K%20Negations/README.md
rating: 1274
source: 第 127 场周赛 Q1
tags:
- 贪心
- 数组
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Easy
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1005.Maximize%20Sum%20Of%20Array%20After%20K%20Negations/README_EN.md
rating: 1274
source: Weekly Contest 127 Q1
tags:
- Greedy
- Array
Expand Down
1 change: 1 addition & 0 deletions solution/1000-1099/1006.Clumsy Factorial/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1006.Clumsy%20Factorial/README.md
rating: 1407
source: 第 127 场周赛 Q2
tags:
-
- 数学
Expand Down
1 change: 1 addition & 0 deletions solution/1000-1099/1006.Clumsy Factorial/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1006.Clumsy%20Factorial/README_EN.md
rating: 1407
source: Weekly Contest 127 Q2
tags:
- Stack
- Math
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1007.Minimum%20Domino%20Rotations%20For%20Equal%20Row/README.md
rating: 1541
source: 第 127 场周赛 Q3
tags:
- 贪心
- 数组
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1007.Minimum%20Domino%20Rotations%20For%20Equal%20Row/README_EN.md
rating: 1541
source: Weekly Contest 127 Q3
tags:
- Greedy
- Array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1008.Construct%20Binary%20Search%20Tree%20from%20Preorder%20Traversal/README.md
rating: 1562
source: 第 127 场周赛 Q4
tags:
-
-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1008.Construct%20Binary%20Search%20Tree%20from%20Preorder%20Traversal/README_EN.md
rating: 1562
source: Weekly Contest 127 Q4
tags:
- Stack
- Tree
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 简单
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1009.Complement%20of%20Base%2010%20Integer/README.md
rating: 1234
source: 第 128 场周赛 Q1
tags:
- 位运算
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Easy
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1009.Complement%20of%20Base%2010%20Integer/README_EN.md
rating: 1234
source: Weekly Contest 128 Q1
tags:
- Bit Manipulation
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1010.Pairs%20of%20Songs%20With%20Total%20Durations%20Divisible%20by%2060/README.md
rating: 1377
source: 第 128 场周赛 Q2
tags:
- 数组
- 哈希表
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1010.Pairs%20of%20Songs%20With%20Total%20Durations%20Divisible%20by%2060/README_EN.md
rating: 1377
source: Weekly Contest 128 Q2
tags:
- Array
- Hash Table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1011.Capacity%20To%20Ship%20Packages%20Within%20D%20Days/README.md
rating: 1725
source: 第 128 场周赛 Q3
tags:
- 数组
- 二分查找
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1011.Capacity%20To%20Ship%20Packages%20Within%20D%20Days/README_EN.md
rating: 1725
source: Weekly Contest 128 Q3
tags:
- Array
- Binary Search
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 困难
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1012.Numbers%20With%20Repeated%20Digits/README.md
rating: 2230
source: 第 128 场周赛 Q4
tags:
- 数学
- 动态规划
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Hard
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1012.Numbers%20With%20Repeated%20Digits/README_EN.md
rating: 2230
source: Weekly Contest 128 Q4
tags:
- Math
- Dynamic Programming
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 简单
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1013.Partition%20Array%20Into%20Three%20Parts%20With%20Equal%20Sum/README.md
rating: 1378
source: 第 129 场周赛 Q1
tags:
- 贪心
- 数组
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Easy
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1013.Partition%20Array%20Into%20Three%20Parts%20With%20Equal%20Sum/README_EN.md
rating: 1378
source: Weekly Contest 129 Q1
tags:
- Greedy
- Array
Expand Down
1 change: 1 addition & 0 deletions solution/1000-1099/1014.Best Sightseeing Pair/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1014.Best%20Sightseeing%20Pair/README.md
rating: 1730
source: 第 129 场周赛 Q3
tags:
- 数组
- 动态规划
Expand Down
1 change: 1 addition & 0 deletions solution/1000-1099/1014.Best Sightseeing Pair/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1014.Best%20Sightseeing%20Pair/README_EN.md
rating: 1730
source: Weekly Contest 129 Q3
tags:
- Array
- Dynamic Programming
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1015.Smallest%20Integer%20Divisible%20by%20K/README.md
rating: 1874
source: 第 129 场周赛 Q2
tags:
- 哈希表
- 数学
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1015.Smallest%20Integer%20Divisible%20by%20K/README_EN.md
rating: 1874
source: Weekly Contest 129 Q2
tags:
- Hash Table
- Math
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1016.Binary%20String%20With%20Substrings%20Representing%201%20To%20N/README.md
rating: 1779
source: 第 129 场周赛 Q4
tags:
- 字符串
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1016.Binary%20String%20With%20Substrings%20Representing%201%20To%20N/README_EN.md
rating: 1779
source: Weekly Contest 129 Q4
tags:
- String
---
Expand Down
1 change: 1 addition & 0 deletions solution/1000-1099/1017.Convert to Base -2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1017.Convert%20to%20Base%20-2/README.md
rating: 1697
source: 第 130 场周赛 Q2
tags:
- 数学
---
Expand Down
1 change: 1 addition & 0 deletions solution/1000-1099/1017.Convert to Base -2/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1017.Convert%20to%20Base%20-2/README_EN.md
rating: 1697
source: Weekly Contest 130 Q2
tags:
- Math
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 简单
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1018.Binary%20Prefix%20Divisible%20By%205/README.md
rating: 1376
source: 第 130 场周赛 Q1
tags:
- 位运算
- 数组
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Easy
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1018.Binary%20Prefix%20Divisible%20By%205/README_EN.md
rating: 1376
source: Weekly Contest 130 Q1
tags:
- Bit Manipulation
- Array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1019.Next%20Greater%20Node%20In%20Linked%20List/README.md
rating: 1570
source: 第 130 场周赛 Q3
tags:
-
- 数组
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1019.Next%20Greater%20Node%20In%20Linked%20List/README_EN.md
rating: 1570
source: Weekly Contest 130 Q3
tags:
- Stack
- Array
Expand Down
1 change: 1 addition & 0 deletions solution/1000-1099/1020.Number of Enclaves/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1020.Number%20of%20Enclaves/README.md
rating: 1615
source: 第 130 场周赛 Q4
tags:
- 深度优先搜索
- 广度优先搜索
Expand Down
1 change: 1 addition & 0 deletions solution/1000-1099/1020.Number of Enclaves/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1020.Number%20of%20Enclaves/README_EN.md
rating: 1615
source: Weekly Contest 130 Q4
tags:
- Depth-First Search
- Breadth-First Search
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ comments: true
difficulty: 简单
edit_url: https://github.com/doocs/leetcode/edit/main/solution/1000-1099/1021.Remove%20Outermost%20Parentheses/README.md
rating: 1311
source: 第 131 场周赛 Q1
tags:
-
- 字符串
Expand Down
Loading

0 comments on commit 7dff3e5

Please sign in to comment.