← 返回 oracle 的题目列表Find File with Phone Number
类型:online_judge
oracle
Given a directory with multiple sale contact files, identify which files contain a phone number.
Requirements:
Phone number format is xxx-xxx-xxxx.
List the filenames that contain a phone number.
Assumptions:
All files are text files.
There are between 1 and 100 files.
Input Format:
A list of strings representing the file contents in the directory.
Sample Input:
[
"name: John Doe, phone: 123-456-7890",
"name: Alice, email: alice@example.com",
"phone: 222-333-4444, name: Bob"
]
Sample Output:
["file1", "file3"]
Example
Input
["name: John Doe, phone: 123-456-7890", "name: Alice, email: alice@example.com", "phone: 222-333-4444, name: Bob"]