原题地址:https://oj.leetcode.com/problems/remove-duplicates-from-sorted-list-ii/题意:Given
a sorted linked list, delete all nodes that have duplicate number...
分类:
编程语言 时间:
2014-06-16 10:40:35
阅读次数:
340
原题地址:https://oj.leetcode.com/problems/search-in-rotated-sorted-array-ii/题意:Follow
up for "Search in Rotated Sorted Array":What ifduplicatesare allowed...
分类:
编程语言 时间:
2014-06-16 08:20:54
阅读次数:
307
原题地址:https://oj.leetcode.com/problems/gray-code/题意:The
gray code is a binary numeral system where two successive values differ in only
one bit.Given a...
分类:
编程语言 时间:
2014-06-16 07:42:27
阅读次数:
242
原题地址:https://oj.leetcode.com/problems/unique-paths/题意:A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The ...
分类:
编程语言 时间:
2014-06-15 23:37:55
阅读次数:
311
原题地址:https://oj.leetcode.com/problems/unique-paths-ii/题意:Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many ...
分类:
编程语言 时间:
2014-06-15 23:33:26
阅读次数:
353
1、
??
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 uni...
分类:
其他好文 时间:
2014-06-15 09:09:00
阅读次数:
256
http://acm.hdu.edu.cn/game/entry/problem/list.php?chapterid=1§ionid=21.2.5
#include
/*
题意:找闰年。
if((i%4==0 && i%100!=0) || i%400==0)count++;
3
2005 25
1855 12
2004 10000
2108
1904
43236
*/
int ma...
分类:
其他好文 时间:
2014-06-14 06:32:08
阅读次数:
320
给的一个数列中,可能存在重复的数,比如 1 1 2
,求其全排列。记录上一个得出来的排列,看这个排列和上一个是否相同。#include #include #include using namespace std;
class Solution{public: vector > permuteU...
分类:
其他好文 时间:
2014-06-13 17:53:39
阅读次数:
280
求一个排列的下一个排列。1,2,3→1,3,23,2,1→1,2,31,1,5→1,5,1#include
#include #include using namespace std; class Solution{public: void
nextPermutation(vector &nu...
分类:
其他好文 时间:
2014-06-13 16:41:56
阅读次数:
173
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-06-13 15:55:47
阅读次数:
273