top of page

### Looking to master object-oriented and system design for tech interviews or career growth?

• Improve your system design and machine coding skills.

• Study with our helpful resources.

**We're in beta mode and would love to hear your feedback.

Search

# Minimum Appends for Palindrome! - InterviewBit Solution

Problem: Minimum Appends for Palindrome!

### Problem Description

Given a string A consisting of lowercase characters.

We need to tell minimum characters to be appended (insertion at end) to make the string A a palindrome.

### Problem Constraints

1 <= |A| <= 105

A consists only of lower-case characters.

### Input Format

First argument is an string A.

### Output Format

Return a integer denoting the minimum characters to be appended (insertion at end) to make the string A a palindrome.

Input 1:

A = "abede"

Input 2:

A = "aabb"

Output 1:

2

Output 2:

2

### Example Explanation

Explanation 1:

We can make string palindrome as "abedeba" by adding ba at the end of the string.

Explanation 2:

We can make string palindrome as "aabbaa" by adding aa at the end of the string.

Solution Approach:

Solution:

Code in CPP

If you have any questions or queries, feel free to drop a comment in the comments section below.