| about | help | code help+videos | done | prefs |
longest_subpalindrome
Given a string, what substring of it forms the longest palindrome? For this problem, unlike the previous palindrome problem, we're looking for an exact match palindrome: spaces and punctuation counts, and an upper-case letter is different from a lower-case. Write longest_subpalindrome(string) to return the longest palindrome substring. See if you can make it relatively efficient. longest_subpalindrome('hello, world') → 'll' longest_subpalindrome('radar racecar') → 'racecar' longest_subpalindrome('when in the course of human events it becomes necessary') → 'eve' ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 231 Post-solution available
Copyright Nick Parlante 2017 - privacy