← Back to challenges

Single Occurrence

PythonMediumlanguage_fundamentalsstrings

Instructions

Create a function that, given a string txt, finds a letter that has a single occurrence. Return the letter in uppercase. If the input is empty, return an empty string "".

Examples

single_occurrence("EFFEAABbc") ➞ "C"

single_occurrence("AAAAVNNNNSS") ➞ "V"

single_occurrence("S") ➞ "S"

Notes

The function will not be case sensitive.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Zip It, If You Can?