Skip to content

Commit 7b8f357

Browse files
committed
feat: i18n update
1 parent 52a8f02 commit 7b8f357

File tree

3 files changed

+327
-101
lines changed

3 files changed

+327
-101
lines changed

‎src/locales/en.js

+114-7
Original file line numberDiff line numberDiff line change
@@ -60,28 +60,81 @@ const en = {
6060
notYet: "Not yet",
6161
},
6262
problem: {
63+
10: "10. Regular Expression Matching",
64+
44: "44. Wildcard Matching",
65+
62: "62. Unique Paths",
66+
63: "63. Unique Paths II",
67+
64: "64. Minimum Path Sum",
6368
69: "69. Sqrt(x)",
69+
70: "70. Climbing Stairs",
70+
72: "72. Edit Distance",
71+
174: "174. Dungeon Game",
72+
198: "198. House Robber",
73+
233: "233. Number of Digit One",
6474
278: "278. First Bad Version",
65-
"278_desc": "The idea of the leftmost and rightmost is the same. Everyone can practice two questions. The actual situation can use different binary search according to the meaning of the question.",
75+
"278_desc":
76+
"The idea of the leftmost and rightmost is the same. Everyone can practice two questions. The actual situation can use different binary search according to the meaning of the question.",
77+
292: "292. Nim Game",
6678
327: "327. Count of Range Sum",
79+
322: "322. Coin Change",
80+
337: "337. House Robber III",
81+
357: "357. Count Numbers with Unique Digits",
82+
416: "416. Partition Equal Subset Sum",
83+
464: "464. Can I Win",
6784
493: "493. Reverse Pairs",
85+
518: "518. Coin Change 2",
86+
576: "576. Out of Boundary Paths(changed from selecting two directions to selecting four directions)",
87+
698: "698. Partition to K Equal Sum Subsets",
6888
743: "743. Network Delay Time",
6989
778: "778. Swim in Rising Water",
70-
"778_desc": "DFS + binary search, there are many similar questions, such as the 1439th question. This kind of question routine is very similar, and the difficulty is not big.",
90+
"778_desc":
91+
"DFS + binary search, there are many similar questions, such as the 1439th question. This kind of question routine is very similar, and the difficulty is not big.",
92+
808: "808. Soup Servings",
93+
837: "837. New 21 Game",
94+
877: "877. Stone Game",
95+
902: "902. Numbers At Most N Given Digit Set",
96+
935: "935. Knight Dialer(Changed from selecting two directions to selecting eight directions)",
97+
1015: "1015. Smallest Integer Divisible by K",
98+
1140: "1140. Stone Game II",
7199
1109: "1109. Corporate Flight Bookings",
72100
1314: "1314. Matrix Block Sum",
101+
1406: "1406. Stone Game III",
73102
1462: "1462. Course Schedule IV",
74103
1480: "1480. Running Sum of 1d Array",
104+
1510: "1510. Stone Game IV",
105+
1563: "1563. Stone Game V",
75106
1584: "1584. Min Cost to Connect All Points",
107+
1681: "1681. Minimum Incompatibility",
108+
1686: "1686. Stone Game VI",
109+
"1686_desc":
110+
"Except for this one, the other \"Stone Game\" ideas are basically the same",
111+
1690: "1690. Stone Game VII",
76112
2536: "2536. Increment Submatrices by One",
113+
114+
// https://binarysearch.com/problems
77115
minimumLightRadius: "Minimum Light Radius",
78-
minimumLightRadius_desc: "Classic ability detection binary search, leetcode also has a similar topic",
116+
minimumLightRadius_desc:
117+
"Classic ability detection binary search, leetcode also has a similar topic",
79118
kthPairDistance: "Kth Smallest Distance Pair",
80-
kthPairDistance_desc: "Typical counting binary search, which is essentially an ability test, but the number of questions is large, so it is separated.",
119+
kthPairDistance_desc:
120+
"Typical counting binary search, which is essentially an ability test, but the number of questions is large, so it is separated.",
121+
increasingDigits: "Increasing Digits",
122+
palindromicInsertions: "Palindromic Insertions",
123+
palindromicInsertions_desc:
124+
"For interval dynamic programming, it is necessary to proceed simultaneously from both ends of the sequence, rather than from one end of the sequence to the other.",
125+
126+
// 剑指 Offer 系列
81127
JZ51: "Sword Offer 51. Reverse pairs in an array",
82128

129+
// 面试题系列
130+
interview17_13: "Interview 17.13. Re-Space LCCI",
131+
interview17_13__desc:
132+
"CHow to practice the details? 1? - 1? How to initialize? You can learn through this question ~",
133+
83134
longestIncreasingSubsequence: "Longest Increasing Subsequence Series",
84135
longestIncreasingSubsequence_desc: "Series classic topic, worth doing",
136+
littleRabbitsChessboard: "Little Rabbit's Chessboard",
137+
shopeesOffice: "Shopee's Office",
85138
},
86139
codeTemplate: {
87140
name: "Code Template",
@@ -152,9 +205,8 @@ const en = {
152205
},
153206
learningRoute: {
154207
name: "Learning Route",
155-
dp: "Dynamic Programming",
156208
binarySearch: "Binary Search",
157-
binarySearchDesc:`
209+
binarySearchDesc: `
158210
If you ask me to summarize binary search in one sentence, I would say that binary search is an algorithm that makes the unknown world inorganic. That is, no matter what, we can discard half of the solutions, that is, we can cut the solution space in half.
159211
The difficulty is two points: **what conditions** and **which part to discard**. This is the core problem that binary search needs to solve.
160212
@@ -186,10 +238,65 @@ const en = {
186238
binarySearch_item5_keys: `The essence is also ability detection, so it is basically the same as the ability detection framework. Everyone compares and understands.
187239
`,
188240

241+
dp: "Dynamic Programming",
242+
dp_desc: `The basic framework for different problems of the same type is generally consistent, but with slight variations in details. The template code is explained using a specific type as an example, and individuals should make adjustments based on the actual situation.
243+
244+
The three key points for dynamic programming are: state, enumeration, and transition equations (choices). For each type of problem, I try to provide hints based on these three points.
245+
246+
Of course, this learning path is intended for those with some foundation. If you don't have a foundation yet, you can refer to related articles. I will also write a comprehensive routine article in the future.`,
247+
dp_item1: "Single string type",
248+
dp_item1_keys1: `
249+
State: 1. dp[i] represents the xxxx ending with s[i]
250+
2. dp[i] represents the xxxx up to s[i]`,
251+
dp_item1_keys2:
252+
"Enumeration: It usually involves two nested loops, where one loop fixes the left endpoint and the other loop fixes the right endpoint for enumeration.",
253+
dp_item1_keys3:
254+
"Transition equation: Based on the problem, choose whether to combine with s[j], then take the maximum, minimum, or count as required.",
255+
256+
dp_item2: "Double string type",
257+
dp_item2_keys1: `
258+
State: 1. dp[i][j] represents the xxxx ending with s1[i], s2[j]
259+
2. dp[i][j] represents the xxxx up to s1[i], s2[j]`,
260+
dp_item2_keys2:
261+
"Enumeration: Typically, it involves two nested loops, where one loop fixes the right endpoint of s1, and the other loop fixes the right endpoint of s2 for enumeration.",
262+
dp_item2_keys3:
263+
"State transition: Based on the problem and the relationship between s[i] and s[j], take the maximum, minimum, or count as required.",
264+
265+
dp_item3: "Sequence type",
266+
dp_item3_keys1: `
267+
State: 1. In one-dimensional arrays, dp[i] usually represents the xxxx ending with nums[i]
268+
2. In two-dimensional arrays, dp[i][j] usually represents the xxxx ending with grid[i][j]`,
269+
dp_item3_keys2:
270+
"Enumeration: One-dimensional involves a single loop to enumerate all nums, while two-dimensional involves two loops to enumerate all grid.",
271+
dp_item3_keys3: `
272+
State transition: 1. In one dimension, it usually involves the relationship between the current cell and the preceding two cells, possibly involving maximum, minimum, or counting.
273+
dp[i] = dp[i - 1] + dp[i - 2]" This is also called a recurrence relation because it does not involve decision-making.
274+
2. In two dimensions, it usually involves the relationship between the current cell and its upper and left adjacent cells, possibly involving maximum, minimum, or counting.
275+
dp[i][j] = dp[i - 1][j] + dp[i][j-1]" This is also called a recurrence relation because it does not involve decision-making.
276+
3. From the transition equation, it's not difficult to see that this type of problem can usually be optimized using rolling arrays.
277+
`,
278+
279+
dp_item4: "Backpack type(List only the problems)",
280+
dp_item5: "Number type(List only the problems)",
281+
dp_item5_keys1:
282+
"The common definition of dynamic programming is represented as dp[i][j], where i stands for the length of the number, and j represents the last digit. For example, dp[3][2] denotes a number with a total of three digits, with 2 as the last digit.",
283+
dp_item6: "Probability type(List only the problems)",
284+
dp_item7: "Game type(List only the problems)",
285+
286+
dp_item8: "Interval DP",
287+
dp_item8_text_comment:
288+
"Using memoization might lead to better code writing. For example, the above DP code can be transformed into memoized recursion as:",
289+
dp_item8_keys1: `
290+
Traversing in reverse from the right boundary and in forward from the left boundary
291+
`,
292+
dp_item8_keys2:
293+
"Typically, the return value is dp[0][n], rather than other common dp[-1][-1].",
294+
dp_item9: "State compression type(List only the problems)",
295+
189296
tree: "Tree",
190297
linkedList: "Linked List",
191298
clickToEnlarge: "Click to enlarge",
192-
recommendedProblems:"Recommended Problems",
299+
recommendedProblems: "Recommended Problems",
193300
},
194301
checkForUpdates: {
195302
name: "Check for Updates",

‎src/locales/zh.js

+110-2
Original file line numberDiff line numberDiff line change
@@ -57,31 +57,79 @@ const zh = {
5757
notYet: "暂无",
5858
},
5959
problem: {
60+
10: "10. 正则表达式匹配",
61+
44: "44. 通配符匹配",
62+
62: "62. 不同路径",
63+
63: "63. 不同路径 II",
64+
64: "64. 最小路径和",
6065
69: "69. x 的平方根",
66+
70: "70. 爬楼梯",
67+
72: "72. 编辑距离",
68+
174: "174. 地下城游戏",
69+
198: "198. 打家劫舍",
70+
233: "233. 数字 1 的个数",
6171
278: "278. 第一个错误的版本",
6272
"278_desc":
6373
"最左最右思路一样,大家练习两道,实际情况根据题意使用不同的二分即可。",
74+
292: "292. Nim 游戏",
6475
327: "327. 区间和的个数",
76+
322: "322. 零钱兑换",
77+
337: "337. 打家劫舍 III",
78+
357: "357. 计算各个位数不同的数字个数",
79+
416: "416. 分割等和子集",
80+
464: "464. 我能赢吗",
6581
493: "493. 翻转对",
82+
518: "518. 零钱兑换 II",
83+
576: "576. 出界的路径数(只能选两个方向变成了只能选四个方向而已)",
84+
698: "698. 划分为 k 个相等的子集",
6685
743: "743. 网络延迟时间",
6786
778: "778. 水位上升的泳池中游泳",
6887
"778_desc":
6988
"DFS + 二分,类似的题目有很多,比如第 1439 题。这种题套路都很像,难度其实也不算大。",
89+
808: "808. 分汤",
90+
837: "837. 新21点",
91+
877: "877. 石子游戏",
92+
902: "902. 最大为 N 的数字组合",
93+
935: "935. 骑士拨号器(只能选两个方向变成了只能选八个方向而已)",
94+
1015: "1015. 可被 K 整除的最小整数",
7095
1109: "1109. 航班预订统计",
96+
1140: "1140. 石子游戏 II",
7197
1314: "1314. 矩阵区域和",
98+
1406: "1406. 石子游戏 III",
7299
1462: "1462. 课程表 IV",
73100
1480: "1480. 一维数组的动态和",
101+
1510: "1510. 石子游戏 IV",
102+
1563: "1563. 石子游戏 V",
74103
1584: "1584. 连接所有点的最小费用",
104+
1681: "1681. 最小不兼容性",
105+
1686: "1686. 石子游戏 VI",
106+
"1686_desc": "除了这个,其他《石子游戏》思路基本都一样",
107+
1690: "1690. 石子游戏 VII",
75108
2536: "2536. 子矩阵元素加 1",
76109

110+
// https://binarysearch.com/problems
77111
minimumLightRadius: "最小光照半径",
78112
minimumLightRadius_desc: "经典能力检测二分,力扣也有一道类似题",
79113
kthPairDistance: "第 K 小的距离对",
80-
kthPairDistance_desc: "典型的计数二分,本质上也是能力检测,只不过题量大,单独拆出来。",
114+
kthPairDistance_desc:
115+
"典型的计数二分,本质上也是能力检测,只不过题量大,单独拆出来。",
116+
increasingDigits: "递增的数位",
117+
palindromicInsertions: "回文插入",
118+
palindromicInsertions_desc:
119+
"区间 dp 需要从序列两头同时进行,而不是从序列的某一端到另一端",
120+
121+
// 剑指 Offer 系列
81122
JZ51: "剑指 Offer 51. 数组中的逆序对",
82123

124+
// 面试题系列
125+
interview17_13: "面试题 17.13. 恢复空格",
126+
interview17_13__desc:
127+
"细节怎么练?+1? -1? 怎么初始化?大家可以通过这道题学习一下~",
128+
83129
longestIncreasingSubsequence: "最长上升子序列系列",
84130
longestIncreasingSubsequence_desc: "系列经典题目,值得一做",
131+
littleRabbitsChessboard: "小兔的棋盘",
132+
shopeesOffice: "Shopee 的办公室",
85133
},
86134
codeTemplate: {
87135
name: "代码模板",
@@ -148,7 +196,6 @@ const zh = {
148196
},
149197
learningRoute: {
150198
name: "学习路线",
151-
dp: "动态规划",
152199
binarySearch: "二分查找",
153200
binarySearchDesc: `
154201
如果让我用一句话总结二分法,我会说**二分法是一种让未知世界无机可乘的算法**。即二分法无论如何我们都可以舍弃一半解,也就是无论如何都可以将解空间砍半。
@@ -184,6 +231,67 @@ const zh = {
184231
binarySearch_item5_keys: `本质也是能力检测,因此和能力检测框架基本一致,大家对比理解一下。
185232
`,
186233

234+
dp: "动态规划",
235+
dp_desc: `
236+
同一类型的不同题目框架基本一致,但细节略有不同,模板代码仅以某一种为例进行讲述,大家根据实际情况微调。
237+
238+
动态规划三把斧:状态,枚举,转移方程(选择)。对于每一种题目,我都尽量按照这三点给大家提示。
239+
240+
当然这个学习路线是给有一些基础的人看的,如果你还没有基础,可以看下相关文章,之后我也会写一篇硬核套路文。
241+
`,
242+
dp_item1: "单字符串型",
243+
dp_item1_keys1: `
244+
状态:1. dp[i] 表示以 s[i] 结尾的 xxxx
245+
2. dp[i] 表示到 s[i] 为止的 xxxx
246+
`,
247+
248+
dp_item1_keys2:
249+
"枚举:通常都是两层循环,一层循环固定左端点,另一层循环固定右端点进行枚举",
250+
dp_item1_keys3:
251+
"转移方程:根据题目选择是否和 s[j] 结合,取最大,最小或计数即可",
252+
253+
dp_item2: "双字符串型",
254+
dp_item2_keys1: `
255+
状态:1. dp[i][j] 表示以 s1[i],s2[j] 结尾的 xxxx
256+
2. dp[i][j] 表示到 s1[i],s2[j] 为止的 xxxx
257+
`,
258+
dp_item2_keys2:
259+
"枚举:通常都是两层循环,一层循环固定 s1 的右端点,另一层循环固定 s2 的右端点进行枚举",
260+
dp_item2_keys3:
261+
"状态转移:根据题目以及 s[i], s[j] 的关系,取最大,最小或计数即可",
262+
263+
dp_item3: "爬楼梯型",
264+
dp_item3_keys1: `
265+
状态:1. 一维通常是 dp[i] 表示以 nums[i] 结尾的 xxxx
266+
2. 二维通常是 dp[i][j] 表示以 grid[i][j] 结尾的 xxxx
267+
`,
268+
dp_item3_keys2:
269+
"枚举:一维就是一层循环枚举所有的 nums,二维就是两层循环枚举所有的 grid",
270+
dp_item3_keys3: `
271+
状态转移:1. 一维通常是当前格子和前面的两个格子的关系,可能是最大最小或计数。
272+
dp[i] = dp[i - 1] + dp[i - 2],这也叫递推式,因为不涉及决策。
273+
2. 二维通常是当前格子和上方以及左方的两个格子的关系,可能是最大最小或计数。
274+
dp[i][j] = dp[i - 1][j] + dp[i][j-1],这也叫递推式,因为不涉及决策。
275+
3. 根转移方程不难看出, 这种题目通常都可以滚动数组优化
276+
`,
277+
278+
dp_item4: "背包型(仅列举题目)",
279+
dp_item5: "数位型(仅列举题目)",
280+
dp_item5_keys1:
281+
"常见的 dp 定义为 dp[i][j] 其中 i 为数字的长度, j 为最后一位的数。比如 dp[3][2] 表示这个数一共三位,最后一位是 2 的情况",
282+
283+
dp_item6: "概率型(仅列举题目)",
284+
dp_item7: "博弈型(仅列举题目)",
285+
286+
dp_item8: "区间 DP",
287+
dp_item8_text_comment:
288+
"使用记忆化可能会更好书写,比如上面的 dp 代码改成记忆化递归就是:",
289+
dp_item8_keys1: `
290+
右边界倒序遍历,左边界正序遍历
291+
`,
292+
dp_item8_keys2: "通常都是返回 dp[0][n],而不是其他常见的 dp[-1][-1]",
293+
dp_item9: "状态压缩型(仅列举题目)",
294+
187295
tree: "树",
188296
linkedList: "链表",
189297
clickToEnlarge: "单击可放大",

0 commit comments

Comments
 (0)