ðŸ§
The Ultimate Answer
Week 42
According to the Hitchiker's Guide to the Galaxy, the answer to life, the universe and everything is...42!
For this challenge, we are implementing the scoring system for a word game where users score points based on the sum of the difference between consecutive letters of a word
Note that the order of letters doesn't matter - i.e. the score of "ab" or "ba" would both be 1, since the difference (in ASCII value) between each of those letters is 1. In order words, scores should always be positive
Let's look at another example:
Your goal is two-fold:
- To find all words with a score of 42
- To find the highest scoring word (note: there is only 1, so you don't have to worry about multiple words having the same joint high score)
For example, suppose we used the word list:
Then our expected output (including the sentences on the first and last lines) would be:
As we can see, 4 words ("epidemic", "opera", "repel" and "silence") scored 42 points, while "faucet" was the highest scoring word in this list
For the real program, you should use this full word list
Hints
Hints will be released at the start of each of the following days - e.g. the start of day 3 is 48 hours after the challenge starts
| Release Day | Hint |
|---|---|
| 2 |