Find Missing Alphabets

Published by persolut in

Create a function that takes a string str containing only letters from a to z in lowercase and returns the missing letter(s) in alphabetical order a-z.

  • A set of letters is given by abcdefghijklmnopqrstuvwxyz.
  • Two sets of alphabets means two or more alphabets.

Examples

MissingAlphabets("abcdefghijklmnopqrstuvwxy") ➞ "z"
// "z" is missing.

MissingAlphabets("aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyy") ➞ "zz"
// Given string has a set of two alphabets so output will be "zz"

MissingAlphabets("edabit") ➞ "cfghjklmnopqrsuvwxyz"

Notes

If the string contains all letters from a-z, return an empty string "".

Watch a quick demo on how Edabit works.