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 第5题 Python3 版的解法超时 #848

Closed
ChuckieChen945 opened this issue Sep 24, 2022 · 4 comments
Closed

LeetCode 第5题 Python3 版的解法超时 #848

ChuckieChen945 opened this issue Sep 24, 2022 · 4 comments

Comments

@ChuckieChen945
Copy link

LeetCode 第5题 5. 最长回文子串 Python3 版的解法原样提交后提示 Time Limit Exceeded

@yanglbme
Copy link
Member

没超时呢,我试了。数据规模 $10^3$,算法时间复杂度 $O(n^2)$,可以通过

image

@yanglbme
Copy link
Member

英文站点应该是新增了测试用例了,导致代码无法通过

@ChuckieChen945
Copy link
Author

没错,英文站点超时了

@yanglbme
Copy link
Member

yanglbme commented Nov 5, 2022

新增了空间复杂度 $O(1)$ 的解法,这个解法不会超时了。

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
@yanglbme @ChuckieChen945 and others