Company: DealShare
Difficulty: medium
Alphabetical strings Problem Description While creating an account on a new website, you choose a string of lowercase letters as your password. The website then tells you that the password must be an alphabetical string : A string of lowercase letters is called alphabetical if deleting zero or more of its letters can result in the alphabet string abcdefghijklmnopqrstuvwxyz . In other words, the 26 letters a to z must appear in the string in alphabetical order, not necessarily next to each other. Other letters may appear anywhere in between. You may only insert letters into your password: any lowercase letter, at any position (including the beginning and the end), as many times as you like. Letters already in the password are never removed or changed. Find the minimum number of letters that must be inserted to make your password alphabetical. Function Description Complete the function solve in the editor. It has the following parameter: s : a string of lowercase English letters, the pas