Find if a string is k-palindrome using dynamic programming technique

Опубликовано: 26 Ноябрь 2020
на канале: Joey'sTech
2,000
48

A cool addition to Joey's dynamic programming tutorial in which you need to find if a string is k-palindrome or not.

The statement of this DP problem states the following -

You are provided a string

' a b c e d b c a '

And a variable K = 2

All you need to do is to find out if the string is k-palindrome. A K-palindrome means whether this string can be converted in a palindrome by removing k or less than k characters from it.

So, you can see that if you remove 'e' and 'b' then this string becomes a palindrome hence, this string is a K-Palindrome because the number of removed characters is exactly
equal to the value of k.

This is a very interesting dynamic programming problem which is very similar to the minimum edit distance problem.
I have already made a video on the minimum edit distance problem in which I have solved it using the dynamic programming technique.

To get a better hold of the problem I recommend you to watch it first. Here is the link below -
   • Master dynamic programming with minim...  


Смотрите видео Find if a string is k-palindrome using dynamic programming technique онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Joey'sTech 26 Ноябрь 2020. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 2,000 раз и оно понравилось 48 посетителям.