Given an email column, extract the first name and create a new column.
Asked in the Face-to-face technical round stage.
Implement extract_first_names(emails). For each email, inspect the local part before @. The first name is the text before the earliest ., _, or -. If the local part begins with a separator, preserve the empty first token and also return the token immediately after that separator. Return one flat list in input order.
emails is a list of strings. Return a list of strings.
@ character., _, or -def extract_first_names(emails):