7 kyu

Club Doorman

1,199 of 1,876brudolce

Description:

INTRODUCTION

The Club Doorman will give you a word. To gain access, you need to provide the right number according to the given word.

Each word contains exactly one pair of consecutive identical letters, such as the tt in lettuce.

To determine the number, find the position of the repeated letter in the alphabet (where a is 1, b is 2, ..., z is 26) and multiply it by 3.

TASK

Implement a function that takes a word as input and returns the correct number.

EXAMPLE

For the word lettuce, the repeated letter is t, which is the 20th letter in the alphabet.

The correct answer is 20 × 3 = 60.

NOTE

You may assume that the given string will

  • always contain exactly one pair of consecutive identical letters.

  • consist only of lowercase English letters.

Fundamentals

Similar Kata:

Stats:

CreatedFeb 3, 2019
PublishedFeb 3, 2019
Warriors Trained2542
Total Skips17
Total Code Submissions4733
Total Times Completed1876
JavaScript Completions1199
Julia Completions21
Python Completions696
Total Stars18
% of votes with a positive feedback rating92% of 384
Total "Very Satisfied" Votes328
Total "Somewhat Satisfied" Votes51
Total "Not Satisfied" Votes5
Total Rank Assessments27
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • brudolce Avatar
  • JohanWiltink Avatar
  • cliffstamp Avatar
  • stellartux Avatar
  • albertogcmr Avatar
  • ejini战神 Avatar
Ad