Timeline for Find a palindrome using Ruby
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 24, 2016 at 22:01 | comment | added | Jörg W Mittag |
"so that ' ' is not a palindrome" – Is it? :-D (Ah, they joy of corner cases …)
|
|
Feb 24, 2016 at 20:19 | comment | added | Baronz | I love that even more, Zack. Start at the ends, work towards the middle, and skip spaces. (Just make sure you get a minumum of 1 sucessful match before you exit so that ' ' is not a palindrome) | |
Feb 24, 2016 at 20:18 | comment | added | Zack | Really you don't have to reverse the string at all. Just keep two indexes, one at the start and one at the end, and keep comparing values until the indexes meet or pass each other. You can exit on the first mismatch. | |
Feb 24, 2016 at 20:11 | vote | accept | Joe Ainsworth | ||
Feb 28, 2016 at 20:55 | |||||
Feb 24, 2016 at 20:11 | comment | added | Joe Ainsworth | Okay. Great point. In terms of my reverse method, how well is this executed? | |
Feb 24, 2016 at 19:59 | review | First posts | |||
Feb 24, 2016 at 20:22 | |||||
Feb 24, 2016 at 19:51 | history | answered | Baronz | CC BY-SA 3.0 |