![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
文章平均质量分 77
wjfjw1994
这个作者很懒,什么都没留下…
展开
-
LeetCode Algorithms 1. Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use thesame原创 2017-02-23 10:11:34 · 219 阅读 · 0 评论 -
LeetCode Algorithms 5. Longest Palindromic Substring
题目难度: Medium原题描述:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: "babad"Output: "bab"Note: "ab原创 2017-04-16 22:09:44 · 323 阅读 · 0 评论 -
LeetCode Algorithms 42. Trapping Rain Water
题目难度: Hard原题描述:Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given原创 2017-05-11 20:16:34 · 239 阅读 · 0 评论 -
LeetCode Algorithms 22. Generate Parentheses
题目难度: Medium原题描述:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:[ "((()))",原创 2017-04-21 14:31:43 · 217 阅读 · 0 评论 -
LeetCode Algorithms 34. Search for a Range
题目难度: Medium原题描述:Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the or原创 2017-05-06 14:53:29 · 249 阅读 · 0 评论 -
LeetCode Algorithms 55. Jump Game
题目难度: Medium原题描述:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that原创 2017-05-18 19:00:41 · 178 阅读 · 0 评论 -
LeetCode Algorithms 47. Permutations II
题目难度: Medium原题描述:Given a collection of distinct numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[ [1,2,3], [1,3,2], [2,1,3], [2,原创 2017-06-01 21:01:10 · 215 阅读 · 0 评论 -
LeetCode Algorithms 46. Permutations
题目难度: Medium原题描述:Given a collection of distinct numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[ [1,2,3], [1,3,2], [2,1原创 2017-06-07 22:49:25 · 192 阅读 · 0 评论 -
LeetCode Algorithms 113. Path Sum II
题目难度: Medium原题描述:Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree and sum = 22,原创 2017-06-25 15:00:13 · 165 阅读 · 0 评论 -
LeetCode Algorithms 33. Search in Rotated Sorted Array
题目难度: Medium原题描述: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).You are given a target原创 2017-05-02 09:24:59 · 257 阅读 · 0 评论 -
LeetCode Algorithms 105. Construct Binary Tree from Preorder and Inorder Traversal
题目难度: Medium原题描述: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-03-25 20:55:34 · 190 阅读 · 0 评论 -
LeetCode Algorithms 2. Add Two Numbers
原题描述:You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and r原创 2017-02-26 11:28:19 · 214 阅读 · 0 评论 -
LeetCode Algorithms 241. Different Ways to Add Parentheses
题目难度: Medium原题描述:Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are原创 2017-03-03 16:29:57 · 219 阅读 · 0 评论 -
LeetCode Algorithms 98. Validate Binary Search Tree
题目难度: Medium原题描述:Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:(1)The left subtree of a node contains only nodes with ke原创 2017-03-19 15:19:09 · 206 阅读 · 0 评论 -
LeetCode Algorithms 3. Longest Substring Without Repeating Characters
题目难度: Medium原题描述:Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "原创 2017-03-10 17:06:12 · 200 阅读 · 0 评论 -
LeetCode Algorithms 11. Container With Most Water
题目难度: Medium原题描述: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 linei is原创 2017-03-11 10:01:29 · 207 阅读 · 0 评论 -
LeetCode Algorithms 17. Letter Combinations of a Phone Number
题目难度: Medium原题描述: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原创 2017-03-29 14:49:18 · 209 阅读 · 0 评论 -
LeetCode Algorithms 19. Remove Nth Node From End of List
题目难度: Medium原题描述:Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the原创 2017-03-23 21:40:09 · 201 阅读 · 0 评论 -
LeetCode Algorithms 32. Longest Valid Parentheses
题目难度: Hard原题描述:Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parenthese原创 2017-04-09 20:37:03 · 196 阅读 · 0 评论 -
LeetCode Algorithms 210. Course Schedule II
题目难度: Medium原题描述:There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first ta原创 2017-06-25 23:02:30 · 193 阅读 · 0 评论