Question: provide the code in python Typing Distance Imagine your computer has a keyboard layout like the one displayed below. Assuming a keyboard typing robot (

provide the code in python
Typing Distance
Imagine your computer has a keyboard layout like the one displayed below.
Assuming a keyboard typing robot (for example, something
Pressing any key on the keyboard generates the corresponding upper case letters.
Given a string (with only uppercase letters), return the total distance traveled by the robot.
The robot can move only left, right, top, and bottom. It can't move diagonally.
Note: There will be no spaces Included in the input provided.
Eximple
word = QZ
Output =3
The robot starts at Q.
From 'Q' to 'W'1 step
From 'W' to 'S': 1 step
From 'S' to 'Z: 1 step
Typing Distance
Imagine your computer has a keyboard layout like the one displayed below.
Assuming a keyboard typing robot (for example, something
Pressing any key on the keyboard generates the corresponding upper case letters.
Given a string (with only uppercase letters), return the total distance traveled by the robot.
The robot can move only left, right, top, and bottom. It can't move diagonally.
Note: There will be no spaces Included in the input provided.
Eximple
word = QZ
Output =3
The robot starts at Q.
From 'Q' to 'W'1 step
From 'W to 'S': 1 step
From 'S' to 'Z': 1 step
provide the code in python Typing Distance

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!