You are given a string word containing distinct lowercase English letters.
Telephone keypads have keys numbered from
When a letter is typed, the key it is assigned to must be pressed a number of times equal to the letter’s position on that key. Specifically, the first letter placed on a key requires
Return the minimum total number of pushes required to type word after choosing an optimal key mapping.
Constraints:
word.length
word consists of lowercase English letters.
All letters in word are distinct.
You are given a string word containing distinct lowercase English letters.
Telephone keypads have keys numbered from
When a letter is typed, the key it is assigned to must be pressed a number of times equal to the letter’s position on that key. Specifically, the first letter placed on a key requires
Return the minimum total number of pushes required to type word after choosing an optimal key mapping.
Constraints:
word.length
word consists of lowercase English letters.
All letters in word are distinct.