Given a string, write a function “recurring char” to find the strings first recurring character. Return “None” if there is no recurring character. Note: Treat upper and lower case letters as distinct characters. You may assume the input string includes no spaces. Example: input = "interviewquery" output = "i" input = "interv" output = "None"
Anonymous
def rec_char(input): sett = set() for i in input: if i not in sett: sett.add(i) else: return i return "None"
Check out your Company Bowl for anonymous work chats.