I have a string consisting zeros and ones and I need to know how many deletions from the beginning I need to do in order to make a string a palindrome. I wrote a function to check if the string is palindrome (and iterate over each element) and it works, but I need complexity better than O(n^2). It will be probably O(n) with KMP algorithm but I have no idea how to use it in this case. Can you help me?