Back to problems

Email (Multi-part)

Algorithm · Stripe · Medium

Implement a set of email-related functions covering three parts. Part 1: Parse & validate Given a string s, decide whether it is a valid email. The minimum rules are: There is exactly one @ The local-part (before the @) and the domain (after the @) are both non-empty The domain contains at least one ., and the . is not the first or last character of the domain Return true if the email is valid, otherwise false. Part 2: Canonicalization Given a valid email string s, produce…

Checking your access…