The secret perks of driving electric Link: https://www.ted.com/talks/cynthia_williams_the_secret_perks_of_driving_electric
Speaker: Cynthia Williams
Date: July 2023 文章目录 The secret perks of driving electricIntroductionVocabularyTranscriptSummary后记 …
基础思路:
维持栈单调递减,一旦出现元素大于栈顶元素,就可以计算雨水量,同时填坑(弹出栈顶元素)
需要注意:
单调栈通常保存的是下标,用于计算距离
public static int trap2(int[…