Given a list of phone-number strings in various formats, return a dict with two keys:
valid: sorted list of unique normalized numbers (digits only, exactly 10 digits)invalid: sorted list of the original (unmodified) strings that couldn't be normalized to exactly 10 digitsAcceptable input shapes include: (415) 555-0100, 415.555.0100, 415-555-0100, +1 415 555 0100, 4155550100. Leading +1 or 1 country code is allowed and should be stripped.
Ready to take your skills to the next level? Enroll in our comprehensive Data Analyst Career Track to master SQL, Python, Excel, and Power BI.
Run your code to see the result here.