Skip to content

Commit 487511b

Browse files
committed
Runtime: 183 ms (Top 100.00%) | Memory: 52.8 MB (Top 44.44%)
1 parent d44c3c0 commit 487511b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/algorithms/U/Unique Length-3 Palindromic Subsequences/Unique Length-3 Palindromic Subsequences.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 183 ms (Top 100.00%) | Memory: 52.8 MB (Top 44.44%)
12
var countPalindromicSubsequence = function(s) {
23
const charToIndices = {};
34
for (let i = 0; i < s.length; i++) {
@@ -8,14 +9,14 @@ var countPalindromicSubsequence = function(s) {
89
charToIndices[char] = [i];
910
}
1011
}
11-
12+
1213
let count = 0;
1314
for (const currChar in charToIndices) {
1415
if (charToIndices[currChar].length < 2) continue;
1516
const currCharIndices = charToIndices[currChar];
1617
const firstIndex = currCharIndices[0];
1718
const lastIndex = currCharIndices[currCharIndices.length - 1];
18-
19+
1920
for (const char in charToIndices) {
2021
const indices = charToIndices[char];
2122
let lo = 0;
@@ -34,4 +35,4 @@ var countPalindromicSubsequence = function(s) {
3435
}
3536
}
3637
return count;
37-
};
38+
};

0 commit comments

Comments
 (0)