题目描述Given a number sequence whose length is n, you
can delete at most k numbers in the sequence.After that you are asked to answer
the maximum length ...
分类:
其他好文 时间:
2014-05-19 22:21:32
阅读次数:
304
Question 1:Given an array of integers, find two
numbers such that they add up to a specific target number.The function twoSum
should return indices of...
分类:
其他好文 时间:
2014-05-19 09:35:41
阅读次数:
321
#ifndef MAINFUNC_H#define MAINFUNC_H#include
#include #include #include //1. Get the numbers//2. Modify the expression like
(1+1*1)*(1-1); 1 represent...
分类:
其他好文 时间:
2014-05-18 19:54:02
阅读次数:
514
Given a triangle, find the minimum path sum
from top to bottom. Each step you may move to adjacent numbers on the row
below.For example, given the fol...
分类:
其他好文 时间:
2014-05-18 02:11:19
阅读次数:
302
Given two numbers represented as strings,
return multiplication of the numbers as a string.Note: The numbers can be
arbitrarily large and are non-nega...
分类:
其他好文 时间:
2014-05-18 01:25:07
阅读次数:
288
题目描述After the hard tasks, It’s the easy time for
Y.G.Tobor and Y.D.I.Isha is a friend of Y.D.I, as he thinks Tobor is smart too,
he give Tobor a probl...
分类:
其他好文 时间:
2014-05-17 15:20:34
阅读次数:
248
判断integer是否为回文串(负数全部不为回文串)思路很直接,提取出integer中的每一位,一头一尾进行比较是否相同。一次AC
, 直接上代码:public boolean isPalindrome(int x) { if(x = 0 && x 0){ ...
分类:
其他好文 时间:
2014-05-16 00:24:44
阅读次数:
386
题意:给定两个代表数字的链表,每个节点里存放一个digit,数字是逆方向的,将这两个链表相加起来
思路:
1.i, j遍历l1,l2至最长,短的补零
2..设置一个进位变量c, 第i次遍历 l1,l2,c的和除以10进位,mod10留在这一位
3.出循环后还要检查是不是还有进位
复杂度:O(m+n), 空间O(m+n)...
分类:
其他好文 时间:
2014-05-15 13:38:03
阅读次数:
258
Two SumGiven an array of integers, find two
numbers such that they add up to a specific target number.The function twoSum
should return indices of the...
分类:
其他好文 时间:
2014-05-15 10:48:59
阅读次数:
322
[ 问题: ]
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the ta...
分类:
其他好文 时间:
2014-05-15 00:04:39
阅读次数:
377