- 博客(3)
- 收藏
- 关注
原创 python3刷leetcode第165题165.compare version number
class Solution: def compareVersion(self,version1:str,version2:str) -> int: version1 = version1.split('.') version2 = version2.split('.') n = max(len(version1),len(version2)) print("这是数字1",version1) pr
2020-06-04 20:31:28
149
原创 python 刷leetcode第七题 7. Reverse Integer
class Solution: def reverse(self,x): # 范围-214783648~214783647 num = 0 #返回绝对整数 a = abs(x) # 假设 有个123 # a = 123 # nume = 0 # 第一次迭代的时候 #
2020-06-04 15:15:42
195
原创 纯小白 python刷Leetcode第一题 twoSum
class Solution: def twoSum(self, nums, target): for i in nums: # 目标的两个数分别为 i 和 j,所以i+j = 9 #从第一个i开始每个数开始找,第一个i = 2,所以要找到的j应该是7 j = target - i #7 = 9 - 2 start_index = nums.index(i)
2020-06-04 14:18:22
196
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人