← 返回 microsoft 的题目列表Best Time to Buy and Sell Stock and Binary Tree Right Side View
类型:online_judge
Given an array of prices, choose the best time to buy and sell a stock to maximize profit.
Given a binary tree, return the right-side view of its nodes.
Example
Input
prices = [7, 1, 5, 3, 6, 4]
root = [1, null, 2, null, 5, 3]
Output
5
[1, 2, 5]