From a list of phone numbers, remove the ones with the wrong format and count the 3 highest area codes.
Treat a phone number as valid only when it matches XXX-XXX-XXXX, where every X is a digit. Implement count_area_codes(phone_numbers), which accepts an array of strings and returns up to three [area_code, count] pairs. Sort by descending count, then ascending numeric area code when counts tie.
def count_area_codes(phone_numbers):