Re:World’s longest palindrome?
by kiliankoe on Friday August 10, 2018 @08:44AM
(#17732735)
I was recently dumbfounded by the fact that
is not a palindrome, but
is. It's obvious, sure, but it still doesn't look right.
[ Parent
| on HN ]
It's not obvious for me (maybe you are joking and I didn't get it)
Try substituting other symbols, which makes it easier to see. 1 for ( and 0 for ) for example.
Then we have
1010
and 1001mindblow
Re:World’s longest palindrome?
by sombremesa on Friday August 10, 2018 @12:03PM
(#17734542)
It depends on your definition of palindrome. Is it 'reads the same forwards or backwards' or is it 'had the same characters in the second half as in the first, but in reverse order'?
You'll find that according to most dictionaries, ()() is the palindrome here.
Unless you're a robot.
Try replacing ( with a and ) with b :
abab -> not palindrome
abba -> palindrome
For a second I thought you have the most fitting username ever for this discussion, but then I saw that your account has just been created :D
Re:World’s longest palindrome?
by onemoresoop on Friday August 10, 2018 @10:02AM
(#17733307)
or substitute the parans to a and b
()() --> abab
())( --> abba
)(() --> baab
We coders could get fooled by this question if we dont pay much attention