本博客rss订阅地址: http://feed.cnblogs.com/blog/u/147990/rss

随笔分类 -  LeetCode

摘要:题目链接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], ... 阅读全文
posted @ 2013-12-06 15:50 tenos 阅读(3587) 评论(0) 推荐(1) 编辑
摘要:题目链接Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "ad... 阅读全文
posted @ 2013-12-06 15:34 tenos 阅读(2166) 评论(5) 推荐(1) 编辑
摘要:LeetCode:Remove Duplicates from Sorted ListGiven a sorted linked list, delete all duplicates such that each element appear only once.For example, Give... 阅读全文
posted @ 2013-12-06 15:24 tenos 阅读(1071) 评论(0) 推荐(0) 编辑
摘要:LeetCode:Remove Duplicates from Sorted ArrayGiven a sorted array, remove the duplicates in place such that each element appear only once and return th... 阅读全文
posted @ 2013-12-06 14:49 tenos 阅读(1030) 评论(0) 推荐(0) 编辑
摘要:题目链接Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example, S = "ADOB... 阅读全文
posted @ 2013-12-06 14:01 tenos 阅读(6937) 评论(4) 推荐(3) 编辑
摘要:题目链接Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.分析:一般一个题目我首先会想想怎么暴力解决,比如这一题,可... 阅读全文
posted @ 2013-12-02 23:23 tenos 阅读(3376) 评论(1) 推荐(2) 编辑
摘要:题目链接Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the ... 阅读全文
posted @ 2013-12-02 20:34 tenos 阅读(1370) 评论(0) 推荐(0) 编辑
摘要:题目链接Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the o... 阅读全文
posted @ 2013-12-01 00:20 tenos 阅读(648) 评论(0) 推荐(0) 编辑
摘要:题目链接Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representa... 阅读全文
posted @ 2013-12-01 00:15 tenos 阅读(1786) 评论(0) 推荐(1) 编辑
摘要:题目链接Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space to hold additional element... 阅读全文
posted @ 2013-11-30 23:43 tenos 阅读(612) 评论(0) 推荐(0) 编辑
摘要:题目链接The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total nu... 阅读全文
posted @ 2013-11-30 23:37 tenos 阅读(2490) 评论(0) 推荐(0) 编辑
摘要:题目链接A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message c... 阅读全文
posted @ 2013-11-30 23:19 tenos 阅读(1410) 评论(2) 推荐(0) 编辑
摘要:求集合的所有子集问题LeetCode:SubsetsGiven a set of distinct integers,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.Th... 阅读全文
posted @ 2013-11-30 23:01 tenos 阅读(10130) 评论(3) 推荐(4) 编辑
摘要:题目链接Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another exp... 阅读全文
posted @ 2013-11-28 22:42 tenos 阅读(3238) 评论(0) 推荐(0) 编辑
摘要:题目链接Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NUL... 阅读全文
posted @ 2013-11-28 22:25 tenos 阅读(564) 评论(0) 推荐(0) 编辑
摘要:题目链接Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given"25525511135",return["2... 阅读全文
posted @ 2013-11-28 22:20 tenos 阅读(811) 评论(0) 推荐(0) 编辑
摘要:LeetCode:Unique Binary Search TreesGivenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there... 阅读全文
posted @ 2013-11-28 22:09 tenos 阅读(1708) 评论(0) 推荐(0) 编辑
摘要:题目链接Givens1,s2,s3, find whethers3is formed by the interleaving ofs1ands2.For example,Given:s1="aabcc",s2="dbbca",Whens3="aadbbcbcac", return true.When... 阅读全文
posted @ 2013-11-28 21:14 tenos 阅读(681) 评论(0) 推荐(0) 编辑
摘要:题目链接Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains on... 阅读全文
posted @ 2013-11-28 20:32 tenos 阅读(698) 评论(0) 推荐(0) 编辑
摘要:其他LeetCode题目欢迎访问:LeetCode结题报告索引题目链接Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.N... 阅读全文
posted @ 2013-11-27 14:51 tenos 阅读(3320) 评论(2) 推荐(0) 编辑


本博客rss订阅地址: http://feed.cnblogs.com/blog/u/147990/rss

公益页面-寻找遗失儿童