← Back to challenges

Missing Letters

JavaScriptHardstringsloops

Instructions

Given a string containing unique letters, return a sorted string with the letters that don't appear in the string.

Examples

getMissingLetters("abcdefgpqrstuvwxyz") ➞ "hijklmno"

getMissingLetters("zyxwvutsrq") ➞ "abcdefghijklmnop"

getMissingLetters("abc") ➞ "defghijklmnopqrstuvwxyz"

getMissingLetters("abcdefghijklmnopqrstuvwxyz") ➞ ""

Notes

  • The combination of both strings should be 26 elements long, including all the letters in the alphabet.
  • Letters will all be in lowercase.
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.