The firm also beat analyst's forecasts as sales for the last three months of its financial year jumped by 73% compared to 12 months earlier.
思路:链表转数组 + 单调栈(从后往前遍历)。与「下一个更大元素」模板一致,仅需将链表值先提取到数组。
,推荐阅读服务器推荐获取更多信息
- 父节点i的左子: 2*i+1, 右子: 2*i+2
candidate.weight /= sum of weights