Step 1: n ==1 : return 1 n == 2 : return [1,1],[2]Step 2:for n > 2a.arr.push(n)b.arr.push([n-1,1])c.1 get result of recursion(n-2)c.2 combine n==2 & result => retc.3 remove duplicate record in retcod...
分类:
其他好文 时间:
2014-06-28 07:17:11
阅读次数:
255
集合框架最大的作用就是维护一组类型相同的对象。只是不同的类有不同的行为和性能。通常关注以下这些行为:
能否存放重复的元素遍历的顺序是怎样的是否支持多线程
下面首先介绍集合的常用,随后根据每种行为分别进行讨论。
常用操作
常用的操作一般就是增加删除查询。常用的增加操作有add、addAll,常用的删除操作有remove、removeAll,常用的读取操作有contains、get...
分类:
编程语言 时间:
2014-06-28 00:00:26
阅读次数:
449
一、卸载原来的mysql: 卸载一: 输入: #rpm -qa | grep -i mysql 显示: mysql-libs-5.1.52-1.el6_0.1.i686 卸载方法: yum -y remove mysql-libs-5.1.52-1.el6_0....
分类:
数据库 时间:
2014-06-27 15:54:30
阅读次数:
253
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
分类:
其他好文 时间:
2014-06-27 12:30:03
阅读次数:
200
Given a linked list, remove the nth node from the end of list and return its head.
分类:
其他好文 时间:
2014-06-27 12:26:10
阅读次数:
322
Given an array and a value, remove all instances of that value in place and return the new length.
分类:
其他好文 时间:
2014-06-27 12:17:58
阅读次数:
156
??
vim修复:
修复前提,你到UBUNTU可以联网,否则只能卸载,不能安装
1.sudo apt-get remove vim-common
2.sudo apt-get install vim
telnet:
开启telnet:
1.首先安装必要telnet
在终端输入命令:sudo apt-get install xinetd te...
分类:
Web程序 时间:
2014-06-26 07:41:23
阅读次数:
244
安装CocoaPods 是用 Ruby 实现的,所以使用它需要用到 Ruby 环境。Ruby 的官方软件源使用的是亚马逊的云服务,在国内访问有问题,需要将官方的源替换成国内淘宝提供的源。# 更新 Ruby 软件源gem sources --remove https://rubygems.org/ge...
分类:
其他好文 时间:
2014-06-25 18:50:41
阅读次数:
239
class Solution {public: int removeElement(int A[], int n, int elem) { if (A == NULL || n < 1) return 0; int rpos = 0, wpos = 0; ...
分类:
其他好文 时间:
2014-06-25 17:47:57
阅读次数:
234
//Remove the exploer'bug XSSfunction RemoveXSS($val) { $val = preg_replace('/([\x00-\x08,\x0b-\x0c,\x0e-\x19])/', '', $val); $search = 'abcdefghijklmn...
分类:
其他好文 时间:
2014-06-25 09:54:13
阅读次数:
225