6 kyu

Palindrome Builder

Description:

Task

Given a string, add the fewest number of characters possible from the front or back to make it a palindrome.

Example

For the input cdcab, the output should be bacdcab

Input/Output

Input is a string consisting of lowercase latin letters with length 3 <= str.length <= 10

The output is a palindrome string satisfying the task.

For s = ab either solution (aba or bab) will be accepted.

Algorithms

More By Author:

Check out these other kata created by wontonst

Stats:

CreatedApr 13, 2017
PublishedApr 13, 2017
Warriors Trained737
Total Skips15
Total Code Submissions2791
Total Times Completed194
Python Completions194
Total Stars29
% of votes with a positive feedback rating93% of 63
Total "Very Satisfied" Votes55
Total "Somewhat Satisfied" Votes7
Total "Not Satisfied" Votes1
Total Rank Assessments10
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • wontonst Avatar
  • MattSchmitz Avatar
  • G_kuldeep Avatar
Ad