← Back to challenges

Find the Unique Letters

PythonMediumstringsinterview

Instructions

Create a function that takes a string and returns the letters that occur only once.

Examples

find_letters("monopoly") ➞ ["m", "n", "p", "l", "y"]

find_letters("balloon") ➞ ["b", "a", "n"]

find_letters("analysis") ➞ ["n", "l", "y", "i"]

Notes

  • The final list should not include letters that appear more than once in the string.
  • Return the letters in the sequence they were originally in, do not sort them.
  • All letters will be in lowercase.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Reverse Psychology