摘要:LeetCode: Sort ColorsGiven an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colo...
阅读全文
随笔分类 - LeetCode
LeetCode解题报告。
摘要:LeetCode: Sort ColorsGiven an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colo...
阅读全文
摘要:LeetCode: Minimum Window SubstringGiven a string S and a string T, find the minimum window in S which will contain all the characters in T in complexi...
阅读全文
摘要:LeetCode: CombinationsGiven 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 solu...
阅读全文
摘要:LeetCode: Word SearchGiven a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacen...
阅读全文
摘要:LeetCode: Remove Duplicates from Sorted ArrayGiven a sorted array, remove the duplicates in place such that each element appear only once and return t...
阅读全文
摘要:LeetCode: Search in Rotated Sorted ArraySuppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 ...
阅读全文
摘要:LeetCode: Remove Duplicates from Sorted ListGiven a sorted linked list, delete all duplicates such that each element appear only once. For example,Giv...
阅读全文
摘要:LeetCode: Maximal RectangleGiven a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.地址:htt...
阅读全文
摘要:LeetCode: Largest Rectangle in HistogramGiven n non-negative integers representing the histogram's bar height where the width of each bar is 1, find t...
阅读全文
摘要:LeetCode: Partition ListGiven a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.Y...
阅读全文
摘要:LeetCode: Scramble StringGiven a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is o...
阅读全文
摘要:LeetCode: Merge Sorted ArrayGiven two sorted integer arrays A and B, merge B into A as one sorted array. Note:You may assume that A has enough space (...
阅读全文
摘要:LeetCode: Gray CodeThe gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n represen...
阅读全文
摘要:LeetCode: Decode WaysA message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given a...
阅读全文
摘要:LeetCode: SubsetsGiven a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The soluti...
阅读全文
摘要:LeetCode: Reverse Linked ListReverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given 1->2->3->4->5->NULL, m = 2 ...
阅读全文
摘要:LeetCode: Restore IP AddressesGiven a string containing only digits, restore it by returning all possible valid IP address combinations. For example:G...
阅读全文
摘要:LeetCode: Binary Tree Inorder TraversalGiven a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}...
阅读全文
摘要:LeetCode: Unique Binary Search TreesGiven n, how many structurally unique BST's (binary search trees) that store values 1...n? For example,Given n = 3...
阅读全文
摘要:LeetCode: Interleaving StringGiven s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example,Given:s1 = "aabcc",s2 = "dbbca"...
阅读全文
|