2014年11月22日

摘要: 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 ... 阅读全文
posted @ 2014-11-22 18:34 Yu's Garden 阅读(911) 评论(0) 推荐(0) 编辑
摘要: Substring with Concatenation of All WordsYou are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices... 阅读全文
posted @ 2014-11-22 07:32 Yu's Garden 阅读(731) 评论(0) 推荐(0) 编辑

2014年11月21日

摘要: Longest Valid ParenthesesGiven a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses sub... 阅读全文
posted @ 2014-11-21 20:03 Yu's Garden 阅读(1410) 评论(0) 推荐(0) 编辑
摘要: Generate ParenthesesGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a... 阅读全文
posted @ 2014-11-21 18:34 Yu's Garden 阅读(888) 评论(0) 推荐(1) 编辑
摘要: LRU CacheDesign and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get... 阅读全文
posted @ 2014-11-21 17:44 Yu's Garden 阅读(2477) 评论(0) 推荐(0) 编辑

2014年11月19日

摘要: Maximal RectangleGiven a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.Show TagsHave yo... 阅读全文
posted @ 2014-11-19 08:29 Yu's Garden 阅读(1081) 评论(0) 推荐(0) 编辑

2014年11月18日

摘要: Min Stack My SubmissionsQuestionSolutionDesign a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Pu... 阅读全文
posted @ 2014-11-18 21:25 Yu's Garden 阅读(3686) 评论(0) 推荐(0) 编辑
摘要: Restore IP AddressesMy SubmissionsQuestionSolutionGiven a string containing only digits, restore it by returning all possible valid IP address combina... 阅读全文
posted @ 2014-11-18 20:35 Yu's Garden 阅读(1964) 评论(2) 推荐(0) 编辑
摘要: Longest Common Prefix Total Accepted: 24665 Total Submissions: 92370My SubmissionsQuestionSolutionWrite a function to find the longest common prefix s... 阅读全文
posted @ 2014-11-18 19:47 Yu's Garden 阅读(494) 评论(0) 推荐(0) 编辑
摘要: Regular Expression Matching My Submissions Question Solution Implement regular expression matching with support for '.' and '*'. '.' Matches any singl 阅读全文
posted @ 2014-11-18 13:32 Yu's Garden 阅读(4310) 评论(0) 推荐(1) 编辑

导航