mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-07 00:11:41 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "小扣出去秋游,途中收集了一些红叶和黄叶,他利用这些叶子初步整理了一份秋叶收藏集 `leaves`, 字符串 `leaves` 仅包含小写字符 `r` 和 `y`, 其中字符 `r` 表示一片红叶,字符 `y` 表示一片黄叶。\r\n出于美观整齐的考虑,小扣想要将收藏集中树叶的排列调整成「红、黄、红」三部分。每部分树叶数量可以不相等,但均需大于等于 1。每次调整操作,小扣可以将一片红叶替换成黄叶或者将一片黄叶替换成红叶。请问小扣最少需要多少次调整操作才能将秋叶收藏集调整完毕。\r\n\r\n**示例 1:**\r\n>输入:`leaves = \"rrryyyrryyyrr\"`\r\n>\r\n>输出:`2`\r\n>\r\n>解释:调整两次,将中间的两片红叶替换成黄叶,得到 \"rrryyyyyyyyrr\"\r\n\r\n**示例 2:**\r\n>输入:`leaves = \"ryr\"`\r\n>\r\n>输出:`0`\r\n>\r\n>解释:已符合要求,不需要额外操作\r\n\r\n**提示:**\r\n- `3 <= leaves.length <= 10^5`\r\n- `leaves` 中只包含字符 `'r'` 和字符 `'y'`",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 214,
|
||||
"likes": 216,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -150,7 +150,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"20.5K\", \"totalSubmission\": \"39.5K\", \"totalAcceptedRaw\": 20458, \"totalSubmissionRaw\": 39505, \"acRate\": \"51.8%\"}",
|
||||
"stats": "{\"totalAccepted\": \"20.6K\", \"totalSubmission\": \"39.8K\", \"totalAcceptedRaw\": 20615, \"totalSubmissionRaw\": 39763, \"acRate\": \"51.8%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user