- 博客(6)
- 资源 (3)
- 收藏
- 关注
原创 05Leetcode---threeSum
题意:从一个数组中找到三个数,使这三个数的和为0。有可能存在多组解,也有可能存在重复的解,所以需要去重。比如:num=[-1,0,1,2,-1,-4];那么存在两组解:[[-1,0,1],[-1,-1,2]],解中的数需要是从小到大排序状态。步骤:1. 先将数组排序。 2. 按照TwoSum的思路来解题。怎么解呢?将num[i]的相反数即-num[i]作为target,然后从i+1到l...
2018-08-29 22:12:04 174
原创 04Leetcode-MergeSortedArray
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note: You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B. ...
2018-08-29 21:14:03 106
原创 03Leetcode-Merge Two Sorted Lists
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.题意:合并两个有序链表 思路:首先判断l1和l2的null情况,可直接return,接着初始化他的首节点为l1...
2018-08-29 20:31:26 102
原创 02Leetcode-climbStairs
题意:有n级楼梯,你一次可以爬一级或两级,问爬上n级楼梯有多少种爬法。分析: n 表示楼层 f(n) 表示 到达n层一共有多少种方法 n=1 f(1)=1 [1] n=2 f(2)=2 [1 1] [2] n=3 f(3)=3 [1 1 1] [1 2] [2 1] n=4 f(4)=5 [1 1 1...
2018-08-29 19:59:53 181
原创 01Leetcode-TwoSum
题目描述:Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution. Example: Given nums ...
2018-08-29 19:23:27 112
原创 TFRecords数据
tf.train.batch的第一个参数 tensors 传入的是tenor列表或者字典,返回的是tensor列表或字典注意在tfrecord文件中存储的是一序列,并没有形状 所以需要reshape( [ ] )推荐:介绍tfrecord两种方法说的比较好 https://www.cnblogs.com/polly333/p/7489699.html一 TFRecordsTF...
2018-08-27 11:19:42 854 1
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人