/** * 发送HTTP请求方法,目前只支持CURL发送请求 * @param string $url 请求URL * @param array $params 请求参数 * @param string $method 请求方法GET/POST ...
分类:
Web程序 时间:
2014-06-15 21:39:00
阅读次数:
376
题目
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums
to T.
The same repeated number may be chosen from C un...
分类:
其他好文 时间:
2014-06-15 20:00:18
阅读次数:
185
题目
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers
sums to T.
Each number in C may only be used once in...
分类:
其他好文 时间:
2014-06-15 19:24:21
阅读次数:
229
Given a non-negative number represented as an array of digits, plus one to the number.
The digits are stored such that the most significant digit is at the head of the list.
思路:原有数组需要多出一位的唯一条件是数组所...
分类:
其他好文 时间:
2014-06-15 18:42:43
阅读次数:
162
题目
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
You may assume no duplicates i...
分类:
其他好文 时间:
2014-06-15 17:27:16
阅读次数:
251
本页包含内容:
类型注解(Type Annotation)
类型标识符(Type Identifier)
元组类型(Tuple Type)
函数类型(Function Type)
数组类型(Array Type)
可选类型(Optional Type)
隐式解析可选类型(Implicitly Unwrapped Optional Type)
协议合成类型(Protocol Comp...
分类:
其他好文 时间:
2014-06-15 17:25:52
阅读次数:
287
题目
Given a sorted array of integers, find the starting and ending position of a given target value.
解题思路:
查找一个数出现的范围,给一个排好序的数组和一个数,找出这个数在数组中出现的范围。
这个题直接使用一次遍历就可以得到结果,这样的时间复杂度为O(n)。但是对于有序数组我们一般可以使用二分查找可以得到更好的O(logn)的时间复杂度。我们可以使用二分查找找到这个数第一次出现的位置和这个数最后一次出现的位...
分类:
其他好文 时间:
2014-06-15 16:19:16
阅读次数:
237
JS数组去重var ddd = [1,2,4,5,2, 222,1,5,6];var uq = {};var rq = [];for(var i=0; ib?1:-1});//从小到大排序 alert(arrDemo);//10,50,51,100 arrDemo.sort(function(a,b...
分类:
Web程序 时间:
2014-06-15 06:28:54
阅读次数:
286
题目
Given two numbers represented as strings, return multiplication of the numbers as a string.
Note: The numbers can be arbitrarily large and are non-negative.
方法
将num1与0-9相乘的结果存...
分类:
其他好文 时间:
2014-06-14 06:08:30
阅读次数:
229
Swift是用来开发iOS和OS X应用的新语言,但是许多地方用起来跟C或者OC是差不多的。
Swift提供了C语言和OC的基本数据类型,比如整型用Int,浮点型用Double或者Float,布尔型用Bool,字符串文本用String,Swift还提供了两种集合类型,Array和Dictionary,后面会介绍。
Swift也跟C一样用唯一的变量名来存储与使用数据,还能使用一些值不会变的变量,...
分类:
其他好文 时间:
2014-06-13 21:34:57
阅读次数:
369