Valid TikTok emails are of the form user@tiktok.com: user starts with 1 to 6 lowercase letters [a-z], followed by an optional underscore, then 0 to 4 optional digits [0-9]; domain is always tiktok.com. Replace the blank with a regular expression that matches valid email addresses.
Asked in the First round (technical) stage.
Implement is_valid_tiktok_email(email), which accepts a string and returns a Boolean. The match must cover the entire string. For example, ab_12@tiktok.com is valid, while abcdefg@tiktok.com and ab-12@tiktok.com are invalid. Escape the dot in the domain and reject uppercase letters, extra characters, and other domains.
def is_valid_tiktok_email(email):