7 ms·
World’s longest palindrome?
- AndrewOMartin 8y ago"A man, a plan, a canoe, pasta, heros, rajahs, a coloratura, maps, snipe, percale, macaroni, a gag, a banana bag, a tan, a tag, a banana bag again (or a camel), a crepe, pins, Spam, a rut, a Rolo, cash, a jar, sore hats, a peon, a canal-- Panama!" - Guy Steele, CLTL2
- DonaldFisk 8y agoSome years after the faked death of John Darwin, who disappeared after rowing out to sea in his canoe, and was planning to start a new life with his wife in Panama with the insurance payout, the Grauniad had the headline "A man. A plan. A canoe. Panama" in an article (https://www.theguardian.com/uk/2008/jul/23/canoe.ukcrime1 https://www.theguardian.com/uk/2008/jul/23/canoe.ukcrime1) about the case.
- AndrewOMartin 8y agoHe could have at least had the good decency to have used a KayaK.
- thorin 8y agoPretty sure it was a kayak. People in the UK are very confused by the difference. E.g. British Canoe Union largely supports kayaking. I tend to use the terms interchangeably having been an active kayaker for around 25 years. The British public really struggle with the difference.
- elwell 8y agoGo hang a salami, I'm a lasagna hog.
- hcs 8y agoSo many dynamos
- sp332 8y ago"Dammit, I'm mad..." https://quotereference.wordpress.com/2014/12/11/dammit-im-mad/ https://quotereference.wordpress.com/2014/12/11/dammit-im-ma... PS I converted this into three palindromic tweets https://twitter.com/sep332/status/928484353310711808 https://twitter.com/sep332/status/928484353310711808
- chipuni 8y agoWorld's shortest palindrome:
- ehonda 8y agowo nemo toss a lasso to me now!
- psalminen 8y agoHug of death?
- myroon5 8y agohttps://web.archive.org/web/20180809171552/http://www.pinchofintelligence.com/worlds-longest-palindrome/ https://web.archive.org/web/20180809171552/http://www.pincho...
- deleted 8y ago[deleted]
- lazycouchpotato 8y agoThere's a link which takes you to the list of palindrome dates mentioned on the website [1]. There's 38 of them, but they all take the MM/DD/YYYY format into consideration. I wonder how much of a difference it would be by taking DD/MM/YYYY instead. [1] https://www.livescience.com/33583-palindrome-dates-21st-century-weird.html https://www.livescience.com/33583-palindrome-dates-21st-cent...
- interfixus 8y agoOr YYYY-MM-DD as a few of us obsessive smallendians keep insisting.
- lazycouchpotato 8y agoHeh, they'd just be the reverse of DD-MM-YYYY :) But yes, YYYY-MM-DD all the way. It's indispensable to me when sorting file names by date.
- marzell 8y agoHow does this count as a palindrome? It's just a bunch of nonsense words (ignoring all the acronyms, are the rest all actually even really words?) separated by commas, that doesn't even seem to pretend to take on the structure of a sentence. Am I misunderstanding the level of coherence of the text? If the requirements are that loose, it seems it would be trivial to generate a 'palindrome' of arbitrary length.
- xamuel 8y agoThink of it like an ad slogan. "A man, a plan, a canal-- [you should book a trip to] Panama[, a country whose history is summed up by this witty list of things]!" What I'd like to see is a version where instead of optimizing just for length, the palindrome is optimized for noun-phrases that genuinely have legit connections to Panama (as the brilliant original, "a plan, a man, a canal", does).
- marzell 8y agoApologies, I was actually referring to the very large (6MB!) palindrome text file [0] provided if you follow the article link to the GitHub project [1]. I guess the palindrome of discussion in this link is somewhat ambiguous, because there's not one specific palindrome that the article refers to. [0] https://raw.githubusercontent.com/rmeertens/palindromes/master/longest_palindrome.txt https://raw.githubusercontent.com/rmeertens/palindromes/mast... [1] https://github.com/rmeertens/palindromes https://github.com/rmeertens/palindromes
- xamuel 8y agoIt's the same thing. "A man, a plan, (6MB worth of other junk)-- Panama!" It's questionable what that other junk has to do with Panama. But grammatically, the structure is the same.
- deleted 8y ago[deleted]
- white-flame 8y agoRotavator
- quickthrower2 8y agoAda
- SippinLean 8y agoI was a fan of this palindromic short story (also in honor of the year 2002): http://spinelessbooks.com/2002/palindrome/ http://spinelessbooks.com/2002/palindrome/
- evilolive 8y agoengage le jeu que je le gagne
- imtringued 8y agoThis palindrome is surprisingly disappointing. Almost every word appears 100s of times...
- User23 8y agoWe used find the longest palindrome in a string as an interview question at Amazon back in 2004
- alexthehurst 8y agoDid you require a certain time complexity? I came across this on Leetcode. I found it really trivial to implement the “test all substrings” algorithm, but fiendishly difficult to implement the “expand around centers” algorithm.
- fjsolwmv 8y agoThat's why trick puzzle questions are bad interview questions. Some people have read the centers algorithm
- User23 8y agoIt’s not a trick question. It’s just writing a loop any CS graduate or equivalent autodidact should have absolutely no problem with. We didn’t require any specific time or space complexity. If the candidate whipped out a suboptimal solution quickly and correctly and time permitted we might ask them about that though and how it might be improved. The purpose of the question is not to see if the candidate has memorized the answer or sees a trick, it’s so they can demonstrate basic proficiency and systematic reasoning.
- techbio 8y ago"Never odd or even" is one some here might like to see, and perhaps suggests the shorter palindrome, "NaN".
- asimjalis 8y agoSee banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, bees. For any N "See [banana,]* bees." can be longer than N.
- LearnerHerzog 8y agoI thought the point of palindromes were that they 1: Are the same forwards and backwards 2: Make coherent sense Still pretty cool nonetheless, I suppose
- nathell 8y agoHere's a handcrafted one in Polish, 33K+ characters: http://www.palindromy.pl/pal_naj.php http://www.palindromy.pl/pal_naj.php
- nathell 8y agoI'm also reminded of this IOCCC entry: https://www.ioccc.org/1987/westley/westley.c https://www.ioccc.org/1987/westley/westley.c. Strictly speaking, it's not composed of palindromes because of the mirror-image brackets and slashes, but still, impressive.
- jacquesm 8y agoThis one is a valid sentence in Dutch: "Nelli plaatst op n parterretrap n pot staalpillen." The 'n's are a bit of an issue though, 'n in dutch means 'een', but reversed that doesn't work so the 'e's got dropped and replaced by "'" but they move from one side of the n's to the other in the reversal.
- fnayr 8y agoDifferent word trivia that I find fascinating that I feel HNers will also appreciate: (twelve plus one) is an anagram of (eleven plus two) I guess that should be called a mathagram?
- etiennemarcel 8y agoGeorges Perec in 1969: http://homepage.urbanet.ch/cruci.com/lexique/palindrome.htm http://homepage.urbanet.ch/cruci.com/lexique/palindrome.htm (1247 words)
- fjsolwmv 8y agoPerec also wrote a book with no letter E, a mystery about the missing letter. The English translation is called _A Void_. It's hard to make sense in parts, largely works. At parts it discusses the mysterious missing letter (E is not know) like threeve, the integer between 3 and 4.
- lowercased 8y agoMy 2 "go to" palindromes... I know a fat man called Ella C Namtafawnoki. I got hang of fog nah togi.
- quickthrower2 8y agoMy two go to palindromes are Mr Merasemordnilapotogowtym!
- quickthrower2 8y agoWhats with Sadick? (15 times!). Also the F*, C and S words!
- Aardwolf 8y agoFor single words, in Dutch there is: koortsmeetsysteemstrook
- nathell 8y agoAnd Finnish has saippuakivikauppias.
- kiliankoe 8y agoI was recently dumbfounded by the fact that ()() is not a palindrome, but ())( is. It's obvious, sure, but it still doesn't look right.
- luizfzs 8y agoIt's not obvious for me (maybe you are joking and I didn't get it)
- kiliankoe 8y agoTry substituting other symbols, which makes it easier to see. 1 for ( and 0 for ) for example. Then we have 1010 and 1001
- luizfzs 8y agomindblow
- abababba 8y agoTry replacing ( with a and ) with b : abab -> not palindrome abba -> palindrome
- kiliankoe 8y agoFor 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
- sombremesa 8y agoIt 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.
- onemoresoop 8y ago
- DonaldFisk 8y agoThe longest palindrome has infinite length. Start with any palindrome, e.g. "radar". You can make a new palindrome: "radar, sides reversed, is radar". That can then be used to create the palindrome "radar, sides reversed, is radar, sides reversed, is radar, sides reversed, is radar". You can repeat this indefinitely.
- type_enthusiast 8y agoI have to point out Weird Al's "Bob": https://www.youtube.com/watch?v=JUQDzj6R3p4 https://www.youtube.com/watch?v=JUQDzj6R3p4 It's not a palindrome, but is a semi-sensical song masterfully composed entirely out of palindromes (which also does a great job poking fun at Bob Dylan).
- luizfzs 8y ago8102018 is not a palindromic because it isn't a valid format date (it is, but is nonsense, so not valid on my standards :). examples of valid date formats are: yyyy-mm-dd dd-mm-yyyy
- mkstowegnv 8y agoFor a line level palindrome homage to Douglas Hofstadter's Crab Canon see https://juliagalef.com/2017/02/21/a-poem-for-douglas-hofstadter/ https://juliagalef.com/2017/02/21/a-poem-for-douglas-hofstad...