tasks for today: 1. 拓扑排序 117.软件构建 2. dijkstra算法 47.参加科学大会 --------------------------------------------------------------------------------- 1. 拓扑排序 117.软件构建 In this practice, it involves mainly t
打卡记录 下一个更大元素 IV(单调栈 x2) 链接 class Solution:def secondGreaterElement(self, nums: List[int]) -> List[int]:ans = [-1] * len(nums)s = []t = []for i, x in enumerate(nums):while t and nums[t[-1]] < x:
打卡记录 下一个更大元素 IV(单调栈 x2) 链接 class Solution:def secondGreaterElement(self, nums: List[int]) -> List[int]:ans = [-1] * len(nums)s = []t = []for i, x in enumerate(nums):while t and nums[t[-1]] < x: