# QWERTY keyboard string length [duplicate]

This question already has an answer here:

QWERTY keyboard distance (QKD) is, in short, the distance between two letters/numbers/punctuation keys on a standard QWERTY keyboard (if you don't have one around, you can check this Wikipedia picture). Note that only characters without modifiers be considered for this challenge (so ; is valid, but ) is not).

Some examples:

>> QKD("a","s")
1
>> QKD("e","f")
2
>> QKD("g",".")
5


In this code-golf challenge you will have to compute the QWERTY string length (QSL), which is the sum of the QWERTY keyboard distances between every two consecutive characters of a given string. E.g. QSL("abcd") = QKD("a", "b") + QKD("b", "c") + QKD("c", "d")

Examples:

>> QSL("code-golf")
37 // QKD(c,o) + QKD(o,d) + QKD(d,e) + .. = 6  +  6 + 1 + 8 + 6 + 4 + 1 + 5 = 37
>> QSL("puzzles")
25 // 3 + 6 + 0 + 8 + 7 + 1
>> QSL("stackexchange")
43 // 3 + 4 + 3 + 5 + 6 + 2 + 1 + 3 + 5 + 6 + 2 + 3


Some notes:

• You have to support at least a-z, 0-9, =[];'\,./  and Space.
• When you aren't sure about the distance between two characters, refer to the Wikipedia picture.
• Standard loopholes are disallowed, as usual (you knew that, didn't you?).
• This is , thus shortest code wins.

## marked as duplicate by AdmBorkBork, Blue, Beta Decay, Geobits, El'endia StarmanOct 8 '15 at 19:52

• @TimmyD Hm... looks similar, but the distance metric is different :)` – Bojidar Marinov Oct 8 '15 at 19:44