You may insert characters anywhere in s. Return the fewest insertions needed to make s a palindrome.
For "mbadm" the answer is 2 ("mbdadbm"); for "leetcode" it is 5.
Example 1
Input:
min_insertions('mbadm')
Output:
2
Example 2
Input:
min_insertions('leetcode')
Output:
5
0 <= len(s) <= 1000No results yet
Run your code to check it against the examples, or submit to run every test.