Skip to content

Commit 2cf6335

Browse files
committed
Added Function
1 parent 1e8e4f3 commit 2cf6335

File tree

1 file changed

+14
-0
lines changed
  • Remove Palindromic Subsequences

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* @param {string} s
3+
* @return {number}
4+
*/
5+
var removePalindromeSub = function(s) {
6+
7+
if (s.length === 0) return 0;
8+
for (let left = 0, right = s.length - 1; left < right; ++left, --right) {
9+
if (s[left] !== s[right]) return 2;
10+
}
11+
return 1;
12+
13+
};
14+

0 commit comments

Comments
 (0)