Minimum Time to Type Word Using Special Typewriter
You are given a special typewriter with lowercase letters only, and a word composed of lowercase letters. The typewriter has the following characteristics:
Initially, the typewriter is at the first letter of the alphabet ('a'). To type a letter, the typewriter moves to the corresponding letter on the typewriter and presses the key. The typewriter can only move from one letter to the adjacent letter in either direction. Write a function to calculate the minimum time required to type a given word using the special typewriter.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)