#
WC 2.1 Jumping on a Keyboard

You are given a linear keyboard i.e. a keyboard in a single row with letters extending from a to z. You are only allowed to type with one finger. Thus to type “cab”, your finger must move from c to a: by jumping over 1 letter and then from a to b, by jumping over 0 letters. Thus the total letters jumped over is 1.

Similarly, for the word “hello”, 10 jumps are performed [h-e: 2, e-l: 6, l-l: 0, l-o:2 ]

How many letters must be jumped over to type “supercalifragilisticexpialidocious” and “antidisestablishmentarianism”? The answer is the **product of these two numbers**.

The answer requires the sum of jumps between two letters. To find the jumps between to letters, we can take the (absolute difference between the Ascii value of the two letters) – 1 (since the keyboard is arranged in alphabetical order.) The special case to keep in mind is that the same letter repeated has a jump value of 0.

### This challenge is worth 60 points.

### You must be logged in to submit a solution

View ranklist for this challenge

About scoring and submission