摘要: 1 3Sum2 3Sum Closest3 4Sum4 Add Binary5 Add Two Numbers6 Anagrams7 Balanced Binary Tree8 Best Time to Buy and Sell Stock9 Best Time to Buy and Sell Stock II10 Best Time to Buy and Sell Stock III11 Binary Tree Inorder Traversal12 Binary Tree Level Order Traversal13 Binary Tree Level Order Traversal I 阅读全文
posted @ 2012-12-21 18:15 西施豆腐渣 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Validate if a given string is numeric.Some examples:"0"=>true" 0.1 "=>true"abc"=>false"1 a"=>false"2e10"=>trueNote:It is intended for the problem statement to be ambiguous. You should gather all requirements up front before implementin 阅读全文
posted @ 2012-12-21 17:55 西施豆腐渣 阅读(112) 评论(0) 推荐(0) 编辑
摘要: Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's. 1 3 3 2 1 \ / / / \ \ 3 2 1 1 3 2 / / \ \ 2 ... 阅读全文
posted @ 2012-12-21 16:21 西施豆腐渣 阅读(94) 评论(0) 推荐(0) 编辑
摘要: Write a function to find the longest common prefix string amongst an array of strings.class Solution { public: string longestCommonPrefix(vector<string> &strs) { // Start typing your C/C++ solution below // DO NOT write int main() function string s; if( strs.size(... 阅读全文
posted @ 2012-12-21 05:38 西施豆腐渣 阅读(94) 评论(0) 推荐(0) 编辑