随笔分类 -  Leetcode

摘要:1 """复杂度O(n)""" 2 class Solution: 3 def twoSum(self, nums, target): 4 dict1={} 5 for i in range(len(nums)): 6 if nums[i] in dict1: #利用字典查找复杂度为O(1),而暴力 阅读全文
posted @ 2019-05-06 02:25 Parallax 阅读(102) 评论(0) 推荐(0) 编辑
摘要:1 #self实际是类的实例 2 3 class A: 4 def func(self): 5 print(self) #指向的是类的实例 6 print(self.__class__) #指向的是类 7 8 a = A() 9 a.func() 10 #<__main__.A object at 阅读全文
posted @ 2018-10-23 15:17 Parallax 阅读(180) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示