We had discussed about
filter. Let's try a question using it.
You are given an integer N followed by N email addresses. Your task is to print a list containing only valid email addresses in lexicographical order.
Valid email addresses must follow these rules:
The first line of input is the integer N, the number of email addresses.
N lines follow, each containing a string.
Output a list containing the valid email addresses in lexicographical order. If the list is empty, just output an empty list, .
3 email@example.com firstname.lastname@example.org email@example.com
['firstname.lastname@example.org', 'email@example.com', 'firstname.lastname@example.org']