JavaScript/6kyu/Find_the_missing_letter.js
// (Use the English alphabet with 26 letters!)
(Use the English alphabet with 26 letters!)
( Use the English alphabet with 26 letters! )
function findMissingLetter(array){
  let codes1 = array.map(l=>l.charCodeAt(0));
  let codes2 = Array.apply(null, {length: codes1[codes1.length - 1] + 1}).map(Number.call, Number);
  let code = codes2.slice(codes2.indexOf(codes1[0])).filter(el=>codes1.indexOf(el) < 0)[0];
  return String.fromCharCode(code);
}
function findMissingLetter ( array ) { let codes1 = array . map ( l => l . charCodeAt ( 0 ) ) ; let codes2 = Array . apply ( null , { length : codes1 [ codes1 . length - 1 ] + 1 } ) . map ( Number . call , Number ) ; let code = codes2 . slice ( codes2 . indexOf ( codes1 [ 0 ] ) ) . filter ( el => codes1 . indexOf ( el ) < 0 ) [ 0 ] ; return String . fromCharCode ( code ) ; }
(Use the English alphabet with 26 letters!)
( Use the English alphabet with 26 letters! )