We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7430c70 commit 5eb95f1Copy full SHA for 5eb95f1
scripts/algorithms/P/Palindrome Partitioning II/Palindrome Partitioning II.js
@@ -1,11 +1,12 @@
1
+// Runtime: 1073 ms (Top 40.58%) | Memory: 43.7 MB (Top 82.61%)
2
var minCut = function(s) {
3
function isPal(l, r) {
4
while (l < r) {
5
if (s[l] === s[r]) l++, r--;
6
else return false;
7
} return true;
8
}
-
9
+
10
let map = new Map();
11
function dfs(idx = 0) {
12
if (idx === s.length) return 0;
@@ -19,4 +20,4 @@ var minCut = function(s) {
19
20
21
22
return dfs() - 1;
-};
23
+};
0 commit comments