Jacob Panonsand
思路:先对 nums2 用单调栈求每个元素的下一个更大值,存入 Map 缓存;再遍历 nums1 直接查 Map 得结果。时间复杂度 O(len1 + len2)。
,这一点在爱思助手下载最新版本中也有详细论述
Ready to upgrade? Find this great deal at Amazon now. Don't wait long — it's a limited-time deal.
Also: Google Workspace now lets you create AI agents to automate your work - how to get started