Files
wehub-resource-sync dde272c4b8
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 11:55:53 +08:00

73 lines
1.3 KiB
Markdown

---
id: af7588ade1100bde429baf20
title: Missing letters
challengeType: 1
forumTopicId: 16023
dashedName: missing-letters
---
# --description--
Find the missing letter in the passed letter range and return it.
If all letters are present in the range, return `undefined`.
# --hints--
`fearNotLetter("abce")` should return the string `d`.
```js
assert.deepEqual(fearNotLetter('abce'), 'd');
```
`fearNotLetter("abcdefghjklmno")` should return the string `i`.
```js
assert.deepEqual(fearNotLetter('abcdefghjklmno'), 'i');
```
`fearNotLetter("stvwx")` should return the string `u`.
```js
assert.deepEqual(fearNotLetter('stvwx'), 'u');
```
`fearNotLetter("bcdf")` should return the string `e`.
```js
assert.deepEqual(fearNotLetter('bcdf'), 'e');
```
`fearNotLetter("abcdefghijklmnopqrstuvwxyz")` should return `undefined`.
```js
assert.isUndefined(fearNotLetter('abcdefghijklmnopqrstuvwxyz'));
```
# --seed--
## --seed-contents--
```js
function fearNotLetter(str) {
return str;
}
fearNotLetter("abce");
```
# --solutions--
```js
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;
}
```