Skip to content

Commit df74621

Browse files
longsizhuogithub-actions[bot]
authored andcommitted
chore(docs): sync doc metadata [skip ci]
1 parent b94307c commit df74621

File tree

2 files changed

+38
-9
lines changed

2 files changed

+38
-9
lines changed

app/docs/CommunityShare/Leetcode/1234. 替换子串得到平衡字符串_translated.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
11
---
22
title: 1234. Replace the sub -string to get a balanced string One question daily
3-
date: '2024.01.01 0:00'
3+
date: "2024.01.01 0:00"
44
tags:
55
- - Python
66
- - answer
77
abbrlink: 56d97dcf
8+
docId: p8igr19xfxnuyo2lpngnr6fg
89
---
10+
911
# topic:
1012

1113
![2023-02-13.png](..%2Fassets%2Fimg%2F2023-02-13.png)
1214
[1234. Replace the sub -string to get a balanced string.md](https://leetcode.cn/problems/replace-the-substring-for-balanced-string/description/)
1315

1416
# Thought:
15-
`all()`:if bool(x) For all the values ​​in iterative objects x All for True,Then return True。 if可迭代对象为空,Then return True。
1617

18+
`all()`:if bool(x) For all the values ​​in iterative objects x All for True,Then return True。 if可迭代对象为空,Then return True。
1719

1820
Tongxiang dual pointer,The solution of the spiritual god of this question。
1921
If in this string,These four characters happen just to appear n/4 Second-rate,Then it is one「Balanced string」。
2022
if在待替换子串之外的任意字符的出现Second-rate数都**Exceed** $m=\dfrac{n}{4}$
2123
,So no matter how you replace it,都无法make这个字符的出现Second-rate数等于m。
2224
on the other hand,if在待替换子串之外的任意字符的出现Second-rate数都**不Exceed** m,
23-
>So it can be replaced ,make s 为Balanced string,即每个字符的出现Second-rate数均为 m。
24-
For this question,The left and right end points of the sub -string are left and right,enumerate right,
25-
if子串外的任意字符的出现Second-rate数都不Exceedm,The explanation from left arrive
26-
rightThis sub -string can be to replace the sub -string,Length right−left+1
27-
Update the minimum value of the answer,Move to the right left,Sumid sub -string length。
2825

26+
> So it can be replaced ,make s 为Balanced string,即每个字符的出现Second-rate数均为 m。
27+
> For this question,The left and right end points of the sub -string are left and right,enumerate right,
28+
> if子串外的任意字符的出现Second-rate数都不Exceedm,The explanation from left arrive
29+
> rightThis sub -string can be to replace the sub -string,Length right−left+1
30+
> Update the minimum value of the answer,Move to the right left,Sumid sub -string length。
2931
3032
# Code:
3133

@@ -47,6 +49,7 @@ class Solution:
4749
return ans
4850

4951
```
52+
5053
```golang
5154
func balancedString(s string) int {
5255
cnt, m := ['X']int{}, len(s)/4

generated/doc-contributors.json

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"repo": "InvolutionHell/involutionhell",
3-
"generatedAt": "2025-11-09T12:26:55.387Z",
3+
"generatedAt": "2025-11-09T12:54:54.688Z",
44
"docsDir": "app/docs",
5-
"totalDocs": 105,
5+
"totalDocs": 106,
66
"results": [
77
{
88
"docId": "ue27z7z95yzw3lhhfj7nit1c",
@@ -2017,6 +2017,23 @@
20172017
}
20182018
]
20192019
},
2020+
{
2021+
"docId": "p8igr19xfxnuyo2lpngnr6fg",
2022+
"path": "app/docs/CommunityShare/Leetcode/1234. 替换子串得到平衡字符串_translated.md",
2023+
"contributorStats": {
2024+
"114939201": 1
2025+
},
2026+
"contributors": [
2027+
{
2028+
"githubId": "114939201",
2029+
"contributions": 1,
2030+
"lastContributedAt": "2025-11-09T12:50:29.000Z",
2031+
"login": "longsizhuo",
2032+
"avatarUrl": "https://avatars.githubusercontent.com/u/114939201?v=4",
2033+
"htmlUrl": "https://github.com/longsizhuo"
2034+
}
2035+
]
2036+
},
20202037
{
20212038
"docId": "jgyg6bp0nceyrxirz5qw3zsv",
20222039
"path": "app/docs/CommunityShare/Life/unsw-student-benefit.md",
@@ -2717,6 +2734,7 @@
27172734
"docId": "ld59a8z1v84ig4rlr0p0n2a9",
27182735
"path": "app/docs/jobs/event-keynote/coffee-chat.md",
27192736
"contributorStats": {
2737+
"114939201": 1,
27202738
"163523387": 2
27212739
},
27222740
"contributors": [
@@ -2727,6 +2745,14 @@
27272745
"login": "Mira190",
27282746
"avatarUrl": "https://avatars.githubusercontent.com/u/163523387?v=4",
27292747
"htmlUrl": "https://github.com/Mira190"
2748+
},
2749+
{
2750+
"githubId": "114939201",
2751+
"contributions": 1,
2752+
"lastContributedAt": "2025-11-09T12:26:56.000Z",
2753+
"login": "longsizhuo",
2754+
"avatarUrl": "https://avatars.githubusercontent.com/u/114939201?v=4",
2755+
"htmlUrl": "https://github.com/longsizhuo"
27302756
}
27312757
]
27322758
},

0 commit comments

Comments
 (0)