This my solution, I also tried to account for the possibility that there wasn't just one letter missing:
checkChar = array => { const missing = [] for(let i = 1; i < array.length; i++) { var firstLet = array[i].charCodeAt(0) var prevLet = array[i - 1].charCodeAt(0) if (firstLet - prevLet > 1) missing.push([firstLet, prevLet]) } return missing.map(letterArray => { const letters = [] for(let i = letterArray[1] + 1, c = 0; c < (letterArray[0] - letterArray[1] - 1); c++) { letters.push(String.fromCharCode(i)) i++ } return letters })[0] }
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This my solution, I also tried to account for the possibility that there wasn't just one letter missing: