← Back to challenges

Find Missing Alphabets

PythonHardstringslogicvalidation

Instructions

Create a function that takes a string txt 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

missing_alphabets("abcdefghijklmnopqrstuvwxy") ➞ "z"
# "z" is missing.

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

missing_alphabets("innokodakademija") ➞ "cfghjklmnopqrsuvwxyz"

Notes

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

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.