![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
文章平均质量分 67
早起的鸟儿有虫吃h
这个作者很懒,什么都没留下…
展开
-
[LeetCode] 5. Longest Palindromic Substring
题目:https://leetcode.com/problems/longest-palindromic-substring/description/Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Ex原创 2017-09-17 18:27:20 · 136 阅读 · 0 评论 -
[LeetCode] Add Two Numbers
题目:https://leetcode.com/problems/add-two-numbers/description/题目描述You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order a原创 2017-08-31 21:01:27 · 199 阅读 · 0 评论 -
[LeetCode] 3. Longest Substring Without Repeating Characters
题目:https://leetcode.com/problems/add-two-numbers/description/题目描述Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb"原创 2017-09-10 16:09:06 · 148 阅读 · 0 评论 -
[LeetCode] 4. Median of Two Sorted Arrays
题目:https://leetcode.com/problems/longest-substring-without-repeating-characters/description/题目描述There are two sorted arrays nums1 and nums2 of size m and n respectively.原创 2017-09-10 18:00:53 · 157 阅读 · 0 评论 -
[LeetCode] 19. Remove Nth Node From End of List
题目:https://leetcode.com/problems/remove-nth-node-from-end-of-list/description/题目Given a linked list, remove the nth node from the end of list and return its head.For example, Given linke原创 2017-10-05 16:36:17 · 161 阅读 · 0 评论 -
[LeetCode] 11. Container With Most Water
题目:https://leetcode.com/problems/container-with-most-water/description/题目Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical line原创 2017-10-01 16:07:03 · 165 阅读 · 0 评论 -
[LeetCode] 20. Valid Parentheses
题目:https://leetcode.com/problems/valid-parentheses/description/题目Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The原创 2017-10-08 21:14:40 · 193 阅读 · 0 评论 -
[LeetCode] 15. 3Sum
题目:https://leetcode.com/problems/3sum/description/题目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原创 2017-10-02 10:02:44 · 205 阅读 · 0 评论 -
[LeetCode] 22. Generate Parentheses
题目:https://leetcode.com/problems/generate-parentheses/description/题目Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, give原创 2017-10-19 11:05:08 · 193 阅读 · 0 评论 -
[LeetCode] 17. Letter Combinations of a Phone Number
题目:https://leetcode.com/problems/letter-combinations-of-a-phone-number/description/题目Given a digit string, return all possible letter combinations that the number could represent.A mapping o原创 2017-10-03 10:23:25 · 161 阅读 · 0 评论 -
[LeetCode] 31. Next Permutation
题目:https://leetcode.com/problems/next-permutation/description/题目Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such原创 2017-10-29 10:21:26 · 149 阅读 · 0 评论 -
[LeetCode] 33. Search in Rotated Sorted Array
题:https://leetcode.com/problems/search-in-rotated-sorted-array/description/问题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 bec原创 2017-11-25 22:34:32 · 137 阅读 · 0 评论 -
[LeetCode] 34. Search for a Range
题:https://leetcode.com/problems/search-for-a-range/description/题目Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.Your algorithm’s run原创 2017-11-26 11:29:52 · 184 阅读 · 0 评论 -
[LeetCode] 39. Combination Sum
题目:Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may b转载 2018-02-01 15:33:14 · 171 阅读 · 0 评论 -
[LeetCode] 46. Permutations
题:https://leetcode.com/problems/permutations/description/题目:Given a collection of distinct numbers, return all possible permutations.For example,[1,2,3] have the following permutations:转载 2018-02-02 17:34:51 · 116 阅读 · 0 评论 -
[LeetCode] 48. Rotate Image
题:https://leetcode.com/problems/rotate-image/description/题目You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Note:You have to rotate原创 2018-02-03 20:44:55 · 118 阅读 · 0 评论 -
[LeetCode] 53. Maximum Subarray
题:https://leetcode.com/problems/maximum-subarray/description/题目Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the转载 2018-02-05 22:16:09 · 105 阅读 · 0 评论 -
[LeetCode] 53. Maximum Subarray
题:https://leetcode.com/problems/jump-game/discuss/20917/Linear-and-simple-solution-in-C++题目Given an array of non-negative integers, you are initially positioned at the first index of the转载 2018-02-07 20:48:20 · 102 阅读 · 0 评论 -
[LeetCode] 56. Merge Intervals
题:https://leetcode.com/problems/merge-intervals/description/题目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]....原创 2018-03-04 16:35:01 · 100 阅读 · 0 评论 -
[LeetCode] 70. Climbing Stairs
题:https://leetcode.com/problems/climbing-stairs/description/题目You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many disti...原创 2018-04-15 21:58:15 · 155 阅读 · 0 评论 -
[LeetCode] 1. Two Sum
题:https://leetcode.com/problems/two-sum/description/题目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 wo...原创 2018-04-07 11:57:02 · 93 阅读 · 0 评论 -
[LeetCode] 75. Sort Colors
题:https://leetcode.com/problems/sort-colors/description/题目:Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the c...原创 2018-06-08 00:26:45 · 87 阅读 · 0 评论 -
[LeetCode] 78. Subsets
题:https://leetcode.com/problems/subsets/description/题目Given a set of distinct integers, nums, return all possible subsets (the power set).Note: The solution set must not contain duplicate subs...原创 2018-06-24 12:18:23 · 76 阅读 · 0 评论 -
[LeetCode] 79. Word Search
题:https://leetcode.com/problems/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 “a...原创 2018-06-25 11:41:37 · 84 阅读 · 0 评论 -
[LeetCode] 121. Best Time to Buy and Sell Stock
题:https://leetcode.com/problems/best-time-to-buy-and-sell-stock/description/题目Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to...原创 2018-07-08 11:10:43 · 97 阅读 · 0 评论 -
[LeetCode] 84. Largest Rectangle in Histogram
题:https://leetcode.com/problems/largest-rectangle-in-histogram/description/题目Given n non-negative integers representing the histogram’s bar height where the width of each bar is 1, find the area...转载 2018-07-01 23:18:22 · 86 阅读 · 0 评论 -
[LeetCode] 124. Binary Tree Maximum Path Sum
题:https://leetcode.com/problems/binary-tree-maximum-path-sum/description/题目Given a non-empty binary tree, find the maximum path sum.For this problem, a path is defined as any sequence of nodes f...原创 2018-07-08 18:50:01 · 97 阅读 · 0 评论 -
[LeetCode] 85. Maximal Rectangle
题:https://leetcode.com/problems/maximal-rectangle/description/题目Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containing only 1’s and return its area.Example:...转载 2018-07-02 19:46:08 · 88 阅读 · 0 评论 -
[LeetCode] 136. Single Number
题:https://leetcode.com/problems/single-number/description/题目Given a non-empty array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should h...原创 2018-07-09 19:27:16 · 82 阅读 · 0 评论 -
[LeetCode] 139. Word Break
题:https://leetcode.com/problems/word-break/description/题目Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-sep...原创 2018-07-10 10:39:05 · 73 阅读 · 0 评论 -
[LeetCode] 94. Binary Tree Inorder Traversal
题:https://leetcode.com/problems/binary-tree-inorder-traversal/description/题目Given a binary tree, return the inorder traversal of its nodes’ values.Example:Input: [1,null,2,3] 1 \ ...原创 2018-07-03 17:27:48 · 88 阅读 · 0 评论 -
[LeetCode] 155. Min Stack
题:https://leetcode.com/problems/min-stack/description/题目Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) – Push element x onto stack. p...原创 2018-07-16 21:22:42 · 103 阅读 · 0 评论 -
[LeetCode] 160. Intersection of Two Linked Lists
题:https://leetcode.com/problems/intersection-of-two-linked-lists/description/题目Write a program to find the node at which the intersection of two singly linked lists begins.For example, the fol...原创 2018-07-17 09:56:36 · 74 阅读 · 0 评论 -
[LeetCode] 96. Unique Binary Search Trees
题:https://leetcode.com/problems/unique-binary-search-trees/description/题目Given n, how many structurally unique BST’s (binary search trees) that store values 1 … n?Example:Input: 3 Output: 5...转载 2018-07-04 10:16:24 · 88 阅读 · 0 评论 -
[LeetCode] 98. Validate Binary Search Tree
题:https://leetcode.com/problems/validate-binary-search-tree/description/](https://leetc ode.com/problems/validate-binary-search-tree/description/)题目Given a binary tree, determine if it is a valid...原创 2018-07-04 16:00:16 · 64 阅读 · 0 评论 -
[LeetCode] 42. Trapping Rain Water
题:https://leetcode.com/problems/trapping-rain-water/discuss/17391/Share-my-short-solution.题目Given n non-negative integers representing an elevation map where the width of each bar is 1, compute ...原创 2018-07-11 19:03:06 · 96 阅读 · 0 评论 -
[LeetCode] 100. Same Tree
题:https://leetcode.com/problems/same-tree/description/题目Given two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are struc...原创 2018-07-05 16:33:35 · 82 阅读 · 0 评论 -
[LeetCode] 215. Kth Largest Element in an Array
题:https://leetcode.com/problems/kth-largest-element-in-an-array/description/题目Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not ...原创 2018-07-23 21:41:20 · 82 阅读 · 0 评论 -
[LeetCode] 101. Symmetric Tree( 与 100 对应)
题:https://leetcode.com/problems/symmetric-tree/description/题目Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,...原创 2018-07-06 09:29:21 · 82 阅读 · 0 评论 -
[LeetCode] 169. Majority Element
题:https://leetcode.com/problems/majority-element/description/题目Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You...原创 2018-07-18 19:10:39 · 77 阅读 · 0 评论