自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(56)
  • 收藏
  • 关注

原创 LeetCode Substring with Concatenation of All Words

题目:You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and w

2014-05-31 15:49:47 447

原创 LeetCode String to Integer (atoi)

题目:Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible

2014-05-29 22:16:16 457

转载 LeetCode Regular Expression Matching

题目:Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire

2014-05-29 21:20:56 518

原创 LeetCode Reverse Nodes in k-Group

题目:Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then left-out nodes in the end should remain

2014-05-29 17:15:30 442

原创 LeetCode Letter Combinations of a Phone Number

题目:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.Input

2014-05-29 12:07:26 456

原创 LeetCode Merge k Sorted Lists

Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.方法1:使用最小堆,

2014-05-28 21:40:01 454

转载 priority_queue用法(转载)

关于priority_queue1,关于STL中的priority_queue:确定用top()查看顶部元素时,该元素是具有最高优先级的一个元素. 调用pop()删除之后,将促使下一个元素进入该位置. 2,如同stack和queue,priority_queue是一个基于基本序列容器进行构建的适配器,默认的序列器是vector. 模板原型:priority_queue

2014-05-28 21:21:10 525

原创 LeetCode Divide Two Integers

题目:Divide two integers without using multiplication, division and mod operator.

2014-05-28 18:02:34 456

原创 LeetCode Implement strStr()

题目:Implement strStr().Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.

2014-05-28 16:20:26 440

原创 LeetCode Multiply Strings

题目:Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-negative.

2014-05-28 15:18:28 420

原创 LeetCode Combination Sum II

题目:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each number in C may only be used once in th

2014-05-28 11:34:06 252

原创 LeetCode Combination Sum

题目:Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen from C unlim

2014-05-28 10:17:52 327

原创 LeetCode Permutations II

题目:Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique permutations:[1,1,2], [1,2,1], and

2014-05-27 22:20:01 284

原创 LeetCode Permutations

题目:Given a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1].class

2014-05-27 21:38:04 282

原创 LeetCode Anagrams

题目:Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.

2014-05-27 21:12:27 257

原创 LeetCode N-Queens II

题目:Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.

2014-05-27 20:35:09 303

原创 LeetCode N-Queens

题目:The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, return all distinct solutions to the n-queens

2014-05-27 20:27:47 302

原创 LeetCode Merge Intervals

题目:Given a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18]./** * Definition for an interval. * struc

2014-05-27 17:39:17 240

原创 LeetCode Insert Interval

题目:Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start ti

2014-05-27 16:38:20 294

原创 LeetCode Permutation Sequence

题目:The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence (ie, for n = 3):"123""132""21

2014-05-27 10:46:51 385

原创 LeetCode Rotate List

题目:Given a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->NULL.

2014-05-27 09:38:49 229

原创 LeetCode Simplify Path

题目:Given an absolute path for a file (Unix-style), simplify it.For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c"click to show corner cases.Corner Cases:

2014-05-26 22:13:04 259

原创 LeetCode Minimum Window Substring

题目: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 = "ADOBECODEBANC"T = "ABC"Minimum windo

2014-05-26 20:58:19 301

原创 LeetCode Word Search

题目: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 "adjacent" cells are those horizontally or v

2014-05-26 16:28:47 263

原创 LeetCode Search in Rotated Sorted Array II

题目:Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?Write a function to determine if a given target

2014-05-24 17:03:12 252

原创 LeetCode Scramble String

题目:Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation of s1 = "great": great /

2014-05-24 16:04:23 234

原创 LeetCode Restore IP Addresses

题目:Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given "25525511135",return ["255.255.11.135", "255.255.111.35"]

2014-05-24 10:03:24 273

原创 LeetCode Unique Binary Search Trees II

题目:Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.For example,Given n = 3, your program should return all 5 unique BST's shown below. 1

2014-05-22 22:03:34 249

原创 LeetCode Clone Graph

题目:Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ's undirected graph serialization:Nodes are labeled uniquely.We use # as a separat

2014-05-22 17:18:46 258

原创 LeetCode Longest Palindromic Substring

题目:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.

2014-05-22 14:50:29 286

原创 LeetCode Word Break

题目:Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",dict 

2014-05-20 21:10:19 280

原创 LeetCode Longest Substring Without Repeating Characters

题目:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is

2014-05-20 19:20:02 274

原创 LeetCode Longest Valid Parentheses

题目:Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring is

2014-05-20 10:51:21 291

原创 LeetCode Largest Rectangle in Histogram

题目: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 histogram.Above is a histogram wher

2014-05-19 22:40:54 252

原创 LeetCode Maximal Rectangle

题目:Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.

2014-05-19 16:34:15 289

原创 LeetCode Copy List with Random Pointer

题目:A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy of the list./** * Definition for s

2014-05-19 11:22:41 280

原创 微软2014实习生在线测试

题目1 : String reorder时间限制:10000ms单点时限:1000ms内存限制:256MBDescriptionFor this question, your program is required to process an input string containing only ASCII characters be

2014-05-19 10:22:18 484

原创 在O(1)时间删除链表节点

题目:给定单向链表的touzhi

2014-05-19 10:20:05 328

原创 LeetCode Valid Palindrome

题目:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Panama" is a palindrome."race a car" 

2014-05-13 20:37:49 376

原创 LeetCode LRU Cache

题目:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key) - Get the value (will always be positive) of th

2014-05-05 14:38:51 285

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除