![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
文章平均质量分 66
扑街中的二娃
这个作者很懒,什么都没留下…
展开
-
[LeetCode] 448. Find All Numbers Disappeared in an Array
题目链接: https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/DescriptionGiven an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear原创 2016-12-14 21:56:07 · 870 阅读 · 0 评论 -
[LeetCode] 442. Find All Duplicates in an Array
题目链接: https://leetcode.com/problems/find-all-duplicates-in-an-array/description/DescriptionGiven an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear on原创 2017-11-01 20:22:16 · 277 阅读 · 0 评论 -
[LeetCode] 34. Search for a Range
题目链接: https://leetcode.com/problems/search-for-a-range/description/DescriptionGiven an array of integers sorted in ascending order, find the starting and ending position of a given target value.Your a原创 2017-11-12 20:21:41 · 320 阅读 · 0 评论 -
[LeetCode] 57. Insert Interval
题目链接: https://leetcode.com/problems/insert-interval/description/DescriptionGiven a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that t原创 2017-11-12 21:00:31 · 484 阅读 · 0 评论 -
[LeetCode] 475. Heaters
题目链接: https://leetcode.com/problems/heaters/description/DescriptionWinter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to warm all the houses.Now,原创 2017-11-19 23:23:19 · 560 阅读 · 0 评论 -
[LeetCode] 3. Longest Substring Without Repeating Characters
题目链接: https://leetcode.com/problems/longest-substring-without-repeating-characters/description/DescriptionGiven a string, find the length of the longest substring without repeating characters.Examples原创 2017-11-20 00:17:59 · 303 阅读 · 0 评论 -
[LeetCode] 337. House Robber III
题目链接: https://leetcode.com/problems/house-robber-iii/description/DescriptionThe thief has found himself a new place for his thievery again. There is only one entrance to this area, called the “root.”原创 2017-11-29 10:56:29 · 512 阅读 · 0 评论 -
[LeetCode] 207. Course Schedule
题目链接: https://leetcode.com/problems/course-schedule/description/DescriptionThere are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to原创 2017-11-24 10:40:35 · 279 阅读 · 0 评论 -
[LeetCode] 540. Single Element in a Sorted Array
题目链接: https://leetcode.com/problems/single-element-in-a-sorted-array/description/DescriptionGiven a sorted array consisting of only integers where every element appears twice except for one element wh原创 2017-12-04 15:17:21 · 448 阅读 · 0 评论 -
[LeetCode] 496. Next Greater Element I
题目链接: https://leetcode.com/problems/next-greater-element-i/description/DescriptionYou are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the原创 2017-11-26 11:01:23 · 304 阅读 · 0 评论 -
[LeetCode] 310. Minimum Height Trees
题目链接: https://leetcode.com/problems/minimum-height-trees/description/DescriptionFor a undirected graph with tree characteristics, we can choose any node as the root. The result graph is then a rooted原创 2017-12-14 10:42:23 · 833 阅读 · 0 评论 -
[LeetCode] 75. Sort Colors
题目链接: https://leetcode.com/problems/sort-colors/description/DescriptionGiven an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colo原创 2017-12-23 09:09:37 · 289 阅读 · 0 评论 -
[LeetCode] 503. Next Greater Element II
题目链接: https://leetcode.com/problems/next-greater-element-ii/description/DescriptionGiven a circular array (the next element of the last element is the first element of the array), print the Next Great原创 2017-11-27 23:52:34 · 298 阅读 · 0 评论 -
[LeetCode] 474. Ones and Zeroes
题目链接: https://leetcode.com/problems/ones-and-zeroes/description/DescriptionIn the computer world, use restricted resource you have to generate maximum benefit is what we always want to pursue.For now,原创 2017-12-16 09:16:26 · 499 阅读 · 0 评论 -
[LeetCode] 103. Binary Tree Zigzag Level Order Traversal
题目链接: https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/description/DescriptionGiven a binary tree, return the zigzag level order traversal of its nodes’ values. (ie, from left to原创 2017-12-07 14:14:07 · 357 阅读 · 0 评论 -
[LeetCode] 581. Shortest Unsorted Continuous Subarray
题目链接: https://leetcode.com/problems/shortest-unsorted-continuous-subarray/description/DescriptionGiven an integer array, you need to find one continuous subarray that if you only sort this subarray in原创 2017-12-08 09:31:32 · 272 阅读 · 0 评论 -
[LeetCode] 25. Reverse Nodes in k-Group
题目链接: https://leetcode.com/problems/reverse-nodes-in-k-group/description/DescriptionGiven a linked list, reverse the nodes of a linked list k at a time and return its modified list.k is a positive int原创 2017-12-27 11:11:18 · 343 阅读 · 0 评论 -
[LeetCode] 621. Task Scheduler
题目链接: https://leetcode.com/problems/task-scheduler/description/DescriptionGiven a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters repres原创 2018-01-07 11:07:41 · 818 阅读 · 0 评论 -
[LeetCode] 32. Longest Valid Parentheses
题目链接: https://leetcode.com/problems/longest-valid-parentheses/description/DescriptionGiven a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) paren原创 2017-11-01 19:37:17 · 262 阅读 · 0 评论 -
[LeetCode] 41. First Missing Positive
题目链接: https://leetcode.com/problems/first-missing-positive/description/DescriptionGiven an unsorted integer array, find the first missing positive integer.For example, Given [1,2,0] return 3, and [3原创 2017-10-23 22:42:44 · 336 阅读 · 0 评论 -
[LeetCode] 63. Unique Paths II
题目链接: https://leetcode.com/problems/unique-paths-ii/DescriptionFollow up for “Unique Paths”:Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and原创 2016-12-14 13:07:13 · 382 阅读 · 0 评论 -
[LeetCode] 62. Unique Paths
DescriptionA 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 reac原创 2016-12-13 23:51:00 · 478 阅读 · 0 评论 -
[LeetCode] 330. Patching Array
DescriptionGiven a sorted positive integer array nums and an integer n, add/patch elements to the array such that any number in range [1, n] inclusiv原创 2016-12-05 23:32:41 · 735 阅读 · 0 评论 -
[LeetCode] 35. Search Insert Position
题目链接: https://leetcode.com/problems/search-insert-position/DescriptionGiven a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it原创 2016-12-15 14:34:11 · 405 阅读 · 0 评论 -
[LeetCode] 22. Generate Parentheses
题目链接: https://leetcode.com/problems/generate-parentheses/DescriptionGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a s原创 2016-12-15 16:02:54 · 433 阅读 · 0 评论 -
[LeetCode] 78. Subsets
题目链接: https://leetcode.com/problems/subsets/DescriptionGiven a set of distinct integers, nums, return all possible subsets.Note: The solution set must not contain duplicate subsets.For example, If nu原创 2016-12-15 17:12:46 · 486 阅读 · 0 评论 -
[LeetCode] 556. Next Greater Element III
题目链接: https://leetcode.com/problems/next-greater-element-iii/description/DescriptionGiven a positive 32-bit integer n, you need to find the smallest 32-bit integer which has exactly the same digits ex原创 2017-09-14 00:17:06 · 526 阅读 · 0 评论 -
[LeetCode] 145. Binary Tree Postorder Traversal
[LeetCode] 145. Binary Tree Postorder Traversal 题目链接: https://leetcode.com/problems/binary-tree-postorder-traversal/description/DescriptionGiven a binary tree, return the postorder traversal of its原创 2017-09-06 21:18:50 · 319 阅读 · 0 评论 -
[LeetCode] 673. Number of Longest Increasing Subsequence
题目链接: https://leetcode.com/problems/number-of-longest-increasing-subsequence/description/DescriptionGiven an unsorted array of integers, find the number of longest increasing subsequence.Example 1:Inp原创 2017-09-23 09:32:44 · 918 阅读 · 0 评论 -
[LeetCode] 547. Friend Circles
题目链接: https://leetcode.com/problems/friend-circles/description/DescriptionThere are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For e原创 2017-09-25 22:43:01 · 544 阅读 · 0 评论 -
[LeetCode] 135. Candy
题目链接: https://leetcode.com/problems/subsets/DescriptionThere are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the followin原创 2017-09-09 16:00:46 · 438 阅读 · 0 评论 -
[LeetCode] 134. Gas Station
题目链接: https://leetcode.com/problems/gas-station/description/DescriptionThere are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited原创 2017-09-20 00:10:50 · 425 阅读 · 0 评论 -
[LeetCode] 658. Find K Closest Elements
题目链接: https://leetcode.com/problems/find-k-closest-elements/description/DescriptionGiven a sorted array, two integers k and x, find the k closest elements to x in the array. The result should also be原创 2017-10-03 20:34:44 · 1450 阅读 · 0 评论 -
[LeetCode] 467. Unique Substrings in Wraparound String
题目链接: https://leetcode.com/problems/unique-substrings-in-wraparound-string/description/DescriptionConsider the string s to be the infinite wraparound string of “abcdefghijklmnopqrstuvwxyz”, so s will原创 2017-10-27 18:02:49 · 318 阅读 · 0 评论 -
[LeetCode] 4. Median of Two Sorted Arrays
题目链接: https://leetcode.com/problems/median-of-two-sorted-arrays/description/DescriptionThere are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays原创 2017-10-20 23:19:34 · 274 阅读 · 0 评论 -
[LeetCode] 650. 2 Keys Keyboard
题目链接: https://leetcode.com/problems/2-keys-keyboard/description/DescriptionInitially on a notepad only one character ‘A’ is present. You can perform two operations on this notepad for each step:Copy原创 2017-10-14 20:08:07 · 456 阅读 · 0 评论 -
[LeetCode] 410. Split Array Largest Sum
题目链接: https://leetcode.com/problems/split-array-largest-sum/description/DescriptionGiven an array which consists of non-negative integers and an integer m, you can split the array into m non-em原创 2018-01-08 12:08:45 · 728 阅读 · 0 评论