Skip to content

Commit 0ab91e2

Browse files
authored
Update 1717-maximum-score-from-removing-substrings.js
1 parent b80cc29 commit 0ab91e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

1717-maximum-score-from-removing-substrings.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ const maximumGain = function (s, x, y) {
99
}
1010

1111
function go(s, x, y, a, b) {
12-
let n = s.length
12+
const n = s.length
1313
const st = new Array(n)
1414
let sc = 0
1515
let p = 0
1616
for (let c of s) {
17-
if (p - 1 >= 0 && st[p - 1] == a && c == b) {
17+
if (p - 1 >= 0 && st[p - 1] === a && c === b) {
1818
sc += x
1919
p--
2020
} else {
@@ -25,7 +25,7 @@ function go(s, x, y, a, b) {
2525
let q = 0
2626
for (let u = 0; u < p; u++) {
2727
let c = st[u]
28-
if (q - 1 >= 0 && st2[q - 1] == b && c == a) {
28+
if (q - 1 >= 0 && st2[q - 1] === b && c === a) {
2929
sc += y
3030
q--
3131
} else {

0 commit comments

Comments
 (0)