Enrollments closing soon for Post Graduate Certificate Program in Applied Data Science & AI By IIT Roorkee | 3 Seats Left
Apply NowLogin using Social Account
     Continue with GoogleLogin using your credentials
Every valid email consists of a local name and a domain name, separated by the '@
' sign. Besides lowercase letters, the email may contain one or more '.'
or '+
'.
If you add periods '.
' between some characters in the local name part of an email address, mail sent there will be forwarded to the same address without dots in the local name. Note that this rule does not apply to domain names.
If you add a plus '+
' in the local name, everything after the first plus sign will be ignored. This allows certain emails to be filtered. Note that this rule does not apply to domain names.
Given an array of strings emails where we send one email to each email[i]
, return the number of different addresses that actually receive mails.
Input: emails = ["main.email+check@cloudxlab.com","main.e.mail+bobby.caty@cloudxlab.com","mai.n.e.m.ail+monalisa@cloud.x.lab.com"]
Output: 2
Explanation: "mainemail@cloudxlab.com" and "mainemail@cloud.x.lab.com" actually receive mails.
Input: emails = ["aazz@cloudxlab.com","b@cloudxlab.com","c@cloudxlab.com"]
Output: 3
Constraints:
email[i]
consist of lowercase English letters, '+
', '.
' and '@
'.emails[i]
contains exactly one '@
' character.+
' character.unique_emails
emails
Complete the below code in the right side coding panel
def unique_emails(prices: list) -> int:
# your code goes here
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
No hints are availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...