7 kyu

Which string is worth more?

1,006 of 1,859ArtOfCode

Description:

You will be given two ASCII strings, a and b. Your task is write a function to determine which one of these strings is "worth" more, and return it.

A string's worth is determined by the sum of its ASCII codepoint indexes. So, for example, the string HELLO has a value of 372: H is codepoint 72, E 69, L 76, and O is 79. The sum of these values is 372.

In the event of a tie, you should return the first string, i.e. a.

Algorithms
Strings
Fundamentals

More By Author:

Check out these other kata created by ArtOfCode

Stats:

CreatedDec 1, 2016
PublishedDec 1, 2016
Warriors Trained2569
Total Skips25
Total Code Submissions4617
Total Times Completed1859
Python Completions1006
Ruby Completions142
Haskell Completions105
JavaScript Completions550
C# Completions130
Total Stars24
% of votes with a positive feedback rating92% of 397
Total "Very Satisfied" Votes344
Total "Somewhat Satisfied" Votes46
Total "Not Satisfied" Votes7
Total Rank Assessments19
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • ArtOfCode Avatar
  • suic Avatar
  • Voile Avatar
  • a.kozhanov Avatar
  • hobovsky Avatar
  • ejini战神 Avatar
  • farhanaditya Avatar
Ad