![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
文章平均质量分 75
看门猫
码农一个
展开
-
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 = 12 Output: 3 Explanation: 12 = 4 + 4 + 4. E...原创 2018-12-09 17:38:54 · 118 阅读 · 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 · 126 阅读 · 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 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0 Output: 4 分析 这...原创 2018-11-24 22:01:29 · 109 阅读 · 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 · 275 阅读 · 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 · 119 阅读 · 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 · 134 阅读 · 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 · 84 阅读 · 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 · 300 阅读 · 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 · 249 阅读 · 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 · 139 阅读 · 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 · 225 阅读 · 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 · 155 阅读 · 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 · 305 阅读 · 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: 6 Expl...原创 2018-09-12 16:50:13 · 112 阅读 · 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 · 165 阅读 · 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 · 117 阅读 · 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 · 140 阅读 · 0 评论