Skip to content

Commit 96480bc

Browse files
authored
fix: js code
1 parent bbd1f58 commit 96480bc

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

solution/2400-2499/2466.Count Ways To Build Good Strings/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,16 @@ function countGoodStrings(low: number, high: number, zero: number, one: number):
225225
#### JavaScript
226226

227227
```js
228+
/**
229+
* @param {number} low
230+
* @param {number} high
231+
* @param {number} zero
232+
* @param {number} one
233+
* @return {number}
234+
*/
228235
function countGoodStrings(low, high, zero, one) {
229236
const mod = 10 ** 9 + 7;
230-
const f[] = new Array(high + 1).fill(0);
237+
const f = Array(high + 1).fill(0);
231238
f[0] = 1;
232239

233240
for (let i = 1; i <= high; i++) {

solution/2400-2499/2466.Count Ways To Build Good Strings/README_EN.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,16 @@ function countGoodStrings(low: number, high: number, zero: number, one: number):
225225
#### JavaScript
226226

227227
```js
228+
/**
229+
* @param {number} low
230+
* @param {number} high
231+
* @param {number} zero
232+
* @param {number} one
233+
* @return {number}
234+
*/
228235
function countGoodStrings(low, high, zero, one) {
229236
const mod = 10 ** 9 + 7;
230-
const f[] = new Array(high + 1).fill(0);
237+
const f = Array(high + 1).fill(0);
231238
f[0] = 1;
232239

233240
for (let i = 1; i <= high; i++) {

solution/2400-2499/2466.Count Ways To Build Good Strings/Solution2.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
/**
2+
* @param {number} low
3+
* @param {number} high
4+
* @param {number} zero
5+
* @param {number} one
6+
* @return {number}
7+
*/
18
function countGoodStrings(low, high, zero, one) {
29
const mod = 10 ** 9 + 7;
3-
const f[] = new Array(high + 1).fill(0);
10+
const f = Array(high + 1).fill(0);
411
f[0] = 1;
512

613
for (let i = 1; i <= high; i++) {

0 commit comments

Comments
 (0)