K-Palindrome Problem Statement
Determine whether a given string str
can be considered a K-Palindrome.
A string is considered a K-Palindrome if it can be transformed into a palindrome after removing up to ‘k’ characters.
Example:
Input:
str = "ababba", k = 3
Output:
True
Explanation:
If we remove one ‘b’ from the 3rd position, the string becomes "ababa", which is a palindrome. Thus, the output is True
.
Constraints:
1 <= T <= 10
1 <= |str| <= 1000
1 <= k <= 30
- Time limit: 1 sec

AnswerBot
4mo
The problem is to determine whether a given string can be considered a K-Palindrome by removing up to 'k' characters.
Iterate through the string from both ends and check if characters match, if not inc...read more
Help your peers!
Add answer anonymously...
Uber Software Engineer interview questions & answers
A Software Engineer was asked Q. Given a read-only array, find the kth smallest element in an unordered array wit...read more
A Software Engineer was asked Q. Given a 2D matrix with some doors (D) and walls (W), how would you fill a distan...read more
A Software Engineer was asked Q. Boolean Matrix Transformation Challenge Given a 2-dimensional boolean matrix mat...read more
Popular interview questions of Software Engineer
A Software Engineer was asked 10mo agoQ1. Describe the architecture of Netflix.
A Software Engineer was asked Q2. Given a read-only array, find the kth smallest element in an unordered array wit...read more
A Software Engineer was asked Q3. Given a 2D matrix with some doors (D) and walls (W), how would you fill a distan...read more
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

