Skip to content

Commit bf5369f

Browse files
committed
update
1 parent 5145c28 commit bf5369f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

✅ Pattern 15: 0-1 Knapsack (Dynamic Programming).md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3797,26 +3797,26 @@ console.log(
37973797
### Similar problems
37983798
Here are a couple of similar problems:
37993799
3800-
#### 1. Minimum insertions in a string to make it a palindrome
3800+
## 1. Minimum insertions in a string to make it a palindrome
38013801
https://leetcode.com/problems/minimum-insertion-steps-to-make-a-string-palindrome/
38023802
38033803
Will the above approach work if we make insertions instead of deletions?
38043804
38053805
Yes, the length of the <b>Longest Palindromic Subsequence</b> is the best <i>palindromic subsequence</i> we can have. Let’s take a few examples:
38063806
3807-
##### Example 1:
3807+
### Example 1:
38083808
```js
38093809
Input: "abdbca"
38103810
Output: 1
38113811
Explanation: By inserting “c”, we get a palindrome “acbdbca”.
38123812
```
3813-
##### Example 2:
3813+
### Example 2:
38143814
```js
38153815
Input: = "cddpd"
38163816
Output: 2
38173817
Explanation: Inserting “cp”, we get a palindrome “cdpdpdc”. We can also get a palindrome by inserting “dc”: “cddpddc”
38183818
```
3819-
##### Example 3:
3819+
### Example 3:
38203820
```js
38213821
Input: = "pqr"
38223822
Output: 2
@@ -3887,7 +3887,7 @@ console.log(
38873887
// Output: 5
38883888
// Explanation: Inserting 5 characters the string becomes "leetcodocteel".
38893889
```
3890-
#### 2. Find if a string is K-Palindromic
3890+
## 2. Find if a string is K-Palindromic
38913891
https://leetcode.com/problems/valid-palindrome-iii/
38923892
38933893
Any string will be called `K`<b>-palindromic</b> if it can be transformed into a <i>palindrome</i> by removing at most `K` characters from it.

0 commit comments

Comments
 (0)