码迷,mamicode.com
首页 >  
搜索关键字:array    ( 29504个结果
Meeting Rooms II -- LeetCode
Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find the minimum number of conference room ...
分类:其他好文   时间:2016-08-31 14:05:43    阅读次数:144
js数组与字符串相互转换
一、数组转字符串(将数组元素用某个字符连接成字符串) var a, b;a = new Array(0,1,2,3,4);b = a.join("-"); 二、字符串转数组(将字符串按某个字符切割成若干个字符串,并以数组形式返回) var s = "abc,abcd,aaa";ss = s.spli ...
分类:编程语言   时间:2016-08-31 13:42:36    阅读次数:238
leetcode-Search in Rotated Sorted Array II-81
这题和http://www.cnblogs.com/0summer/p/5825282.html一样,只是上一题中序列里没有重复的元素 代码都是一样的 ...
分类:其他好文   时间:2016-08-31 13:40:41    阅读次数:191
PHP中封装上传文件函数
<?php /* *文件上传 * * */ //var_dump($_FILES); /*多文件上传处理 $data=$_FILES[‘icon‘]; $name=$data[‘name‘]; if(is_array($name)){ for($i=0;$i<count($name);$i++){ echo$data[‘tmp_name‘][$i].‘<br/>‘; } }else{ echo‘单个文件上传‘; } */ $..
分类:Web程序   时间:2016-08-31 12:21:24    阅读次数:198
leetcode-Remove Duplicates from Sorted Array II-80
输入非递减数组,要求每个元素最多重复两次,求最后剩下的数组和元素个数 这题函数的返回值是元素个数,但是还需要把输入的参数也就是输入的数组也改动成合法的 因为是有序的序列,所以直接遍历一遍,用cur保存元素,cnt保存这个元素出现的次数就好,ON ...
分类:其他好文   时间:2016-08-31 11:49:47    阅读次数:116
【LeetCode】136. Single Number 解题小结
题目: Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear runtime com ...
分类:其他好文   时间:2016-08-31 07:08:42    阅读次数:134
LeetCode-Majority Element II
Given an integer array of size n, find all elements that appear more than ? n/3 ? times. The algorithm should run in linear time and in O(1) space. Hi ...
分类:其他好文   时间:2016-08-31 07:05:58    阅读次数:108
[LintCode] Continuous Subarray Sum 连续子数组之和
Given an integer array, find a continuous subarray where the sum of numbers is the biggest. Your code should return the index of the first number and ...
分类:编程语言   时间:2016-08-31 00:35:49    阅读次数:223
Javascript中的Array
1、创建数组vararr=["lucy","lily","tom"]; vararr=newArray();2、数组的方法Array类还提供了很多方法来操作元素 push()在末尾添加元素(数组的元素个数是可以动态改变的) pop()删除末尾元素 unshift()在开头添加元素 shift()删除开头元素3、数据遍历数组对象的特点是支持索引..
分类:编程语言   时间:2016-08-30 23:02:04    阅读次数:186
利用char, str2mat, strvcat创建多行字符串数组
用专门函数char , str2mat , strvcat创建多行字符串数组示例。 1.char('str1', 'str2',...) Convert to character array (string)转换成字符串数组,空字符串是有效的。 示例:S1=char('This string arr ...
分类:编程语言   时间:2016-08-30 22:42:51    阅读次数:323
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!