![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
文章平均质量分 70
vincentCheungM
这个作者很懒,什么都没留下…
展开
-
Leetcode 241. Different Ways to Add Parentheses
Leetcode 53.Maximum Subarray原创 2017-03-04 11:32:03 · 238 阅读 · 0 评论 -
Leetcode 236. Lowest Common Ancestor of a Binary Tree
Leetcode 236. Lowest Common Ancestor of a Binary Treesource url题目描述Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to the definition of LCA on Wikipe原创 2017-05-13 09:36:27 · 275 阅读 · 0 评论 -
Leetcode 91. Decode Ways
Leetcode 91. Decode Wayssource url题目描述 A message containing letters from A-Z is being encoded to numbers using the following mapping: ‘A’ -> 1 ‘B’ -> 2 … ‘Z’ -> 26 Given an encoded原创 2017-04-23 10:37:14 · 319 阅读 · 0 评论 -
Leetcode 523. Continuous Subarray Sum
Leetcode 523. Continuous Subarray Sumsource url题目描述Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 that原创 2017-05-07 11:00:45 · 301 阅读 · 0 评论 -
Leetcode 239. Sliding Window Maximum
Leetcode 239. Sliding Window Maximumsource url题目描述Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numb原创 2017-05-16 10:09:54 · 237 阅读 · 0 评论 -
Leetcode 113. Path Sum II
Leetcode 113. Path Sum IIsource url题目描述Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum.For example: Given the below binary tree and sum = 22,原创 2017-05-31 11:59:44 · 233 阅读 · 0 评论 -
Leetcode 98. Validate Binary Search Tree
Leetcode 98. Validate Binary Search Treesource url题目描述Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains on原创 2017-06-06 09:57:16 · 248 阅读 · 0 评论 -
Leetcode 215. Kth Largest Element in an Array
Leetcode 215. Kth Largest Element in an Arraysource url题目描述Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.原创 2017-06-03 12:01:25 · 191 阅读 · 0 评论 -
Leetcode 77. Combinations
Leetcode 77. Combinationssource url题目描述Given two integers n and k, return all possible combinations of k numbers out of 1 … n.For example, If n = 4 and k = 2, a solution is:[ [2,4], [3,4], [2,3原创 2017-06-10 18:44:44 · 199 阅读 · 0 评论 -
Leetcode 72. Edit Distance
Leetcode 72. Edit Distancesource url题目描述 Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You have the f原创 2017-04-14 20:34:04 · 225 阅读 · 0 评论 -
Leetcode 152. Maximum Product Subarray
Leetcode 152. Maximum Product Subarraysource url题目描述 Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,原创 2017-04-29 08:21:55 · 242 阅读 · 0 评论 -
Leetcode 513. Find Bottom Left Tree Value
Leetcode 513. Find Bottom Left Tree Valuesource url题目描述 Given a binary tree, find the leftmost value in the last row of the tree.输入:二叉树 输出:最底层的第一片叶子 如:Input: 2 / \ 1 3Output:1Input:原创 2017-03-18 10:20:41 · 209 阅读 · 0 评论 -
Leetcode 207. Course Schedule
Leetcode 207. Course Schedulesource url题目描述 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原创 2017-03-12 11:24:59 · 237 阅读 · 0 评论 -
Leetcode 300. Longest Increasing Subsequence
Leetcode 300. Longest Increasing Subsequencesource url题目描述 Given an unsorted array of integers, find the length of longest increasing subsequence. For example, Given [10, 9, 2, 5, 3, 7, 101, 18原创 2017-04-08 16:50:45 · 279 阅读 · 0 评论 -
Leetcode 435. Non-overlapping Intervals
Leetcode 435. Non-overlapping Intervalssource url题目描述 Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.原创 2017-04-01 12:42:22 · 308 阅读 · 0 评论 -
Leetcode 406. Queue Reconstruction by Height
Leetcode 406. Queue Reconstruction by Heightsource url题目描述 Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height o原创 2017-03-25 14:36:46 · 177 阅读 · 0 评论 -
Leetcode 455. Assign Cookies
Leetcode 455. Assign Cookiessource url题目描述 Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed f原创 2017-03-25 15:30:19 · 181 阅读 · 0 评论 -
Leetcode 322. Coin Change
Leetcode 322. Coin Changesource url题目描述 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原创 2017-04-28 17:49:09 · 227 阅读 · 0 评论 -
Leetcode 53.Maximum Subarray
Leetcode 53.Maximum Subarraysource url题目描述输入:一个数组 输出:该数组中,最大连续子序列和 如:Input:[-2,1,-3,4,-1,2,1,-5,4]Output:6 //[4,-1,2,1]代码int max = 0;//for saving the max sum of sub arraybool init = false;//recursi原创 2017-02-25 17:17:42 · 224 阅读 · 0 评论 -
算法证明题
在计算机算法求解问题当中,经常用时间复杂度和空间复杂度来表示一个算法的运行效率。空间复杂度表示一个算法在计算过程当中要占用的内存空间大小;时间复杂度则表示这个算法运行得到想要的解所需的计算工作量,并不是表示一个程序解决问题需要花多少时间,而是当问题规模扩大后,程序需要的时间长度增长得有多快,即探讨的是当输入值接近无穷时,算法所需工作量的变化快慢程度。也就是说,对于高速处理数据的计算机来说,处理某一原创 2017-07-05 11:21:14 · 2279 阅读 · 0 评论