LeetCode 920. Number of Music Playlists

Your music player contains N different songs and she wants to listen to L (not necessarily different) songs during your trip. You create a playlist ...

2019-01-22 07:25:35

阅读数 22

评论数 0

LeetCode 64. Minimum Path Sum

Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path....

2019-01-22 07:20:33

阅读数 16

评论数 0

LeetCode 259. 3Sum Smaller

Given an array of n integers nums and a target, find the number of index triplets i, j, k with 0 <= i < j < k &a...

2019-01-22 07:18:42

阅读数 10

评论数 0

DP LeetCode 375. Guess Number Higher or Lower II

**We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess w...

2019-01-22 07:17:35

阅读数 13

评论数 0

LeetCode 218. The Skyline Problem

**A city’s skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now suppose you are g...

2019-01-22 07:09:09

阅读数 12

评论数 0

LeetCode 152. Maximum Product Subarray

Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product. Example 1: ...

2019-01-17 10:43:46

阅读数 19

评论数 0

Bottom up专题六 LeetCode 250. Count Univalue Subtrees

LeetCode 250. Count Univalue Subtrees Given a binary tree, count the number of uni-value subtrees. A Uni-value subtree means all nodes of the subtree...

2019-01-17 10:09:21

阅读数 24

评论数 0

Bottom up专题五 LeetCode 333. Largest BST Subtree

Given a binary tree, find the largest subtree which is a Binary Search Tree (BST), where largest means subtree with largest number of nodes in it. No...

2019-01-17 09:54:02

阅读数 91

评论数 0

Bottom up专题四 LeetCode 113. Path Sum II

LeetCode 113. Path Sum II Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum. Note: A leaf is a no...

2019-01-17 08:46:15

阅读数 117

评论数 0

Bottom up专题三 LeetCode 236. Lowest Common Ancestor of a Binary Tree

LeetCode 236. Lowest Common Ancestor of a Binary Tree Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. Acco...

2019-01-17 07:05:59

阅读数 102

评论数 0

Bottom up专题二 LeetCode 98. Validate Binary Search Tree

LeetCode 98. Validate Binary Search Tree Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows...

2019-01-17 06:04:26

阅读数 100

评论数 0

Bottom up专题一 LeetCode124. Binary Tree Maximum Path Sum

Bottom up的方法指的就是把每一个node上需要存的数据都记录在一个新建的类里,dfs的时候,在每一个节点做本节点的操作,然后创建一个新建类的对象,把对象里在此节点应该记录的数据都赋值,然后返回本节点即可。最后返回到root的时候,直接取出root节点的对象里需要的值即可。 LeetCode...

2019-01-17 05:26:05

阅读数 81

评论数 0

Calculator系列问题四 LeetCode 770. Basic Calculator IV

LeetCode 770. Basic Calculator IV Given an expression such as expression = “e + 8 - a + 5” and an evaluation map such as {“e”: 1} (given in terms of ...

2019-01-17 02:58:51

阅读数 83

评论数 0

Calculator系列问题三 LeetCode 772. Basic Calculator III

LeetCode 772. Basic Calculator III Implement a basic calculator to evaluate a simple expression string. The expression string may contain open ( and ...

2019-01-17 02:54:55

阅读数 92

评论数 0

Calculator系列问题二 LeetCode 227. Basic Calculator II

LeetCode 227. Basic Calculator II Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negati...

2019-01-17 02:52:18

阅读数 71

评论数 0

Calculator系列问题一 LeetCode 224. Basic Calculator

LeetCode 224. Basic Calculator Implement a basic calculator to evaluate a simple expression string. The expression string may contain open ( and clos...

2019-01-17 02:48:16

阅读数 76

评论数 0

LeetCode 739. Daily Temperatures

Given a list of daily temperatures T, return a list such that, for each day in the input, tells you how many days you would have to wait until a warm...

2019-01-10 04:48:46

阅读数 16

评论数 0

DP动态规划专题十五:LeetCode 97. Interleaving String

LeetCode 97. Interleaving String Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. Example 1: Input: s1 = "aabc...

2019-01-10 03:42:01

阅读数 25

评论数 0

LeetCode 239. Sliding Window Maximum

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 nu...

2019-01-10 02:16:41

阅读数 14

评论数 0

LeetCode 340. Longest Substring with At Most K Distinct Characters

Given a string, find the length of the longest substring T that contains at most k distinct characters. Example 1: Input: s = "eceba&qu...

2019-01-09 08:35:07

阅读数 29

评论数 0

提示
确定要删除当前文章?
取消 删除
关闭
关闭