6 kyu
Single character palindromes
727 of 2,136KenKamau
Description:
You will be given a string and you task is to check if it is possible to convert that string into a palindrome by removing a single character. If the string is already a palindrome, return "OK"
. If it is not, and we can convert it to a palindrome by removing one character, then return "remove one"
, otherwise return "not possible"
. The order of the characters should not be changed.
For example:
solve("abba") = "OK". -- This is a palindrome
solve("abbaa") = "remove one". -- remove the 'a' at the extreme right.
solve("abbaab") = "not possible".
More examples in the test cases.
Good luck!
If you like this Kata, please try Single Character Palindromes II
Algorithms
Similar Kata:
Stats:
Created | Dec 9, 2017 |
Published | Dec 15, 2017 |
Warriors Trained | 3895 |
Total Skips | 90 |
Total Code Submissions | 10207 |
Total Times Completed | 2136 |
JavaScript Completions | 727 |
Python Completions | 808 |
Ruby Completions | 97 |
Haskell Completions | 47 |
C++ Completions | 143 |
Java Completions | 200 |
C# Completions | 152 |
Rust Completions | 56 |
Total Stars | 66 |
% of votes with a positive feedback rating | 93% of 448 |
Total "Very Satisfied" Votes | 392 |
Total "Somewhat Satisfied" Votes | 50 |
Total "Not Satisfied" Votes | 6 |
Total Rank Assessments | 11 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |