Pergunta de entrevista da empresa Reynolds and Reynolds

Given a string, write a function to compute the minimum number of characters that need to be inserted to transform the string into a palindrome. For instance, if the input is 'abcd', the function should return 3 since we can transform 'abcd' into the palindrome 'dcbabcd' by inserting three characters ('d', 'c', and 'b') at the beginning of the string. The function should return the minimum number of insertions needed for any given input string.