Company: hackerrank_19oct
Difficulty: medium
Typing Distance Problem Description Imagine your computer has a keyboard layout like the one displayed below. 1 2 3 4 5 6 7 8 9 0 Q W E R T Y U I O P A S D F G * H J K L Z X C V B N M Assuming a keyboard typing robot. The robot's initial position is at the blue key with a star (*). Pressing any key on the keyboard generates the corresponding uppercase letter or the number. Given a string (with only uppercase letters and numbers), 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. Function Description Complete the function getDistance in the editor below. Examples Example 1: Input: word = QZ Output: 9 Explanation: The robot starts at the star position. From '*' to 'Q': 6 steps From 'Q' to 'Z': 3 steps Example 2 (Sample Case 0): Input: QA Output: 7 Explanation: Q and A are 1 character away. The robot is at Q already. So moving to A takes 1 step. (The