Given an unsorted integer array, find the first missing positive integer. For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2. Your algorithm s ...
分类:
其他好文 时间:
2017-02-25 21:17:34
阅读次数:
162
Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear runtime complex ...
分类:
其他好文 时间:
2017-02-25 21:16:46
阅读次数:
203
http://www.cnblogs.com/zzgno1/p/4184601.html foreach一共有三种类型,分别为List,[](array),Map三种。 foreach属性 示例一: 注:select count(*) from users WHERE id in ( ? , ? ) ...
分类:
其他好文 时间:
2017-02-25 17:32:11
阅读次数:
273
Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. ...
分类:
其他好文 时间:
2017-02-25 17:29:27
阅读次数:
143
Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target. ...
分类:
其他好文 时间:
2017-02-25 17:04:20
阅读次数:
146
Description 给定一棵有n个节点的无根树和m个操作,操作有2类: 1、将节点a到节点b路径上所有点都染成颜色c; 2、询问节点a到节点b路径上的颜色段数量(连续相同颜色被认为是同一段),如“112221”由3段组成:“11”、“222”和“1”。 请你写一个程序依次完成这m个操作。 给定一 ...
分类:
其他好文 时间:
2017-02-25 15:47:23
阅读次数:
237
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 ex ...
分类:
其他好文 时间:
2017-02-24 23:54:32
阅读次数:
294
一、先看最简单的情况。有两个数组: $arr1 = array(1,9,5); $arr2 = array(6,2,4); array_multisort($arr1,$arr2); print_r($arr1); // 得到的顺序是1,5,9 print_r($arr2); // 得到的顺序是6,... ...
分类:
其他好文 时间:
2017-02-24 23:35:30
阅读次数:
201
在将自己写的工具打成.jar包的时候,有时候会需要引用到res中的资源,这时候不能将资源一起打包,只能通过反射机制动态的获取资源. 特别用在自己定义一个工具将其打成.jar包时,特别注意资源的获取 1、封装成一个工具类 2、资源的获取 3.java ...
分类:
移动开发 时间:
2017-02-24 21:15:27
阅读次数:
202
You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smal ...
分类:
其他好文 时间:
2017-02-24 19:33:01
阅读次数:
165