- 博客(38)
- 收藏
- 关注
原创 LeetCode 93 Restore IP Addresses
原题:(频率4)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.2
2017-10-23 14:18:54 124
原创 LeetCode 91 Decode Ways
原题:(频率3)A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, deter
2017-10-23 14:01:03 114
原创 LeetCode 49 Group Anagrams
原题:(频率4)Given an array of strings, group anagrams together.For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return:
2017-10-23 13:42:55 119
原创 LeetCode 43 Multiply Strings
原题:(频率3)Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2.Note:The length
2017-10-23 13:38:33 120
原创 LeetCode 22 Generate Parentheses
原题:(频率4)Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3,
2017-10-23 13:19:19 121
原创 LeetCode 17 Letter Combinations of a Phone Number
原题:(频率3)Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just li
2017-10-19 16:06:51 145
原创 LeetCode 12 Integer to Roman
原题:(频率4)Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.题意:把Inte
2017-10-19 15:53:31 126
原创 LeetCode 8 String to Integer (atoi)
原题:(频率5)Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do
2017-10-19 15:38:37 150
原创 LeetCode 5 Longest Palindromic Substring
原题:(频率2)Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:
2017-10-19 15:19:30 118
原创 LeetCode 3 Longest Substring Without Repeating Characters
原题:(频率2)Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "
2017-10-19 14:52:55 129
原创 LeetCode 125 Valid Palindrome
原题:(频率5)Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a
2017-10-19 14:39:24 134
原创 LeetCode 58 Length of Last Word
原题:(频率1)Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.
2017-10-19 14:34:21 101
原创 LeetCode 38 Count and Say
原题:(频率2)Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example,Given n = 3,You shoul
2017-10-19 14:28:42 121
原创 LeetCode 28 Implement strStr()
Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example,Given n = 3,You shoul
2017-10-19 14:19:39 132
原创 LeetCode 20. Valid Parentheses
原题:(频率5)Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}
2017-10-19 14:11:55 110
原创 LeetCode 14.Longest Common Prefix
原题:(频率2)Write a function to find the longest common prefix string amongst an array of strings.题意:此题题意描述有问题,其实只是求最长前缀
2017-10-19 14:07:50 128
原创 LeetCode 59 Spiral Matrix II
原题:(频率2)Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.Your algorithm's runtime com
2017-10-13 15:24:05 130
原创 LeetCode 56 Merge Intervals
原题:(频率5)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,
2017-10-13 15:04:46 142
原创 LeetCode 55 Jump Game
原题:(频率2)Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents y
2017-10-13 14:33:29 119
原创 LeetCode 48 Rotate Image
LeetCode 48 Rotate ImageYou are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Note:You have to rotate the image in-pla
2017-10-13 14:01:44 158
原创 LeetCode 39,40,46,47,78,90 回溯法专题
回溯法介绍:回溯法对任一解的生成,一般都采用逐步扩大解的方式。每前进一步,都试图在当前部分解的基础上扩大该部分解。它在问题的状态空间树中,从开始结点(根结点)出发,以深度优先搜索整个状态空间。这个开始结点成为活结点,同时也成为当前的扩展结点。在当前扩展结点处,搜索向纵深方向移至一个新结点。这个新结点成为新的活结点,并成为当前扩展结点。如果在当前扩展结点处不能再向纵深方向移动,则当前扩展结点就成
2017-10-12 14:43:05 225
原创 LeetCode 34 Search for a Range
原题:(频率3)Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.Your algorithm's runtime complex
2017-10-12 13:11:32 154
原创 LeetCode 33 Search in Rotated Sorted Array
原题:(频率3)Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7
2017-10-12 12:48:39 122
原创 LeetCode 31
原题:(频率2)Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not pos
2017-10-12 12:34:22 124
原创 LeetCode 16
原题:Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may as
2017-10-12 11:18:58 91
原创 LeetCode 15 3Sum
原题:(此题高频)Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zer
2017-10-12 11:08:59 115
原创 leetCode 11
原题:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find t...
2017-10-12 10:43:25 160
原创 LeetCode 120
原题:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following tria
2017-10-10 19:19:23 115
原创 LeetCode 106
原题:Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.
2017-10-10 14:24:05 291
原创 LeetCode 105
原题:Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.
2017-10-10 13:30:40 207
原创 LeetCode 81和33
原题:Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Write a function to determine if a given target is in ...
2017-10-09 23:29:02 228
原创 LeetCode 80
原题:Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array nums = [1,1,1,2,2,3],Your function should return length = 5
2017-10-09 21:07:51 262
原创 LeetCode 75 荷兰三色旗
原题:Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we wil
2017-10-09 15:54:15 340
原创 LeetCode 74 Search a 2D Matrix
原题:Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted from left to right.The first integer of each row ...
2017-10-09 14:49:16 167
原创 LeetCode 73
原题:Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.题意:给一个矩阵,如果某点的值为0,那么把它所在的行
2017-10-09 13:35:25 210
原创 LeetCode 64
原题:Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either d
2017-10-09 11:48:03 116
原创 LeetCode 63
原题:Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space is marked as 1 and 0 respectively
2017-10-06 20:30:43 235
原创 LeetCode 62
原题:A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to rea
2017-10-03 21:39:03 221
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人