You are viewing a single comment's thread. Return to all comments →
This one was easy, only a few minutes required
function processData(input) { const inputLines = input.split('\n') const words = inputLines.slice(1) for (let word of words){ var steps = 0 for (let i = 0; i < word.length / 2 ; i++){ steps = steps + Math.abs(word[i].charCodeAt(0) - word[word.length -i -1 ].charCodeAt(0)) } console.log(steps) } }
Seems like cookies are disabled on this browser, please enable them to open this website
The Love-Letter Mystery
You are viewing a single comment's thread. Return to all comments →
This one was easy, only a few minutes required