Given string s and an integer, you have to transform s into a palindrome. In order to achieve that you have to perform exactly k insertion of characters(you cannot perform anymore or less number of insertions). The task is to check if the string can be converted to a palindrome by making exactly k insertions.
Input: s = "abac", K = 2 Output: 1 Explanation: "abac" can be transformed to "cabbac" (which is palindrome) adding two characters c and b.
Input: s = "abcde", K = 3 Output: 0 Explanation: "abcde" cannot be transformed to palindrome using 3 insertions.
isPossiblePalindrome() which takes s and K as input parameters and returns a boolean value
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.