{ "data": { "question": { "questionId": "194", "questionFrontendId": "194", "categoryTitle": "Shell", "boundTopicId": 1457, "title": "Transpose File", "titleSlug": "transpose-file", "content": "
Given a text file file.txt
, transpose its content.
You may assume that each row has the same number of columns, and each field is separated by the ' '
character.
Example:
\n\nIf file.txt
has the following content:
\nname age\nalice 21\nryan 30\n\n\n
Output the following:
\n\n\nname alice ryan\nage 21 30\n\n", "translatedTitle": "转置文件", "translatedContent": "
给定一个文件 file.txt
,转置它的内容。
你可以假设每行列数相同,并且每个字段由 ' '
分隔。
\n\n
示例:
\n\n假设 file.txt
文件内容如下:
\nname age\nalice 21\nryan 30\n\n\n
应当输出:
\n\n\nname alice ryan\nage 21 30\n\n", "isPaidOnly": false, "difficulty": "Medium", "likes": 77, "dislikes": 0, "isLiked": null, "similarQuestions": "[]", "contributors": [], "langToValidPlayground": "{\"cpp\": false, \"java\": false, \"python\": false, \"python3\": false, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"typescript\": false, \"bash\": false, \"php\": false, \"swift\": false, \"kotlin\": false, \"dart\": false, \"golang\": false, \"ruby\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"rust\": false, \"racket\": false, \"erlang\": false, \"elixir\": false, \"pythondata\": false, \"react\": false, \"vanillajs\": false, \"postgresql\": false}", "topicTags": [ { "name": "Shell", "slug": "shell", "translatedName": null, "__typename": "TopicTagNode" } ], "companyTagStats": null, "codeSnippets": [ { "lang": "Bash", "langSlug": "bash", "code": "# Read from the file file.txt and print its transposed content to stdout.", "__typename": "CodeSnippetNode" } ], "stats": "{\"totalAccepted\": \"16.5K\", \"totalSubmission\": \"48.3K\", \"totalAcceptedRaw\": 16520, \"totalSubmissionRaw\": 48346, \"acRate\": \"34.2%\"}", "hints": [], "solution": null, "status": null, "sampleTestCase": "a", "metaData": "{\n \"shell\": true,\n \"manual\": true\n}", "judgerAvailable": true, "judgeType": "large", "mysqlSchemas": [], "enableRunCode": false, "envInfo": "{\"bash\":[\"Bash\",\"
\\u7248\\u672c\\uff1aBash 4.3.30<\\/code><\\/p>\"]}",
"book": null,
"isSubscribed": false,
"isDailyQuestion": false,
"dailyRecordStatus": null,
"editorType": "CKEDITOR",
"ugcQuestionId": null,
"style": "LEETCODE",
"exampleTestcases": "a",
"__typename": "QuestionNode"
}
}
}