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

用 3.8 新特性 := 可以简化一些 #14

Open
asukaminato0721 opened this issue Nov 18, 2020 · 1 comment
Open

用 3.8 新特性 := 可以简化一些 #14

asukaminato0721 opened this issue Nov 18, 2020 · 1 comment

Comments

@asukaminato0721
Copy link
Contributor

class Solution:
    def isPalindrome(self, x: int) -> bool:
        return (k:=str(x)) == k[::-1]

字符数好像还多了

@cy69855522
Copy link
Owner

字符数少了,而且减少计算时间√

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

2 participants