What Makes 100% In Life?
Explore how to represent letters as numeric values using Ruby hashes and arrays. Learn to break down strings, retrieve character values, and sum them to find the total 'meaning-in-life percentage' through practical coding exercises.
Problem
Let's represent the alphabet numerically by identifying sequence of letters (A, B, C, ..., X, Y, Z) with the percentages (1%, 2%, 3%, ..., 24%, 25%, 26%). The sum of each character’s value in a word is the meaning-in-life percentage. For example,
H-A-R-D-W-O-R-K = (8 + 1 + 18 + 4 + 23 + 15 + 18 + 11)% = 98%
A look-up for calculating meaning-in-life percentage
...