摘要:
Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example: Given the below binary ... 阅读全文
摘要:
There are N gas stations along a circular route, where the amount of gas at station i isgas[i].You have a car with an unlimited gas ta... 阅读全文
摘要:
Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer o... 阅读全文
摘要:
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 i... 阅读全文
摘要:
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Ret... 阅读全文
摘要:
Clone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors.OJ's undirected graph serialization: Nodes... 阅读全文
摘要:
There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to t... 阅读全文
摘要:
Given a binary tree, return the preorder traversal of its nodes' values.For example: Given binary tree{1,#,2,3},1 2 / 3return[1,2,3].N... 阅读全文
摘要:
Given a binary tree, return the postorder traversal of its nodes' values.For example: Given binary tree{1,#,2,3},1 \ 2 / 3return[3,2... 阅读全文
摘要:
Say you have an array for which the i th element is the price of a given stock on day i.If you were only permitted to complete at most... 阅读全文