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!
Select
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
Uber Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
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

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits