These look complicated but great! Thank you. I am currently trying to complete the following problem:
‘’ Given a string of words, you need to find the highest scoring word.
Each letter of a word scores points according to it’s position in the alphabet: a = 1, b = 2, c = 3
etc.
You need to return the highest scoring word as a string.
If two words score the same, return the word that appears earliest in the original string.
All letters will be lowercase and all inputs will be valid.’’
Now that I have (sort of) grasped the for loop being used to lookup some table, I need to manage an input into
function high(x)
where x consists of two different strings. The function should return the string which scores the higher amount of points which is determined by adding up each letter’s value.
How would I ‘‘upgrade’’ the original code so that it works with multiple string inputs? Hope this makes sense