Maior índice (com um toque especial)

Published by Deep Xavier in

Dado um nome, retorne a letra com o maior index em ordem alfabética, junto com seu índice correspondente, na forma de uma string. Não é permitido usar max() nem reatribuir um valor ao array alphabet.

Exemplos

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(alphabet, "Xavier") ➞ "24x"

alphabetIndex(alphabet, "Tesha") ➞ "20t"

alphabetIndex(alphabet, "Andrey") ➞ "25y"

Observações

NA