[问题] LeetCode 最长回文子字串

楼主: ken1325 (优质水瓶男)   2017-12-09 23:57:38
LeetCode 5. Longest Palindromic Substring
https://leetcode.com/problems/longest-palindromic-substring/description/
Given a string s, find the longest palindromic substring in s. You may assume
that the maximum length of s is 1000.
这题要在一个字串里面找出最长的子字串
https://paste.ofcode.org/WpkzvXdgCx2zXJGhULWYtm
这是我用暴力法写的,但是submit后他说有 Wrong Answer
我不知道错在哪里
有人能帮我看看吗?
感谢
作者: ckc1ark (伪物)   2017-12-10 00:04:00
try "ab"
楼主: ken1325 (优质水瓶男)   2017-12-10 00:09:00
喔喔,感谢。
作者: alan23273850   2017-12-11 11:41:00
如果是leetcode的话应该要用dp吧?
作者: suhorng ( )   2017-12-12 07:07:00
中心扩展法是暴力法吧
作者: oToToT (屁孩)   2017-12-13 16:44:00
他的暴力大概是直接拆下来后字串比较吧

Links booklink

Contact Us: admin [ a t ] ucptt.com