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

优化0151.翻转字符串里的单词的Python版本1解法,删除冗余的strip()函数 #2741

Conversation

ZaneCodeJourney
Copy link
Contributor

变更内容:

本次PR对151题《翻转字符串里的单词》的Python解法进行了优化。

  • 删除了 strip() 函数,避免了冗余操作
  • 代码已通过所有现有测试用例,功能未受影响

优化原因:

通过代码分析,strip() 在此场景中多余,因为 split() 可以处理空白字符。因此,删除该行代码以减少冗余处理,保持代码简洁。

影响:

  • 提升了代码的可读性并去除了不必要的处理步骤。

@youngyangyang04
Copy link
Owner

感谢pr🌹,但你的pr 中修改了很多其他的样式,所以不能通过呢,你可以看一下你提交pr时候的diff

@ZaneCodeJourney
Copy link
Contributor Author

谢谢,那我稍后重新提交一下

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

Successfully merging this pull request may close these issues.

2 participants