Shortest-LeetCode-Python-Solutions
Shortest-LeetCode-Python-Solutions copied to clipboard
用 3.8 新特性 := 可以简化一些
class Solution:
def isPalindrome(self, x: int) -> bool:
return (k:=str(x)) == k[::-1]
~~字符数好像还多了~~
字符数少了,而且减少计算时间√