mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-11 02:58:13 +08:00
57 lines
2.7 KiB
JSON
57 lines
2.7 KiB
JSON
{
|
|
"data": {
|
|
"question": {
|
|
"questionId": "193",
|
|
"questionFrontendId": "193",
|
|
"boundTopicId": null,
|
|
"title": "Valid Phone Numbers",
|
|
"titleSlug": "valid-phone-numbers",
|
|
"content": "<p>Given a text file <code>file.txt</code> that contains a list of phone numbers (one per line), write a one-liner bash script to print all valid phone numbers.</p>\n\n<p>You may assume that a valid phone number must appear in one of the following two formats: (xxx) xxx-xxxx or xxx-xxx-xxxx. (x means a digit)</p>\n\n<p>You may also assume each line in the text file must not contain leading or trailing white spaces.</p>\n\n<p><strong>Example:</strong></p>\n\n<p>Assume that <code>file.txt</code> has the following content:</p>\n\n<pre>\n987-123-4567\n123 456 7890\n(123) 456-7890\n</pre>\n\n<p>Your script should output the following valid phone numbers:</p>\n\n<pre>\n987-123-4567\n(123) 456-7890\n</pre>\n",
|
|
"translatedTitle": null,
|
|
"translatedContent": null,
|
|
"isPaidOnly": false,
|
|
"difficulty": "Easy",
|
|
"likes": 269,
|
|
"dislikes": 707,
|
|
"isLiked": null,
|
|
"similarQuestions": "[]",
|
|
"exampleTestcases": "0",
|
|
"categoryTitle": "Shell",
|
|
"contributors": [],
|
|
"topicTags": [
|
|
{
|
|
"name": "Shell",
|
|
"slug": "shell",
|
|
"translatedName": null,
|
|
"__typename": "TopicTagNode"
|
|
}
|
|
],
|
|
"companyTagStats": null,
|
|
"codeSnippets": [
|
|
{
|
|
"lang": "Bash",
|
|
"langSlug": "bash",
|
|
"code": "# Read from the file file.txt and output all valid phone numbers to stdout.\n",
|
|
"__typename": "CodeSnippetNode"
|
|
}
|
|
],
|
|
"stats": "{\"totalAccepted\": \"55.3K\", \"totalSubmission\": \"214.2K\", \"totalAcceptedRaw\": 55312, \"totalSubmissionRaw\": 214246, \"acRate\": \"25.8%\"}",
|
|
"hints": [],
|
|
"solution": null,
|
|
"status": null,
|
|
"sampleTestCase": "0",
|
|
"metaData": "{\n \"shell\": true,\n \"manual\": true\n}",
|
|
"judgerAvailable": true,
|
|
"judgeType": "large",
|
|
"mysqlSchemas": [],
|
|
"enableRunCode": false,
|
|
"enableTestMode": false,
|
|
"enableDebugger": false,
|
|
"envInfo": "{\"bash\": [\"Bash\", \"<p><code>Bash 4.3.30</code>.</p>\"]}",
|
|
"libraryUrl": null,
|
|
"adminUrl": null,
|
|
"challengeQuestion": null,
|
|
"__typename": "QuestionNode"
|
|
}
|
|
}
|
|
} |