Welcome to the daily solving of our PROBLEM OF THE DAY with Yash Dwivedi. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Dynamic Programming but also build up problem-solving skills.
In this problem, a string str of length n, find if the string is K-Palindrome or not. A k-palindrome string transforms into a palindrome on removing at most k characters from it.
Example :
Input: str = "abcdecba"
n = 8, k = 1
Output: 1
Explaination: By removing 'd' or 'e'
we can make it a palindrome.
Give the problem a try before going through the video. All the best!!!
Problem Link: https://www.geeksforgeeks.org/problems/find-if-string-is-k-palindrome-or-not1923/1
Solution IDE Link: https://ide.geeksforgeeks.org/online-cpp14-compiler/468a9633-17e8-4dc0-b942-a09f69db9c7b