Two Sum Problem:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indic...
分类:
其他好文 时间:
2014-10-09 23:05:37
阅读次数:
273
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:
其他好文 时间:
2014-10-09 17:15:15
阅读次数:
218
[leetcode]Given two numbers represented as strings, return multiplication of the numbers as a string....
分类:
其他好文 时间:
2014-10-09 16:02:38
阅读次数:
174
此题不难,可以用dfs来做,也可以用动态规划,但明显dfs性能不如dp。
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
Note:...
分类:
编程语言 时间:
2014-10-09 15:59:48
阅读次数:
163
You are given a grid of numbers. A snake sequence is made up of adjacent numbers such that for each number, the number on the right or the number belo...
分类:
其他好文 时间:
2014-10-09 14:15:14
阅读次数:
197
题目:Almost Prime Numbers是只有一个素数因子的数,统计一个区间中的Almost Prime Numbers。
分析:数论,分治。根据定义可知Almost Prime Numbers就是素数的幂(大于1次)。
首先,利用筛法计算出1000000内的素数(至少的素数的平方);
然后,计算所有的素数的小于1000000000000...
分类:
其他好文 时间:
2014-10-09 02:24:57
阅读次数:
162
Problem EGame of SumInput File:e.inOutput:Standard OutputThis is a two player game. Initially there areninteger numbers in an array and playersAandBge...
分类:
其他好文 时间:
2014-10-07 23:09:04
阅读次数:
298
DescriptionThe Fibonacci sequence is the sequence of numbers such that every element is equal to the sum of the two previous elements, except for the ...
分类:
其他好文 时间:
2014-10-07 13:38:23
阅读次数:
169
Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note:Yo...
分类:
其他好文 时间:
2014-10-06 21:14:50
阅读次数:
220
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each numb...
分类:
其他好文 时间:
2014-10-06 13:41:10
阅读次数:
154