<filename>Company-Based/SAP/social_sabatical_name.py
# maximum number of letters(ignoring spaces and duplicates) if tie choose alphabetical order. 
# import sys
# text = "".join(sys.stdin.readlines())
# name_list = text.split("\n")
inputList = ["<NAME>", "<NAME>", "<NAME>", "<NAME>", "<NAME>"]
inputList2 = ["<NAME>", "<NAME>", "<NAME>", "<NAME>", "<NAME>"]
inputList3 = ["<NAME>", "<NAME>", "<NAME>", "<NAME>", "<NAME>"]
name_store = {}
for name in inputList3:
    name_store[name] = len(set(name.lower().replace(" ", "")))   # Remove spaces using replace and remove duplicates using set
res = []
maxLen = -float("inf")
for name in name_store.keys():
    if name_store.get(name) > maxLen:
        res.clear()
        res.append(name)
        maxLen = name_store.get(name)
    elif name_store.get(name) == maxLen:
        res.append(name)
res.sort()
print(res[0])
<filename>Company-Based/SAP/social_sabatical_name.py
# maximum number of letters(ignoring spaces and duplicates) if tie choose alphabetical order. 
# import sys
# text = "".join(sys.stdin.readlines())
# name_list = text.split("\n")
inputList = ["<NAME>", "<NAME>", "<NAME>", "<NAME>", "<NAME>"]
inputList2 = ["<NAME>", "<NAME>", "<NAME>", "<NAME>", "<NAME>"]
inputList3 = ["<NAME>", "<NAME>", "<NAME>", "<NAME>", "<NAME>"]
name_store = {}
for name in inputList3:
    name_store[name] = len(set(name.lower().replace(" ", "")))   # Remove spaces using replace and remove duplicates using set
res = []
maxLen = -float("inf")
for name in name_store.keys():
    if name_store.get(name) > maxLen:
        res.clear()
        res.append(name)
        maxLen = name_store.get(name)
    elif name_store.get(name) == maxLen:
        res.append(name)
res.sort()
print(res[0])
# maximum number of letters(ignoring spaces and duplicates) if tie choose alphabetical order. # import sys # text = "".join(sys.stdin.readlines()) # name_list = text.split("\n") # Remove spaces using replace and remove duplicates using set