Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, ...
分类:
其他好文 时间:
2016-05-31 10:15:50
阅读次数:
119
题目链接:https://leetcode.com/problems/3sum/
题目:
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of...
分类:
其他好文 时间:
2016-05-31 06:30:44
阅读次数:
346
Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. Notice You must ...
分类:
移动开发 时间:
2016-05-31 00:56:39
阅读次数:
230
题目: 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 hav ...
分类:
其他好文 时间:
2016-05-30 23:31:29
阅读次数:
490
二维数组的传递有许多易忘点,也伴随着许多陷阱,没避开的话总会让编译器抱怨。 闲来无事,为日后莫忘,便整理此笔记。 法 1: 传递带列数的二维数组。 法 2: 传递一维指针和数组的列数 法 3:传递指向数组的指针 实际上,这三种方式并无多大区别。 都可以理解成一个指向固定长度数组的一维指针。 e.g. ...
分类:
其他好文 时间:
2016-05-30 23:21:35
阅读次数:
189
题目链接:https://leetcode.com/problems/increasing-triplet-subsequence/
题目:
Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array.
Formally the fu...
分类:
其他好文 时间:
2016-05-30 15:33:57
阅读次数:
200
题目链接:https://leetcode.com/problems/maximum-product-subarray/
题目:
Find the contiguous subarray within an array (containing at least one number) which has the largest product.
For example, give...
分类:
其他好文 时间:
2016-05-30 15:32:29
阅读次数:
139
一天一道LeetCode
本系列文章已全部上传至我的github,地址:ZeeCoder‘s Github
欢迎大家关注我的新浪微博,我的新浪微博
欢迎转载,转载请注明出处
(一)题目
Given an array of words and a length L, format the text such that each line has exactly L char...
分类:
其他好文 时间:
2016-05-30 15:19:12
阅读次数:
190
题目链接:https://leetcode.com/problems/count-of-smaller-numbers-after-self/
题目:
You are given an integer array nums and you have to return a new counts array. The counts array has the property where...
分类:
其他好文 时间:
2016-05-30 14:51:42
阅读次数:
147
mapUtil = function(){ this.map = new Array();}; mapUtil.prototype = { //Update or Insert add : function(key, value){ for (var i = 0; i < this.map.leng ...
分类:
Web程序 时间:
2016-05-30 12:35:55
阅读次数:
156