Skip to content

Commit 01e8403

Browse files
committed
Runtime: 59 ms (Top 53.19%) | Memory: 15.1 MB (Top 86.23%)
1 parent 03efd78 commit 01e8403

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/algorithms/L/Longest Happy Prefix/Longest Happy Prefix.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 59 ms (Top 53.19%) | Memory: 15.1 MB (Top 86.23%)
12
class Solution {
23
public:
34
string longestPrefix(string s) {
@@ -20,9 +21,9 @@ class Solution {
2021
else{
2122
prevLPS = arr[prevLPS - 1];
2223
}
23-
}
24+
}
2425
int oplen = arr[n-1];
2526
string temp = s.substr(n - oplen, oplen);
2627
return temp;
2728
}
28-
};
29+
};

0 commit comments

Comments
 (0)