@cubking, as to abcdefghba, the longest palindrome is only one character long. If it were abba, then the longest palindrome would be of length 4. If it were aa or bb, then the longest palindrome would be of length 2. I hope this helps.
abcdefghba
abba
aa
bb
.
I got 2
The return value of the parameter abcdefghba should be 2.
Loading collection data...
@cubking, as to
abcdefghba
, the longest palindrome is only one character long.If it were
abba
, then the longest palindrome would be of length 4.If it were
aa
orbb
, then the longest palindrome would be of length 2.I hope this helps.
.
I got 2
The return value of the parameter abcdefghba should be 2.