RegEx, Pattern & Into to databases | 30 days of Code | Hacker Rank Solution | Python
if __name__ == '__main__':
gmail_regex = re.compile("^[a-z\.]+@gmail.com$")
gmail_accounts = dict()
N = int(input())
for N_itr in range(N):
firstNameEmailID = input().split()
firstName = firstNameEmailID[0]
emailID = firstNameEmailID[1]
if gmail_regex.match(emailID):
gmail_accounts[emailID] = firstName
sorted_names = sorted(gmail_accounts.values())
print(*sorted_names, sep="\n")
Comments
Post a Comment