mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-21 13:06:47 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个类:</p>\n\n<pre>\nclass FooBar {\n public void foo() {\n for (int i = 0; i < n; i++) {\n print(\"foo\");\n }\n }\n\n public void bar() {\n for (int i = 0; i < n; i++) {\n print(\"bar\");\n }\n }\n}\n</pre>\n\n<p>两个不同的线程将会共用一个 <code>FooBar</code> 实例:</p>\n\n<ul>\n\t<li>线程 A 将会调用 <code>foo()</code> 方法,而</li>\n\t<li>线程 B 将会调用 <code>bar()</code> 方法</li>\n</ul>\n\n<p>请设计修改程序,以确保 <code>\"foobar\"</code> 被输出 <code>n</code> 次。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 1\n<strong>输出:</strong>\"foobar\"\n<strong>解释:</strong>这里有两个线程被异步启动。其中一个调用 foo() 方法, 另一个调用 bar() 方法,\"foobar\" 将被输出一次。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 2\n<strong>输出:</strong>\"foobarfoobar\"\n<strong>解释:</strong>\"foobar\" 将被输出两次。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= n <= 1000</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 151,
|
||||
"likes": 157,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Print in Order\", \"titleSlug\": \"print-in-order\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u6309\\u5e8f\\u6253\\u5370\"}, {\"title\": \"Print Zero Even Odd\", \"titleSlug\": \"print-zero-even-odd\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u6253\\u5370\\u96f6\\u4e0e\\u5947\\u5076\\u6570\"}]",
|
||||
@@ -65,7 +65,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"49.8K\", \"totalSubmission\": \"88.6K\", \"totalAcceptedRaw\": 49813, \"totalSubmissionRaw\": 88645, \"acRate\": \"56.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"51.2K\", \"totalSubmission\": \"91K\", \"totalAcceptedRaw\": 51203, \"totalSubmissionRaw\": 91029, \"acRate\": \"56.2%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user