码迷,mamicode.com
首页 >  
搜索关键字:array    ( 29504个结果
[LeetCode OJ] Single Number之二 ——Given an array of integers, every element appears THREE times except for one. Find that single one.
1 class Solution { 2 public: 3 int singleNumber(int A[], int n) { 4 int bits = sizeof(int)*8; 5 int result=0; 6 for(int i...
分类:移动开发   时间:2014-06-10 19:45:48    阅读次数:334
[LeetCode] Remove Duplicates from Sorted Array II [27]
移除数组中重复次数超过2次以上出现的数,但是可以允许重复2次。 这个题类似Remove Duplicates from Sorted Array,第一个想法很直接就是计数,超过2次的就忽略,依据这个思路的代码见代码一; 上面的思路可行,但是代码看着比较冗余,判断比较多。再来想想原来的数组,该数组是排好序的,如果一个数出现3次以上,那么必有A[i] == A[i-2]。所以根据这个关系可以写出比较精简的代码二。详见代码。...
分类:其他好文   时间:2014-06-10 19:18:39    阅读次数:250
Android屏幕density, dip等相关概念总结
1、几个术语 VGA、HVGA、QVGA、WVGA、WQVGA 这些术语都是指屏幕的分辨率。 VGA:Video Graphics Array,即:显示绘图矩阵,相当于640×480 像素; HVGA:Half-size VGA;即:VGA的一半,分辨率为480×320; QVGA:Quarter VGA;即:VGA的四分之一,分辨率为320×240; WVGA:Wide Video ...
分类:移动开发   时间:2014-06-10 19:16:28    阅读次数:314
Unique Paths
题目 A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any point in time. The robot is trying t...
分类:其他好文   时间:2014-06-10 18:43:37    阅读次数:254
LeetCode——Remove Element
Given an array and a value, remove all instances of that value in place and return the new length. The order of elements can be changed. It doesn't matter what you leave beyond the new length. 中...
分类:其他好文   时间:2014-06-10 18:41:04    阅读次数:191
Unique Paths II
题目 Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacle and empty space is marked as 1 and 0 respective...
分类:其他好文   时间:2014-06-10 18:28:49    阅读次数:207
excle查找操作-vlookup的使用心得
百度了一下vlookup的语法规则: 该函数的语法规则如下: VLOOKUP(lookup_value,table_array,col_index_num,range_lookup) 参数 简单说明 输入数据类型 lookup_value 要查找的值 数值、引用或文本字符串 ...
分类:其他好文   时间:2014-06-10 18:13:53    阅读次数:253
swift中array的相关操作
1,数组基本操作 //插入元素,替换插入后第一个元素 var aa = [1,2,3,4] aa[1...1] = [6,7,8] println("\(aa)") //插入元素,不替换插入后第一个元素 aa = [1,2,3,4] ...
分类:其他好文   时间:2014-06-10 17:08:13    阅读次数:182
[leetcode]Longest Common Prefix @ Python
原题地址:https://oj.leetcode.com/problems/longest-common-prefix/题意:Write a function to find the longest common prefix string amongst an array of strings.解...
分类:编程语言   时间:2014-06-10 16:31:52    阅读次数:261
Careercup | Chapter 3
3.1Describe how you could use a single array to implement three stacks.Flexible Divisions的方案,当某个栈满了之后,需要把相邻的栈调整好,这是一个递归的过程。每个stack有一些属性,所以不妨将每个stack封闭...
分类:其他好文   时间:2014-06-10 16:27:38    阅读次数:234
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!