7 kyu

Which string is worth more?

1,020 of 1,886ArtOfCode

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 Trained2603
Total Skips26
Total Code Submissions4693
Total Times Completed1886
Python Completions1020
Ruby Completions143
Haskell Completions106
JavaScript Completions559
C# Completions133
Total Stars24
% of votes with a positive feedback rating92% of 405
Total "Very Satisfied" Votes351
Total "Somewhat Satisfied" Votes46
Total "Not Satisfied" Votes8
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