Find missing letter in list of alphabets

前端 未结 16 1689
逝去的感伤
逝去的感伤 2021-01-01 05:15

I am trying to solve the following issue:

Find the missing letter in the passed letter range and return it. If all letters are present in the range, return undefine

16条回答
  •  遥遥无期
    2021-01-01 05:25

    How about this one? it finds all missing letters anywhere between the first and the last given letters:

    function fearNotLetter(str) {
      var strArr = str.split('');
      var missingChars = [], i = 0;
      var nextChar = String.fromCharCode(strArr[i].charCodeAt(0)+1);
      while (i

提交回复
热议问题