Company: Curefit SDE3_15july
Difficulty: medium
You are participating in a competitive puzzle called String Partition Championship . The challenge presents you with a text string S . Your task is to divide this string into consecutive sections following a specific constraint: each alphabet character must belong to exactly one section throughout the entire partition. The scoring mechanism works as follows: Every section containing X characters awards you X 2 points. Your mission is to determine the lowest possible total score you can achieve while correctly partitioning string S . Note: The partitioning rule mandates that once a character appears in a particular section, it cannot occur in any other section of your solution. For example, if section A contains the letters [d, e, v, c, o], then these specific letters are forbidden from appearing in sections B, C, or any subsequent sections. Input Format A single line containing the string S . Output Format Print a single integer — the minimum achievable score. Constraints 1 ≤