蚂蚁不在线

2018年7月14日

leetcode python 003

摘要: ## 给定一个字符串,求其最长无重复的子字符串##给定“abcabcbb”,答案是“abc”,长度为3。##给定“bbbbb”,答案是“b”,长度为1。##鉴于“pwwkew”,答案是“wke”,长度为3。import timeimport randomimport stringx,l=1000,[ 阅读全文

posted @ 2018-07-14 14:09 蚂蚁不在线 阅读(139) 评论(0) 推荐(0) 编辑

leetcode python 002

摘要: ##002 Input: (2 -> 4 -> 3) + (5 -> 6 -> 4) Output: 7 -> 0 -> 8# 链表节点都是一位数字,以上可以视为243+564=807#先定义节点和链表类import numpy as npimport timeclass Node(object): 阅读全文

posted @ 2018-07-14 12:35 蚂蚁不在线 阅读(108) 评论(0) 推荐(0) 编辑

leetcode python 001

摘要: 给定一个数组,和一个数字target,要求返回和为target的两个数组成员的下标。 import numpy as npimport time #### 构造题目 , x数组大小x=100000l1=np.random.rand(x)l2=[round(l*x,5) for l in l1]w1= 阅读全文

posted @ 2018-07-14 12:34 蚂蚁不在线 阅读(78) 评论(0) 推荐(0) 编辑

导航