码迷,mamicode.com
首页 >  
搜索关键字:unique paths    ( 5916个结果
LeetCode——Unique Binary Search Trees II
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example, Given n = 3, your program should return all 5 unique BST's shown below. 1 3...
分类:其他好文   时间:2014-09-09 12:31:39    阅读次数:143
Longest Palindromic Substring
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes...
分类:其他好文   时间:2014-09-09 12:14:08    阅读次数:200
【LeetCode】Combination Sum
Combination SumGiven a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thes...
分类:其他好文   时间:2014-09-09 10:54:08    阅读次数:190
61. Unique Paths && Unique Paths II
思路: 其实答案就是 C(m+n-2, m-1). 但是写程序利用动态规划会简单快捷。(给两个代码,第一个方便理解,第二个是基于第一个的优化) 思路:同上,只是最初初始化全 0 . 当前位置为 1 时,则当到达前位置的步数为 0.
分类:其他好文   时间:2014-09-09 10:29:48    阅读次数:255
Leetcode: Permutations II
Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique per...
分类:其他好文   时间:2014-09-08 00:55:26    阅读次数:269
[LeetCode] Unique Paths
public class Solution { public int uniquePaths(int m, int n) { int [][] result = new int[m][n]; for (int i=0; i<m; i++) { ...
分类:其他好文   时间:2014-09-07 14:42:25    阅读次数:181
3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of ...
分类:其他好文   时间:2014-09-07 14:40:25    阅读次数:188
4Sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array whic...
分类:其他好文   时间:2014-09-07 12:13:15    阅读次数:209
Leetcode: Unique Binary Search Trees II
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.For example,Given n = 3, your program should return all ...
分类:其他好文   时间:2014-09-07 07:38:14    阅读次数:315
每日算法之四十四:Unique Path(矩阵中不重复路径的数目)
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 t...
分类:其他好文   时间:2014-09-06 22:37:14    阅读次数:246
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!