Back
Close
  • 124

Statement

 Goal

A palindrome is a sequence of letters which reads the same backward as forward, like “madam” for example.

For a given input string S, you have to return the longest palindrome found within. If multiple substrings qualify, print them all in the same order as they appear in S.
Input
Line 1: A string S (only alphanumeric)
Output
N lines: Every longest palindrome contained in S
Constraints
0 < length of S < 10000
Example
Input
madam
Output
madam
Solve it

A higher resolution is required to access the IDE

codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants