明日珠海行,心情紧张,写博文压压惊 囧-------------------------------------原题地址:https://oj.leetcode.com/problems/remove-duplicates-from-sorted-list-ii/题目内容:Given a sorte...
分类:
其他好文 时间:
2014-11-23 21:33:49
阅读次数:
180
Roman to IntegerGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.SOLUTION 1:思路:从后往前遍历罗马数字,如果某...
分类:
其他好文 时间:
2014-11-23 20:12:01
阅读次数:
145
【题目】
Given a binary tree, flatten it to a linked list in-place.
For example,
Given
1
/ 2 5
/ \ 3 4 6
The flattened tree should look like:...
分类:
其他好文 时间:
2014-11-23 17:35:12
阅读次数:
131
【题目】
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
For example:
Given the below binary tree and sum
= 22,
5
...
分类:
其他好文 时间:
2014-11-23 17:34:18
阅读次数:
163
ZigZag ConversionThe string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern...
分类:
其他好文 时间:
2014-11-23 17:30:46
阅读次数:
289
Integer to Roman Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.SOLUTION 1: 1 package Algor...
分类:
其他好文 时间:
2014-11-23 17:26:35
阅读次数:
173
Multiply StringsGiven two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large ...
分类:
其他好文 时间:
2014-11-23 11:39:36
阅读次数:
224
Wildcard MatchingImplement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of charact...
分类:
其他好文 时间:
2014-11-23 10:27:55
阅读次数:
174
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5108题目意思:给出一个数正整数 N,N N 的因子就更不可能了。于是时间复杂度就降了下来。接着是排除那些 N 除不尽的因子,即 N % i != 0。剩下的就是那些能除得尽的因子,枚举 N / i 和....
分类:
其他好文 时间:
2014-11-22 22:49:54
阅读次数:
192
Decode WaysA message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded ...
分类:
其他好文 时间:
2014-11-22 18:53:35
阅读次数:
308