3472. Longest Palindromic Subsequence After at Most K Operations
You are given a string
sand an integerk.In one operation, you can replace the character at any position with the next or previous letter in the alphabet (wrapping around so that
'a'is after'z'). For example, replacing'a'with the next letter results in'b', and replacing'a'with the previous letter results in'z'. Similarly, replacing'z'with the next letter results in'a', and replacing'z'with the previous letter results in'y'.Return the length of the longest palindromic subsequence of
sthat can be obtained after performing at mostkoperations.
1 | int dp[202][202][202]; |