← Back to challenges

Find the Missing Letter

JavaScriptHardmatharraysalgorithms

Instructions

Create a function that takes an array of increasing letters and return the missing letter.

Examples

missingLetter(["a", "b", "c", "e", "f", "g"]) ➞ "d"

missingLetter(["O", "Q", "R", "S"]) ➞ "P"

missingLetter(["t", "u", "v", "w", "x", "z"]) ➞ "y"

missingLetter(["m", "o"]) ➞ "n"

Notes

  • Tests will always have exactly one letter missing.
  • The length of the test array will always be at least two.
  • Tests will be in one particular case (upper or lower but never both).
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.