码迷,mamicode.com
首页 >  
搜索关键字:given n integers    ( 24278个结果
nyoj_308_Substring_201405091611
Substring时间限制:1000 ms | 内存限制:65535 KB难度:1描述You are given a string input. You are to find the longest substring of input such that the reversal of the ...
分类:其他好文   时间:2014-05-10 06:20:56    阅读次数:257
【LeetCode】Best Time to Buy and Sell Stock II
Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a...
分类:其他好文   时间:2014-05-10 00:24:49    阅读次数:255
UVA Parentheses Balance
题目如下: Parentheses Balance You are given a string consisting of parentheses () and []. A string of this type is said to be correct: (a)     if it is the empty string (b)     if A and B are ...
分类:其他好文   时间:2014-05-09 20:57:46    阅读次数:316
Leetcode | N-Queens I & II
N-Queens IThen-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return a...
分类:其他好文   时间:2014-05-09 20:34:01    阅读次数:335
Leetcode | Parentheses 相关
Generate ParenthesesGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a...
分类:其他好文   时间:2014-05-09 20:09:32    阅读次数:333
Best Time to Buy and Sell Stock
Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie...
分类:其他好文   时间:2014-05-09 13:13:02    阅读次数:283
Leetcode | 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-05-09 10:27:29    阅读次数:449
Leetcode:Set Matrix Zeroes
戳我去解题Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.这题还是很简单的,就是有点坑,遍历矩阵的时候,每遇到0的时候,我们不能立即将所在行和列置0,否则,到最后矩阵所有...
分类:其他好文   时间:2014-05-09 08:51:57    阅读次数:253
Leetcode:Search a 2D Matrix
戳我去解题Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted f...
分类:其他好文   时间:2014-05-09 08:27:24    阅读次数:241
UVA 10025(数学)
The ? 1 ? 2 ? ... ? n = k problem  The problem Given the following formula, one can set operators '+' or '-' instead of each '?', in order to obtain a given k ? 1 ? 2 ? ... ? n =...
分类:其他好文   时间:2014-05-09 06:10:40    阅读次数:285
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!