File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * 5319. Remove Palindromic Subsequences
3
+ * https://leetcode.com/problems/remove-palindromic-subsequences/
4
+ * Difficulty: Easy
5
+ *
6
+ * Given a string s consisting only of letters 'a' and 'b'.
7
+ * In a single step you can remove one palindromic subsequence from s.
8
+ *
9
+ * Return the minimum number of steps to make the given string empty.
10
+ * A string is a subsequence of a given string, if it is generated by
11
+ * deleting some characters of a given string without changing its order.
12
+ *
13
+ * A string is called palindrome if is one that reads the same backward
14
+ * as well as forward.
15
+ */
16
+
17
+ /**
18
+ * @param {string } s
19
+ * @return {number }
20
+ */
21
+ var removePalindromeSub = function ( s ) {
22
+ return s . length === 0 ? 0 : ( s . split ( '' ) . reverse ( ) . join ( '' ) === s ? 1 : 2 ) ;
23
+ } ;
Original file line number Diff line number Diff line change 63
63
1318|[ Minimum Flips to Make a OR b Equal to c] ( ./1318-minimum-flips-to-make-a-or-b-equal-to-c.js ) |Medium|
64
64
1323|[ Maximum 69 Number] ( ./1323-maximum-69-number.js ) |Easy|
65
65
1324|[ Print Words Vertically] ( ./1324-print-words-vertically.js ) |Medium|
66
+ 5319|[ Remove Palindromic Subsequences] ( ./5319-remove-palindromic-subsequences.js ) |Easy|
66
67
5320|[ Filter Restaurants by Vegan-Friendly, Price and Distance] ( ./5320-filter-restaurants-by-vegan-friendly-price-and-distance.js ) |Medium|
67
68
68
69
## License
You can’t perform that action at this time.
0 commit comments