From 90cdcc22b3f79690dd483862364416ce672af16e Mon Sep 17 00:00:00 2001 From: yanglbme Date: Tue, 28 Jan 2025 20:42:49 +0800 Subject: [PATCH] feat: update lc problems --- .../0119.Pascal's Triangle II/README.md | 18 ++ .../0119.Pascal's Triangle II/README_EN.md | 18 ++ .../0119.Pascal's Triangle II/Solution.js | 13 ++ .../README_EN.md | 2 +- .../README_EN.md | 4 +- .../3425.Longest Special Path/README_EN.md | 2 +- .../README_EN.md | 1 + .../README_EN.md | 4 +- .../README_EN.md | 6 +- .../3429.Paint House IV/README_EN.md | 1 + .../README_EN.md | 4 +- .../README.md | 61 +++--- .../README_EN.md | 3 + .../README.md | 199 ++++++++++++++++++ .../README_EN.md | 197 +++++++++++++++++ .../Solution.cpp | 15 ++ .../Solution.go | 14 ++ .../Solution.java | 17 ++ .../Solution.py | 9 + .../Solution.ts | 11 + .../3433.Count Mentions Per User/README.md | 161 ++++++++++++++ .../3433.Count Mentions Per User/README_EN.md | 159 ++++++++++++++ .../README.md | 111 ++++++++++ .../README_EN.md | 106 ++++++++++ .../README.md | 122 +++++++++++ .../README_EN.md | 115 ++++++++++ solution/CONTEST_README.md | 7 + solution/CONTEST_README_EN.md | 7 + solution/README.md | 6 +- solution/README_EN.md | 6 +- solution/contest.json | 2 +- 31 files changed, 1361 insertions(+), 40 deletions(-) create mode 100644 solution/0100-0199/0119.Pascal's Triangle II/Solution.js create mode 100644 solution/3400-3499/3432.Count Partitions with Even Sum Difference/README.md create mode 100644 solution/3400-3499/3432.Count Partitions with Even Sum Difference/README_EN.md create mode 100644 solution/3400-3499/3432.Count Partitions with Even Sum Difference/Solution.cpp create mode 100644 solution/3400-3499/3432.Count Partitions with Even Sum Difference/Solution.go create mode 100644 solution/3400-3499/3432.Count Partitions with Even Sum Difference/Solution.java create mode 100644 solution/3400-3499/3432.Count Partitions with Even Sum Difference/Solution.py create mode 100644 solution/3400-3499/3432.Count Partitions with Even Sum Difference/Solution.ts create mode 100644 solution/3400-3499/3433.Count Mentions Per User/README.md create mode 100644 solution/3400-3499/3433.Count Mentions Per User/README_EN.md create mode 100644 solution/3400-3499/3434.Maximum Frequency After Subarray Operation/README.md create mode 100644 solution/3400-3499/3434.Maximum Frequency After Subarray Operation/README_EN.md create mode 100644 solution/3400-3499/3435.Frequencies of Shortest Supersequences/README.md create mode 100644 solution/3400-3499/3435.Frequencies of Shortest Supersequences/README_EN.md diff --git a/solution/0100-0199/0119.Pascal's Triangle II/README.md b/solution/0100-0199/0119.Pascal's Triangle II/README.md index 5009baf0ed36d..36cb5a2edf1df 100644 --- a/solution/0100-0199/0119.Pascal's Triangle II/README.md +++ b/solution/0100-0199/0119.Pascal's Triangle II/README.md @@ -174,6 +174,24 @@ impl Solution { } ``` +#### JavaScript + +```js +/** + * @param {number} rowIndex + * @return {number[]} + */ +var getRow = function (rowIndex) { + const f = Array(rowIndex + 1).fill(1); + for (let i = 2; i < rowIndex + 1; ++i) { + for (let j = i - 1; j; --j) { + f[j] += f[j - 1]; + } + } + return f; +}; +``` + diff --git a/solution/0100-0199/0119.Pascal's Triangle II/README_EN.md b/solution/0100-0199/0119.Pascal's Triangle II/README_EN.md index 625760e327d21..9db4a441dbf59 100644 --- a/solution/0100-0199/0119.Pascal's Triangle II/README_EN.md +++ b/solution/0100-0199/0119.Pascal's Triangle II/README_EN.md @@ -156,6 +156,24 @@ impl Solution { } ``` +#### JavaScript + +```js +/** + * @param {number} rowIndex + * @return {number[]} + */ +var getRow = function (rowIndex) { + const f = Array(rowIndex + 1).fill(1); + for (let i = 2; i < rowIndex + 1; ++i) { + for (let j = i - 1; j; --j) { + f[j] += f[j - 1]; + } + } + return f; +}; +``` + diff --git a/solution/0100-0199/0119.Pascal's Triangle II/Solution.js b/solution/0100-0199/0119.Pascal's Triangle II/Solution.js new file mode 100644 index 0000000000000..d2f856fe06d7d --- /dev/null +++ b/solution/0100-0199/0119.Pascal's Triangle II/Solution.js @@ -0,0 +1,13 @@ +/** + * @param {number} rowIndex + * @return {number[]} + */ +var getRow = function (rowIndex) { + const f = Array(rowIndex + 1).fill(1); + for (let i = 2; i < rowIndex + 1; ++i) { + for (let j = i - 1; j; --j) { + f[j] += f[j - 1]; + } + } + return f; +}; diff --git a/solution/1900-1999/1987.Number of Unique Good Subsequences/README_EN.md b/solution/1900-1999/1987.Number of Unique Good Subsequences/README_EN.md index d833d26e858ab..2753ba35ba6b6 100644 --- a/solution/1900-1999/1987.Number of Unique Good Subsequences/README_EN.md +++ b/solution/1900-1999/1987.Number of Unique Good Subsequences/README_EN.md @@ -54,7 +54,7 @@ The unique good subsequences are "1" and "11".
 Input: binary = "101"
 Output: 5
-Explanation: The good subsequences of binary are ["1", "0", "1", "10", "11", "101"].
+Explanation: The good subsequences of binary are ["1", "0", "1", "10", "11", "101"]. 
 The unique good subsequences are "0", "1", "10", "11", and "101".
 
diff --git a/solution/3400-3499/3424.Minimum Cost to Make Arrays Identical/README_EN.md b/solution/3400-3499/3424.Minimum Cost to Make Arrays Identical/README_EN.md index 4988df8d5dd61..fb0c3dc80f5a1 100644 --- a/solution/3400-3499/3424.Minimum Cost to Make Arrays Identical/README_EN.md +++ b/solution/3400-3499/3424.Minimum Cost to Make Arrays Identical/README_EN.md @@ -17,7 +17,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3424.Mi

You are given two integer arrays arr and brr of length n, and an integer k. You can perform the following operations on arr any number of times: