Minimum Deletions To Make Palindromic Sequence

easy
1. You are given a string of characters(a-z,A-Z).
2. Find the minimum number of deletions/removals needed such that remaining characters are palindromic.

Input Format

A string

Output Format

Find the minimum number of deletions/removals. Check the sample output and question video.

Constraints

1 <= length(str) <= 10000

Example

Input
adceadfahg
Output
5
Previous
Minimum Deletions To Make Sorted Array
Next
Minimum Delta In Partitions

Related Questions