LeetCode 193: Valid Phone Numbers
Problem Restatement We are given a text file named file.txt . Each line contains one phone number candidate. We need to print only the valid phone numbers. A valid phone number must match one of these two formats: xxx-xxx-xxxx or: (xxx) xxx-xxxx Here, each x is a digit. For example: 987-123-4567 123 456 7890 (123) 456-7890 The valid lines are: 987-123-4567 (123) 456-7890 Input and Output Item Meaning Input A...