The question:
Given any string, add the least amount of characters possible to make it a palindrome in linear time.
I'm only able to come up with a O(N2) solution.
Can someone help me with an O(N) solution?
1 and 3 are obviously linear and 2 is linear beacause Knuth-Morris-Pratt is.