@MartinBüttner any ideas for this for the palindrome question? Feels kind of fishy in a couple places. Particularly the leading space thing, is there a better way to get the prefixes?
Also, I did try all the test cases, but it does also seem sort of weird that this works? Do you see any cases where it'd mess up?