- 博客(342)
- 收藏
- 关注
原创 [leetcode]131. Palindrome Partitioning
[leetcode]131. Palindrome PartitioningAnalysisHappy girls day—— [每天刷题并不难0.0]Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindr...
2019-03-08 15:28:42 296
原创 [leetcode]659. Split Array into Consecutive Subsequences
[leetcode]659. Split Array into Consecutive SubsequencesAnalysisHappy girls day—— [每天刷题并不难0.0]You are given an integer array sorted in ascending order (may contain duplicates), you need to spli...
2019-03-07 15:06:11 366
原创 [leetcode]662. Maximum Width of Binary Tree
[leetcode]662. Maximum Width of Binary TreeAnalysisHappy girls day—— [每天刷题并不难0.0]Given a binary tree, write a function to get the maximum width of the given tree. The width of a tree is the max...
2019-03-07 13:30:55 329
原创 [leetcode]886. Possible Bipartition
[leetcode]886. Possible BipartitionAnalysisStill raining outside…—— [每天刷题并不难0.0]Given a set of N people (numbered 1, 2, …, N), we would like to split everyone into two groups of any size.Each ...
2019-03-03 11:13:30 313
原创 [leetcode]300. Longest Increasing Subsequence
[leetcode]300. Longest Increasing SubsequenceAnalysisraining outside…—— [每天刷题并不难0.0]Given an unsorted array of integers, find the length of longest increasing subsequence.Explanation:Inspire...
2019-03-03 10:17:24 176
原创 [leetcode]240. Search a 2D Matrix II
[leetcode]240. Search a 2D Matrix IIAnalysisraining outside…—— [每天刷题并不难0.0]Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:...
2019-03-02 13:38:47 177
原创 [leetcode]240. Search a 2D Matrix II
[leetcode]240. Search a 2D Matrix IIAnalysisraining outside…—— [每天刷题并不难0.0]Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:...
2019-03-02 10:48:45 113
原创 [leetcode]962. Maximum Width Ramp
[leetcode]962. Maximum Width RampAnalysisraining outside…—— [每天刷题并不难0.0]Given an array A of integers, a ramp is a tuple (i, j) for which i < j and A[i] <= A[j]. The width of such a ramp ...
2019-03-02 10:08:21 181
原创 [leetcode]17. Letter Combinations of a Phone Number
[leetcode]17. Letter Combinations of a Phone NumberAnalysisfighting—— [每天刷题并不难0.0]Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number co...
2019-02-28 10:55:52 158
原创 [leetcode]16. 3Sum Closest
[leetcode]16. 3Sum ClosestAnalysisfighting—— [每天刷题并不难0.0]Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the ...
2019-02-28 10:20:33 161
原创 [leetcode]103. Binary Tree Zigzag Level Order Traversal
[leetcode]103. Binary Tree Zigzag Level Order TraversalAnalysisfighting—— [每天刷题并不难0.0]Given a binary tree, return the zigzag level order traversal of its nodes’ values. (ie, from left to right,...
2019-02-28 09:54:42 150
原创 [leetcode]313. Super Ugly Number
[leetcode]313. Super Ugly NumberAnalysismissing—— [每天刷题并不难0.0]Write a program to find the nth super ugly number.Super ugly numbers are positive numbers whose all prime factors are in the given...
2019-02-26 11:25:06 150
原创 [leetcode]162. Find Peak Element
[leetcode]162. Find Peak ElementAnalysismissing—— [每天刷题并不难0.0]A peak element is an element that is greater than its neighbors.Given an input array nums, where nums[i] ≠ nums[i+1], find a peak ...
2019-02-26 10:23:15 177
原创 [leetcode]279. Perfect Squares
[leetcode]279. Perfect SquaresAnalysismissing—— [每天刷题并不难0.0]Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, …) which sum to n.Explanatio...
2019-02-26 09:47:37 147
原创 [leetcode]974. Subarray Sums Divisible by K
[leetcode]974. Subarray Sums Divisible by KAnalysis努力工作哇—— [每天刷题并不难0.0]Given an array A of integers, return the number of (contiguous, non-empty) subarrays that have a sum divisible by K.Expl...
2019-02-23 10:37:50 230
原创 [leetcode]114. Flatten Binary Tree to Linked List
[leetcode]114. Flatten Binary Tree to Linked ListAnalysis努力工作哇—— [每天刷题并不难0.0]Given a binary tree, flatten it to a linked list in-place.Explanation:参考:http://www.cnblogs.com/grandyang/p/42938...
2019-02-23 09:50:13 144
原创 [leetcode]792. Number of Matching Subsequences
[leetcode]792. Number of Matching SubsequencesAnalysis明天就是除夕啦—— [每天刷题并不难0.0]Given string S and a dictionary of words words, find the number of words[i] that is a subsequence of S.Explanation:...
2019-02-03 14:12:59 188
原创 [leetcode]698. Partition to K Equal Sum Subsets
[leetcode]698. Partition to K Equal Sum SubsetsAnalysis终于抽到敬业福啦 哈哈哈—— [每天刷题并不难0.0]Given an array of integers nums and a positive integer k, find whether it’s possible to divide this array into ...
2019-02-01 11:25:19 224
原创 [leetcode]767. Reorganize String
[leetcode]767. Reorganize StringAnalysisholy shit—— [每天刷题并不难0.0]Given a string S, check if the letters can be rearranged so that two characters that are adjacent to each other are not the same....
2019-01-31 11:51:56 161
原创 [leetcode]518. Coin Change 2
[leetcode]518. Coin Change 2Analysis还没工作就想退休—— [每天刷题并不难0.0]You are given coins of different denominations and a total amount of money. Write a function to compute the number of combinations tha...
2019-01-30 11:45:18 167
原创 [leetcode]129. Sum Root to Leaf Numbers
[leetcode]129. Sum Root to Leaf NumbersAnalysis还没工作就想退休—— [每天刷题并不难0.0]Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the roo...
2019-01-30 11:13:49 170
原创 [leetcode]75. Sort Colors
[leetcode]75. Sort ColorsAnalysis还没工作就想退休—— [每天刷题并不难0.0]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 col...
2019-01-30 10:56:54 95
原创 [leetcode]870. Advantage Shuffle
[leetcode]870. Advantage ShuffleAnalysis放假回家效率果然打折—— [每天刷题并不难0.0]Given two arrays A and B of equal size, the advantage of A with respect to B is the number of indices i for which A[i] > B[i]...
2019-01-29 11:42:31 156
原创 [leetcode]491. Increasing Subsequences
[leetcode]491. Increasing SubsequencesAnalysis放假回家效率果然打折—— [每天刷题并不难0.0]Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and th...
2019-01-29 11:16:32 147
原创 [leetcode]738. Monotone Increasing Digits
[leetcode]738. Monotone Increasing DigitsAnalysis放假回家效率果然打折—— [每天刷题并不难0.0]Given a non-negative integer N, find the largest number that is less than or equal to N with monotone increasing digits...
2019-01-29 10:46:19 104
原创 [leetcode]560. Subarray Sum Equals K
[leetcode]560. Subarray Sum Equals KAnalysisummm 心情复杂—— [每天刷题并不难0.0]Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k...
2019-01-22 11:01:43 122
原创 [leetcode]435. Non-overlapping Intervals
[leetcode]435. Non-overlapping IntervalsAnalysis是阴天呢—— [每天刷题并不难0.0]Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non...
2019-01-19 11:45:41 109
原创 [leetcode]915. Partition Array into Disjoint Intervals
[leetcode]915. Partition Array into Disjoint IntervalsAnalysis是阴天呢—— [每天刷题并不难0.0]Given an array A, partition it into two (contiguous) subarrays left and right so that:Every element in left is...
2019-01-19 10:54:48 173
原创 [leetcode]11. Container With Most Water
[leetcode]11. Container With Most WaterAnalysis是阴天呢—— [每天刷题并不难0.0]Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn s...
2019-01-19 09:51:47 86
原创 [leetcode]971. Flip Binary Tree To Match Preorder Traversal
[leetcode]971. Flip Binary Tree To Match Preorder TraversalAnalysis昨天和今天天气都很好鸭~嘻嘻—— [每天刷题并不难0.0]Given a binary tree with N nodes, each node has a different value from {1, …, N}.A node in this ...
2019-01-18 09:52:48 246
原创 [leetcode]380. Insert Delete GetRandom O(1)
[leetcode]380. Insert Delete GetRandom O(1)Analysis出太阳啦~—— [每天刷题并不难0.0]Design a data structure that supports all following operations in average O(1) time.insert(val): Inserts an item val to ...
2019-01-17 10:20:36 189
原创 [leetcode]785. Is Graph Bipartite?
[leetcode]785. Is Graph Bipartite?Analysis出太阳啦~—— [每天刷题并不难0.0]Given an undirected graph, return true if and only if it is bipartite.Recall that a graph is bipartite if we can split it’s set of...
2019-01-16 11:42:11 175
原创 [leetcode]795. Number of Subarrays with Bounded Maximum
[leetcode]795. Number of Subarrays with Bounded MaximumAnalysis出太阳啦~—— [每天刷题并不难0.0]We are given an array A of positive integers, and two positive integers L and R (L <= R).Return the number...
2019-01-16 11:20:00 114
原创 [leetcode]731. My Calendar II
[leetcode]731. My Calendar IIAnalysis出太阳啦~—— [每天刷题并不难0.0]Implement a MyCalendarTwo class to store your events. A new event can be added if adding the event will not cause a triple booking.Your...
2019-01-16 10:40:41 252
原创 [leetcode]881. Boats to Save People
[leetcode]881. Boats to Save PeopleAnalysis出太阳啦~—— [每天刷题并不难0.0]The i-th person has weight people[i], and each boat can carry a maximum weight of limit.Each boat carries at most 2 people at the...
2019-01-14 10:29:53 167
原创 [leetcode]436. Find Right Interval
[leetcode]436. Find Right IntervalAnalysis出太阳啦~—— [每天刷题并不难0.0]Given a set of intervals, for each of the interval i, check if there exists an interval j whose start point is bigger than or equal...
2019-01-14 09:52:12 96
原创 [leetcode]289. Game of Life
[leetcode]289. Game of LifeAnalysis2019年还没见过太阳,等一个晴天!!!—— [每天刷题并不难0.0]According to the Wikipedia’s article: “The Game of Life, also known simply as Life, is a cellular automaton devised by the ...
2019-01-11 11:41:07 153
原创 [leetcode]764. Largest Plus Sign
[leetcode]764. Largest Plus SignAnalysis2019年还没见过太阳,等一个晴天!!!—— [每天刷题并不难0.0]In a 2D grid from (0, 0) to (N-1, N-1), every cell contains a 1, except those cells in the given list mines which are ...
2019-01-11 10:22:26 279
原创 [leetcode]688. Knight Probability in Chessboard
[leetcode]688. Knight Probability in ChessboardAnalysis富婆怎么还不来找我—— [每天刷题并不难0.0]On an NxN chessboard, a knight starts at the r-th row and c-th column and attempts to make exactly K moves. The ro...
2019-01-07 11:04:26 131
原创 [leetcode]153. Find Minimum in Rotated Sorted Array
[leetcode]153. Find Minimum in Rotated Sorted ArrayAnalysis富婆怎么还不来找我—— [每天刷题并不难0.0]Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., [0,1,2,...
2019-01-07 09:58:15 77
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人