Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leetcode 第39场双周赛题解 #22

Open
utterances-bot opened this issue Nov 17, 2020 · 2 comments
Open

Leetcode 第39场双周赛题解 #22

utterances-bot opened this issue Nov 17, 2020 · 2 comments

Comments

@utterances-bot
Copy link

Leetcode 第39场双周赛题解 | CP Wiki

数据范围有限,可以直接暴力模拟。如果数据范围扩大,可以预先计算前缀和。

https://cp-wiki.vercel.app/tutorial/leetcode/BC39/

Copy link

题主能讲下 Problem B的详细解法吗

@lucifer1004
Copy link
Owner

@TheBestCVMan 最终形成的字符串一定是前半段为a,后半段为b,所以我们就枚举它是从哪一位开始变成b的。需要的修改次数等于前半段的b的个数加上后半段的a的个数。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants