7 kyu

Alphabet symmetry

3,929 of 15,203KenKamau

Description:

Consider the word "abode". We can see that the letter a is in position 1 and b is in position 2. In the alphabet, a and b are also in positions 1 and 2. Notice also that d and e in abode occupy the positions they would occupy in the alphabet, which are positions 4 and 5.

Given an array of words, return an array of the number of letters that occupy their positions in the alphabet for each word. For example,

solve(["abode","ABc","xyzD"]) = [4, 3, 1]

See test cases for more examples.

Input will consist of alphabet characters, both uppercase and lowercase. No spaces.

Good luck!

If you like this Kata, please try:

Last digit symmetry

Alternate capitalization

Strings
Fundamentals

Stats:

CreatedOct 8, 2017
PublishedOct 8, 2017
Warriors Trained26585
Total Skips2346
Total Code Submissions44652
Total Times Completed15203
Python Completions3929
JavaScript Completions4493
Lua Completions214
C# Completions669
Ruby Completions586
Haskell Completions194
Crystal Completions15
C++ Completions2246
Fortran Completions14
CoffeeScript Completions16
Dart Completions412
PHP Completions360
TypeScript Completions302
Go Completions692
Java Completions1119
Rust Completions256
Prolog Completions19
Clojure Completions48
Julia Completions23
Nim Completions20
C Completions163
COBOL Completions5
Total Stars299
% of votes with a positive feedback rating94% of 1821
Total "Very Satisfied" Votes1615
Total "Somewhat Satisfied" Votes180
Total "Not Satisfied" Votes26
Total Rank Assessments13
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • KenKamau Avatar
  • GiacomoSorbi Avatar
  • donaldsebleung Avatar
  • kazk Avatar
  • TehOrange Avatar
  • B1ts Avatar
  • arhigod Avatar
  • rxe Avatar
  • Souzooka Avatar
  • rsa Avatar
  • metagn Avatar
  • ZED.CWT Avatar
  • monadius Avatar
  • hobovsky Avatar
  • stellartux Avatar
  • hakr14 Avatar
  • solitude Avatar
  • trashy_incel Avatar
  • username0 Avatar
  • rabbit_binary7 Avatar
  • kirull Avatar
  • user8436785 Avatar
  • MikChan Avatar
  • akar-0 Avatar
  • angel.nr Avatar
Ad