Letter Value Sum Coding Challenge



This site utilizes Google Analytics, Google AdSense, as well as participates in affiliate partnerships with various companies including Amazon. Please view the privacy policy for more details.

An easy coding challenge just to practice recording and uploading.

Challenge from /r/dailyprogrammer/: [2021-07-19] Challenge #399 [Easy] Letter value sum:

“Assign every lowercase letter a value, from 1 for a to 26 for z. Given a string of lowercase letters, find the sum of the values of the letters in the string.”

I didn’t need to do the string.isEmpty() ? 0 : part at the end; the sum of an empty list of integers is 0.

Music from #Uppbeat (free for Creators!):

https://uppbeat.io/t/adi-goldstein/star-travelers

License code: FRQFAUYBPTLMIJD7

Leave a Reply

Note that comments won't appear until approved.