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: