
LeetCode
文章平均质量分 74
看门猫
码农一个
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode练习题279. Perfect Squares
题目Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.Example 1:Input: n = 12Output: 3Explanation: 12 = 4 + 4 + 4.E...原创 2018-12-09 17:38:54 · 152 阅读 · 0 评论 -
LeetCode练习题322. Coin Change
题目You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of mo...原创 2018-12-01 20:44:59 · 192 阅读 · 0 评论 -
LeetCode练习题221. Maximal Square
题目Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area.Example:Input: 1 0 1 0 01 0 1 1 11 1 1 1 11 0 0 1 0Output: 4 分析这...原创 2018-11-24 22:01:29 · 161 阅读 · 0 评论 -
LeetCode练习题368. Largest Divisible Subset
题目Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies:Si % Sj = 0 or Sj % Si = 0.If there are multiple solutions...原创 2018-11-17 20:23:58 · 324 阅读 · 0 评论 -
LeetCode练习题120. Triangle
题目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 triangle[ [2], [3,4], ...原创 2018-11-10 17:34:50 · 179 阅读 · 0 评论 -
LeetCode练习题300. Longest Increasing Subsequence
题目Given an unsorted array of integers, find the length of longest increasing subsequence.Example:Input: [10, 9, 2, 5, 3, 7, 101, 18] Output: 4 Explanation: The longest increasing subsequence...原创 2018-11-03 22:16:41 · 183 阅读 · 0 评论 -
LeetCode练习题435. Non-overlapping Intervals
题目Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.Note:You may assume the interval's end point is alway...原创 2018-10-28 19:11:18 · 128 阅读 · 0 评论 -
LeetCode练习题839. Similar String Groups
题目Two strings X and Y are similar if we can swap two letters (in different positions) of X, so that it equals Y.For example, "tars" and "rats" are similar (swapping at positions 0 and 2), and "rat...原创 2018-10-14 20:27:13 · 341 阅读 · 0 评论 -
LeetCode练习题785. Is Graph Bipartite?
题目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 nodes into two independent subsets A and B such that every edge...原创 2018-09-30 20:38:46 · 313 阅读 · 0 评论 -
LeetCode练习题452. Minimum Number of Arrows to Burst Balloons
题目There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the horizontal diameter. Since it's horizontal, y-coo...原创 2018-10-21 10:48:39 · 183 阅读 · 0 评论 -
LeetCode练习题743. Network Delay Time
题目There are N network nodes, labelled 1 to N.Given times, a list of travel times as directed edges times[i] = (u, v, w), where u is the source node, v is the target node, and w is the time it take...原创 2018-10-07 20:49:37 · 270 阅读 · 0 评论 -
LeetCode练习题802. Find Eventual Safe States
题目In a directed graph, we start at some node and every turn, walk along a directed edge of the graph. If we reach a node that is terminal (that is, it has no outgoing directed edges), we stop.Now...原创 2018-09-23 20:23:14 · 212 阅读 · 0 评论 -
LeetCode练习题241. Different Ways to Add Parentheses
题目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 +, - and *.Example 1:...原创 2018-09-16 20:26:10 · 363 阅读 · 0 评论 -
LeetCode练习题53. Maximum Subarray
题目Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.Example:Input: [-2,1,-3,4,-1,2,1,-5,4],Output: 6Expl...原创 2018-09-12 16:50:13 · 176 阅读 · 0 评论 -
LeetCode练习题400. Nth Digit
题目Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...Note:n is positive and will fit within the range of a 32-bit signed integer (n < 231).Example 1:...原创 2018-09-05 23:33:56 · 243 阅读 · 0 评论 -
LeetCode练习题807. Max Increase to Keep City Skyline
题目In a 2 dimensional array grid, each value grid[i][j] represents the height of a building located there. We are allowed to increase the height of any number of buildings, by any amount (the amounts...原创 2018-09-05 20:55:16 · 154 阅读 · 0 评论 -
LeetCode练习题207. Course Schedule
题目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 take course 1, which is expressed as a ...原创 2018-12-15 21:33:25 · 191 阅读 · 0 评论