+ 7

[CHALLENGE] HOW GOOD ARE YOU AT HANDLING STRINGS?

Given a string.Find the length of the longest palindrome contained in the string. i.e. find the length of the longest palindromic substring from a given string. For example: string: helloworld o/p:3 explanation:owo is the palindromic substring. EFFICIENT CODE EXPECTED ALL LANGUAGES ARE WELCOMED

22nd Dec 2017, 9:53 AM
Abdul Sattar Mapara
13 Answers
+ 2
recently i found an O(n) algorithm called manacher's algorithm...check it out...its the most efficient algorithm..i couldn't understand it by the way...
11th Jan 2018, 2:54 PM
Abdul Sattar Mapara
+ 18
You'll love it, it works for numbers, letters, symbols. Accurate!! https://code.sololearn.com/cSCQ0bvG4LsS/?ref=app
22nd Dec 2017, 5:00 PM
Justine Ogaraku
Justine Ogaraku - avatar
+ 14
Challenge Accepted!! 😎😂
22nd Dec 2017, 3:55 PM
Justine Ogaraku
Justine Ogaraku - avatar
+ 11
Here's a short Python code (case ignored and all characters accepted) https://code.sololearn.com/coaFVdn2nbuI/?ref=app
22nd Dec 2017, 12:40 PM
David Ashton
David Ashton - avatar
+ 11
https://code.sololearn.com/cfbVeNQrv0cD/?ref=app
22nd Dec 2017, 4:54 PM
Käzî Mrîdùl Høssäîn
Käzî Mrîdùl Høssäîn - avatar
22nd Dec 2017, 10:53 AM
LukArToDo
LukArToDo - avatar
+ 8
https://code.sololearn.com/cDwOE90HR121/?ref=app
22nd Dec 2017, 10:34 PM
Marfik Em
Marfik Em - avatar
+ 7
Is "casac" considered a palindrome or it must be inside de string ("asa").
22nd Dec 2017, 4:29 PM
Marfik Em
Marfik Em - avatar
+ 6
@Abdul Sattar Mapara Thank you. Then I'll start doing mine.
22nd Dec 2017, 4:48 PM
Marfik Em
Marfik Em - avatar
22nd Dec 2017, 10:46 AM
Jonas Schröter
Jonas Schröter - avatar
+ 3
I wonder if theres a more efficient solution. https://code.sololearn.com/W3XNcAA3jrbk/?ref=app
22nd Dec 2017, 11:15 AM
Schindlabua
Schindlabua - avatar
+ 3
Everybody is following the same track.so now I am confused whom to give the tick...! btw I was expecting an O(n^2) algorithm.Those of u don't know the Big-Oh notation surf the internet and find it out.Its pretty simple and useful for computer science students. Hope for more response!Thank You everyone.
22nd Dec 2017, 6:16 PM
Abdul Sattar Mapara
+ 2
@Marfik Em casac is a palindrome and the o/p counts it as well for a string that doesnot have palindrome the o/p should be 1 i.e 1 character is always a palindrome
22nd Dec 2017, 4:42 PM
Abdul Sattar Mapara