7 kyu

Mobile Display Keystrokes

562 of 1,527zruF

Description:

Do you remember the old mobile display keyboards? Do you also remember how inconvenient it was to write on it?
Well, here you have to calculate how many keystrokes you have to do for a specific word.

This is the layout:

Given a string, return the number of keystrokes necessary to type it. You can assume that the input will entirely consist of characters included in the mobile layout (lowercase letters, digits, and the symbols * and #).

Examples

"*#"       =>  2 (1 + 1)
"123"      =>  3 (1 + 1 + 1)
"abc"      =>  9 (2 + 3 + 4)
"codewars" => 26 (4 + 4 + 2 + 3 + 2 + 2 + 4 + 5)
Fundamentals

Stats:

CreatedJun 30, 2017
PublishedJun 30, 2017
Warriors Trained2450
Total Skips27
Total Code Submissions4524
Total Times Completed1527
JavaScript Completions562
Python Completions676
Ruby Completions82
C Completions81
C# Completions134
Go Completions56
Total Stars24
% of votes with a positive feedback rating92% of 356
Total "Very Satisfied" Votes303
Total "Somewhat Satisfied" Votes50
Total "Not Satisfied" Votes3
Total Rank Assessments10
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • zruF Avatar
  • smile67 Avatar
  • adrian.eyre Avatar
  • a.kozhanov Avatar
  • hobovsky Avatar
  • Lixfeld Avatar
  • trashy_incel Avatar
  • saudiGuy Avatar
Ad