题目:Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].N...
分类:
其他好文 时间:
2014-06-26 16:02:42
阅读次数:
172
题目:Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1]...
分类:
其他好文 时间:
2014-06-26 15:59:16
阅读次数:
207
Given an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the following matri...
分类:
其他好文 时间:
2014-06-26 15:55:21
阅读次数:
200
Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".class Solution {public: string addBinary(str...
分类:
其他好文 时间:
2014-06-26 15:52:27
阅读次数:
159
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[?2,1,?3,4,?1,2,1,...
分类:
其他好文 时间:
2014-06-26 15:10:47
阅读次数:
168
Given two integers
n and k, return all possible combinations of k numbers out of 1 ...
n.
For example,
If n = 4 and k = 2, a solution is:
[
[2,4],
[3,4],
[2,3],
[1,2],
[1,3...
分类:
其他好文 时间:
2014-06-26 14:06:02
阅读次数:
252
【题目】
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
For example, given s = "aab",
Return
[
["aa","b"],
["a","a","b"]
]
【题意】
给定一个字符串s, 要求对s进行...
分类:
其他好文 时间:
2014-06-26 13:21:59
阅读次数:
182
Setup Cordova
Text Editor / IDE
You may need to prepare an IDE or Editor for working. Here for example, install a Sublime Text 3 over Windows, actually it contains versions of Mac OS as well as Linu...
Given s1, s2,
s3, find whether s3 is formed by the interleaving of s1 and
s2.
For example,
Given:
s1 = "aabcc",
s2 = "dbbca",
When s3 = "aadbbcbcac", return true.
When ...
分类:
其他好文 时间:
2014-06-26 10:10:19
阅读次数:
214
【题目】
Given a string s, partition s such that every substring of the partition is a palindrome.
Return the minimum cuts needed for a palindrome partitioning of s.
For example, given s = "aab",
Return 1 since the palindrome partitioning ["aa","b"] could b...
分类:
其他好文 时间:
2014-06-26 07:48:00
阅读次数:
259