Skip to content

Commit 9e4b3ce

Browse files
committedApr 7, 2023
feat: update solutions to lc problem: No.2399, No.2404
1 parent e1b448c commit 9e4b3ce

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed
 

‎solution/2300-2399/2399.Check Distances Between Same Letters/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ function checkDistances(s: string, distance: number[]): boolean {
156156
const d: number[] = new Array(26).fill(0);
157157
for (let i = 1; i <= n; ++i) {
158158
const j = s.charCodeAt(i - 1) - 97;
159-
if (d[j] && i - d[j] - 1 != distance[j]) {
159+
if (d[j] && i - d[j] - 1 !== distance[j]) {
160160
return false;
161161
}
162162
d[j] = i;

‎solution/2300-2399/2399.Check Distances Between Same Letters/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function checkDistances(s: string, distance: number[]): boolean {
142142
const d: number[] = new Array(26).fill(0);
143143
for (let i = 1; i <= n; ++i) {
144144
const j = s.charCodeAt(i - 1) - 97;
145-
if (d[j] && i - d[j] - 1 != distance[j]) {
145+
if (d[j] && i - d[j] - 1 !== distance[j]) {
146146
return false;
147147
}
148148
d[j] = i;

‎solution/2300-2399/2399.Check Distances Between Same Letters/Solution.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ function checkDistances(s: string, distance: number[]): boolean {
33
const d: number[] = new Array(26).fill(0);
44
for (let i = 1; i <= n; ++i) {
55
const j = s.charCodeAt(i - 1) - 97;
6-
if (d[j] && i - d[j] - 1 != distance[j]) {
6+
if (d[j] && i - d[j] - 1 !== distance[j]) {
77
return false;
88
}
99
d[j] = i;

‎solution/2400-2499/2404.Most Frequent Even Element/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ function mostFrequentEven(nums: number[]): number {
153153
let ans = -1;
154154
let mx = 0;
155155
for (const [x, v] of cnt) {
156-
if (mx < v || (mx == v && ans > x)) {
156+
if (mx < v || (mx === v && ans > x)) {
157157
ans = x;
158158
mx = v;
159159
}

‎solution/2400-2499/2404.Most Frequent Even Element/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function mostFrequentEven(nums: number[]): number {
140140
let ans = -1;
141141
let mx = 0;
142142
for (const [x, v] of cnt) {
143-
if (mx < v || (mx == v && ans > x)) {
143+
if (mx < v || (mx === v && ans > x)) {
144144
ans = x;
145145
mx = v;
146146
}

‎solution/2400-2499/2404.Most Frequent Even Element/Solution.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function mostFrequentEven(nums: number[]): number {
88
let ans = -1;
99
let mx = 0;
1010
for (const [x, v] of cnt) {
11-
if (mx < v || (mx == v && ans > x)) {
11+
if (mx < v || (mx === v && ans > x)) {
1212
ans = x;
1313
mx = v;
1414
}

0 commit comments

Comments
 (0)