Minimum number of deletions to make a string palindrome || Python || Top Down || Dynamic Programming

Опубликовано: 15 Сентябрь 2022
на канале: Mohit Bodhija
498
2

Given a string of size ‘n’. The task is to remove or delete the minimum number of characters from the string so that the resultant string is a palindrome.

Note: The order of characters should be maintained.

Examples :

Input : aebcbda
Output : 2
Remove characters 'e' and 'd'
Resultant string will be 'abcba'
which is a palindromic string