leetcode 129. Sum Root to Leaf Numbers ----- java
摘要:Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 whic
阅读全文
leetcode 128. Longest Consecutive Sequence ----- java
摘要:Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example,Given [100, 4, 200, 1, 3, 2],The longes
阅读全文
leetcode 127. Word Ladder ----- java
摘要:Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord,
阅读全文
leetcode 126. Word Ladder II ----- java
摘要:Given two words (beginWord and endWord), and a dictionary's word list, find all shortest transformation sequence(s) from beginWord to endWord, such th
阅读全文
leetcode 125. Valid Palindrome ----- java
摘要:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan
阅读全文
leetcode 124. Binary Tree Maximum Path Sum ----- java
摘要:Given a binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any node in th
阅读全文
leetcode 123. Best Time to Buy and Sell Stock III ----- java
摘要: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 comple
阅读全文
leetcode 122. Best Time to Buy and Sell Stock II ----- java
摘要: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 comple
阅读全文
leetcode 121. Best Time to Buy and Sell Stock ----- java
摘要: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
阅读全文
leetcode 120 Triangle ----- java
摘要: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 fo
阅读全文
leetcode 115 Distinct Subsequences ----- java
摘要:Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence of a string is a new string which is formed from t
阅读全文
leetcode 119 Pascal's Triangle II ----- java
摘要:Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1]. Note:Could you optimize your algorithm to us
阅读全文
leetcode 118 Pascal's Triangle ----- java
摘要:Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return 用的比价暴力的方法, 也是最快的。
阅读全文
leetcode 117 Populating Next Right Pointers in Each Node II ----- java
摘要:Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tree could be any binary tree? Would your previous solution sti
阅读全文
leetcode 116 Populating Next Right Pointers in Each Node ----- java
摘要:Given a binary tree Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL
阅读全文
leetcode 114 Flatten Binary Tree to Linked List ----- java
摘要:Given a binary tree, flatten it to a linked list in-place. For example,Given The flattened tree should look like: 这道题就是将数变为只有右节点的树。 递归,不是很难。 递归的时候求出左节
阅读全文
leetcode 113 Path Sum II ----- java
摘要: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
阅读全文
leetcode 112 Path Sum ----- java
摘要:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. F
阅读全文
leetcode 111 Minimum Depth of Binary Tree ----- java
摘要:Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l
阅读全文
leetcode 110 Balanced Binary Tree ----- java
摘要:Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the dept
阅读全文
|
|
|