Files
camperbot b3af21d50f chore(i18n,curriculum): update translations (#42487)
* chore(i18n,curriculum): update translations

* chore: Italian to italian

Co-authored-by: Nicholas Carrigan <nhcarrigan@gmail.com>
2021-06-14 11:34:20 -07:00

1.3 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
af7588ade1100bde429baf20 Lettere mancanti 5 16023 missing-letters

--description--

Trova la lettera mancante nell'intervallo di lettere passato e restituisca.

Se tutte le lettere sono presenti nell'intervallo, restituisci undefined.

--hints--

fearNotLetter("abce") dovrebbe restituire la stringa d.

assert.deepEqual(fearNotLetter('abce'), 'd');

fearNotLetter("abcdefghjklmno") dovrebbe restituire la stringa i.

assert.deepEqual(fearNotLetter('abcdefghjklmno'), 'i');

fearNotLetter("stvwx") dovrebbe restituire la stringa u.

assert.deepEqual(fearNotLetter('stvwx'), 'u');

fearNotLetter("bcdf") dovrebbe restituire la stringa e.

assert.deepEqual(fearNotLetter('bcdf'), 'e');

fearNotLetter("abcdefghijklmnopqrstuvwxyz") dovrebbe restituire undefined.

assert.isUndefined(fearNotLetter('abcdefghijklmnopqrstuvwxyz'));

--seed--

--seed-contents--

function fearNotLetter(str) {
  return str;
}

fearNotLetter("abce");

--solutions--

function fearNotLetter (str) {
  for (var i = str.charCodeAt(0); i <= str.charCodeAt(str.length - 1); i++) {
    var letter = String.fromCharCode(i);
    if (str.indexOf(letter) === -1) {
      return letter;
    }
  }

  return undefined;
}