1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-04 15:01:40 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-03-29 16:56:27 +08:00
parent e730aa6794
commit ad15da05aa
2517 changed files with 7358 additions and 7332 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>给你一个 <strong>仅</strong> 由字符 <code>'a'</code> 和 <code>'b'</code> 组成的字符串&nbsp; <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>&nbsp;</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>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= s.length &lt;= 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."