The Most Lovely Name Medium

+100 PTS

Before you start the test, check out our tutorial challenge

  • TYPE CODE PRACTICE CHALLENGE
  • LANGUAGES BASH, C, C++, C# AND 20 MORE
    LANGUAGES BASH, C, C++, C#, CLOJURE, ELIXIR, ERLANG, GO, GROOVY, HASKELL, JAVA, JAVASCRIPT, JULIA, KOTLIN, NIM, PERL, PHP, PYTHON2, PYTHON, RUBY, RUST, SWIFT, TYPESCRIPT, VB
  • TIME ~25MIN

The Most Lovely Name

Challenge outline

Hello and welcome to the challenge!


Like every programmer in the world, Adam has a big problem today: with whom to spend Valentine's Day? He has so much girls interested in him, but he should choose only one. But fortunately, he has a simple solution: let's choose the one which has the most lovely name!


Write a code which will help Adam to choose the most lovely name from the names given. You can count loveliness of a name by summing loveliness of its letters. And we can determine loveliness of a letter by determining its position in the alphabet. If some two names have the same loveliness, choose the name which appears earliest in the original string.


Have fun and good luck! :)