Given a picture consisting of black and white pixels, find the number of black lonely pixels. The picture is represented by a 2D char array consisting ...
分类:
其他好文 时间:
2017-03-07 09:00:25
阅读次数:
160
"hello world", "imooc"=>"http://baidu.com" ); echo $array[key]; //如果不用引号 输出的是http://baidu.com echo $array["key"]; //输出的是"hello world", ...
分类:
Web程序 时间:
2017-03-07 08:58:31
阅读次数:
248
Given a binary array, find the maximum number of consecutive 1s in this array if you can flip at most one 0. Example 1: Note: The input array will onl ...
分类:
其他好文 时间:
2017-03-07 08:46:32
阅读次数:
260
<?php header('Content-Type:text/html;charset=utf8'); $_start=current_time(); $array1=range(1000,2000); $i=0; while ($i<200000){ ++$i; // isset($array1 ...
分类:
Web程序 时间:
2017-03-07 08:44:45
阅读次数:
206
<?php $array1=array(); $array2=array(); for ($i=0;$i<rand(1000,2000);$i++){ $array1[]=rand(); } for ($y=0;$y<rand(1000,2000);$y++){ $array2[]=rand(); ...
分类:
Web程序 时间:
2017-03-07 08:27:30
阅读次数:
160
要求:dir/upload.image.jpg,找出 .jpg 或者 jpg ,必须使用PHP自带的处理函数进行处理,方法不能明显重复,可以封装成函数,比如 get_ext1($file_name), get_ext2($file_name) 第一种: 第二种: 第三种: 第四种: 第五种: 第六种 ...
分类:
其他好文 时间:
2017-03-07 00:14:28
阅读次数:
455
1、Generator 函数是 ES6 提供的一种异步编程解决方案。形式上,Generator 函数是一个普通函数,但是有两个特征。一是,function关键字与函数名之间有一个星号;二是,函数体内部使用yield语句,定义不同的内部状态。 2、Generator函数的调用方法与普通函数一样,也是在 ...
分类:
Web程序 时间:
2017-03-06 22:07:40
阅读次数:
191
// 看上去正常的结果: ['Google', 'Apple', 'Microsoft'].sort(); // ['Apple', 'Google', 'Microsoft']; // apple排在了最后: ['Google', 'apple', 'Microsoft'].sort(); // ... ...
分类:
Web程序 时间:
2017-03-06 22:06:54
阅读次数:
169
今天什么都没发生 leetcode118 https://leetcode.com/problems/pascals-triangle/?tab=Description leetcode169 https://leetcode.com/problems/majority-element/?tab=D ...
分类:
其他好文 时间:
2017-03-06 21:18:46
阅读次数:
251
删除排序数组的重复数字 public class Solution { /** * @param A: a array of integers * @return : return an integer */ public int removeDuplicates(int[] nums) { // ...
分类:
其他好文 时间:
2017-03-06 20:44:49
阅读次数:
138