Highest Index (With a Twist)

Published by Werdna in

Given a name, return the letter with the highest index in alphabetical order, with its corresponding index, in the form of a string.

Examples

alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]


alphabetIndex("Flavio") ➞ "22v"

alphabetIndex("Andrey") ➞ "25y"

alphabetIndex()"Oscar") ➞ "19s"

Notes

If you're stuck, check the Resources tab.

Watch a quick demo on how Edabit works.