+ 15
CHALLENGE: LONGEST PALINDROMIC SUBSTRING 💻⌨️🖱️
Write a code that finds the longest palindromic substring of a given string. If the result is more than one longest palindromic substring, show all (longest). Also show and if there is no palindromic substring. Note: palindromic substring must contain at least two letters. Example: Input: sololearn Output: olo, length:3 lol, length:3 Input: playground Output : can't find any palindromic substring All languages are welcome! 👍
15 odpowiedzi
+ 8
Here's my try for example :
https://code.sololearn.com/cMywndmfbuLQ/?ref=app
+ 8
Do you mean that the substring should be symmetric with at least two letters? Did I understand it correctly?
+ 8
@codasan.com
Palindromic substring means that the substring is the same when read from left to right and from right to left.
For example : b, aa, ana, ceec,...
In this task, palindromic substring need contain at least two letters. That mean that "b" is not valid result.
I hope that helps 😊
+ 8
@codasan.com
Ok buddy. Thanks 😊
+ 7
Here is my try in Java.
https://code.sololearn.com/cfF71wqb2u4V
+ 5
Thanks @LukArToDo, I'll try it.
+ 3
heres it ## one liner//
@@ vcc
$ coded by Vcc .. tiny modifications by Sayan Chandra $
https://code.sololearn.com/c6Fvd52MmSyP/?ref=app
+ 2
+ 2
functional one liner###
https://code.sololearn.com/cyUMVq2B91WS/?ref=app
+ 2
My try here:
https://code.sololearn.com/cktyqkba9K0S/?ref=app
+ 1
@sayan any will to oneline this one ?
https://code.sololearn.com/cs8YxxsT4rJF/?ref=app
+ 1
You can never have enough codes that do the same thing, this is mine:
https://code.sololearn.com/cHaQVs2leMU5/?ref=app
0
Deals with multiple maxsize palindroms. https://code.sololearn.com/cs8YxxsT4rJF/?ref=app