mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-04 15:01:40 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个 <strong>仅</strong> 由字符 <code>'a'</code> 和 <code>'b'</code> 组成的字符串 <code>s</code> 。如果字符串中 <strong>每个</strong> <em> </em><code>'a'</code> 都出现在 <strong>每个</strong><em> </em><code>'b'</code><em> </em>之前,返回 <code>true</code> ;否则,返回 <code>false</code> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre><strong>输入:</strong>s = \"aaabbb\"\n<strong>输出:</strong>true\n<strong>解释:</strong>\n'a' 位于下标 0、1 和 2 ;而 'b' 位于下标 3、4 和 5 。\n因此,每个 'a' 都出现在每个 'b' 之前,所以返回 true 。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre><strong>输入:</strong>s = \"abab\"\n<strong>输出:</strong>false\n<strong>解释:</strong>\n存在一个 'a' 位于下标 2 ,而一个 'b' 位于下标 1 。\n因此,不能满足每个 'a' 都出现在每个 'b' 之前,所以返回 false 。\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre><strong>输入:</strong>s = \"bbb\"\n<strong>输出:</strong>true\n<strong>解释:</strong>\n不存在 'a' ,因此可以视作每个 'a' 都出现在每个 'b' 之前,所以返回 true 。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= s.length <= 100</code></li>\n\t<li><code>s[i]</code> 为 <code>'a'</code> 或 <code>'b'</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 4,
|
||||
"likes": 5,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -137,7 +137,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"7.8K\", \"totalSubmission\": \"11K\", \"totalAcceptedRaw\": 7779, \"totalSubmissionRaw\": 10967, \"acRate\": \"70.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"7.8K\", \"totalSubmission\": \"11K\", \"totalAcceptedRaw\": 7816, \"totalSubmissionRaw\": 11018, \"acRate\": \"70.9%\"}",
|
||||
"hints": [
|
||||
"You can check the opposite: check if there is a ‘b’ before an ‘a’. Then, negate and return that answer.",
|
||||
"s should not have any occurrences of “ba” as a substring."
|
||||
|
Reference in New Issue
Block a user