Single Occurrence

Published by werdna in

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

Examples

singleOccurrence("EFFEAABbc") ➞ "C"

singleOccurrence("AAAAVNNNNSS") ➞ "V"

singleOccurrence("S") ➞ "S"

Notes

The function will not be case sensitive.

Watch a quick demo on how Edabit works.