
leetcode
于博洋
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【leedcode】392. Is Subsequence
题目: Given a string s and a string t, check if s is subsequence of t. You may assume that there is only lower case English letters in both s and t. t is potentially a very long (length ~= 500,000原创 2017-06-10 21:35:35 · 219 阅读 · 0 评论 -
【leedcode】 Add to List 617. Merge Two Binary Trees
题目: Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You need to merge them into a new bi原创 2017-07-01 10:04:54 · 370 阅读 · 0 评论 -
【leetcode】338. Counting Bits
题目: Total Accepted: 75933Total Submissions: 125118Difficulty: MediumContributor: LeetCode Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate原创 2017-06-02 22:18:15 · 199 阅读 · 0 评论 -
【leedcode】96. Unique Binary Search Trees
题目: Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example, Given n = 3, there are a total of 5 unique BST's. 1 3 3 2 1原创 2017-05-21 15:37:33 · 210 阅读 · 0 评论 -
【leedcode】198. House Robber
题目: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacen原创 2017-05-27 15:15:56 · 236 阅读 · 0 评论 -
【leedcode】53. Maximum Subarray
题目: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2,1,-3,4,-1,2,1,-5,4], the contiguous subarray [4,-原创 2017-05-07 20:39:34 · 195 阅读 · 0 评论 -
【leedcode】70. Climbing Stairs
题目: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? 分析: 由提议,设f(n)是上n阶台原创 2017-05-14 12:24:20 · 170 阅读 · 0 评论 -
【leedcode】122. Best Time to Buy and Sell Stock II
题目: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie,原创 2017-04-22 23:59:08 · 223 阅读 · 0 评论 -
【leedcode】121. Best Time to Buy and Sell Stock
题目: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the原创 2017-05-01 23:38:42 · 177 阅读 · 0 评论 -
【leetcode】455. Assign Cookies
题目: 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 factor gi, which is the minimum size原创 2017-04-15 23:38:54 · 260 阅读 · 0 评论 -
【leedcode】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 expr原创 2017-03-26 01:29:14 · 198 阅读 · 0 评论 -
【leedcode】210. Course Schedule II
题目: 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 expr原创 2017-04-01 10:42:33 · 192 阅读 · 0 评论 -
【leetcode】 513. Find Bottom Left Tree Value
题目: Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Input: 2 / \ 1 3 Output: 1 Example 2: Input: 1 / \ 2原创 2017-04-09 18:31:12 · 172 阅读 · 0 评论 -
【leetcode】215. Kth Largest Element in an Array
题目: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. For example, Given [3,2,1,5,6,4] and k = 2, return原创 2017-03-11 14:04:56 · 172 阅读 · 0 评论 -
【leetcode】399. Evaluate Division
Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given some queries, return the answers. If the answ原创 2017-03-19 00:53:44 · 262 阅读 · 0 评论 -
【LeetCode】144. Binary Tree Preorder Traversal
题目: Given a binary tree, return the preorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [1,2,3]. 本题虽然归结为Medium原创 2017-02-26 13:05:10 · 252 阅读 · 0 评论