Status: IN
`next_greater_element` runs in O(n + m) time where n = len(nums2) and m = len(nums1), because each element of nums2 is pushed and popped from the stack at most once (amortized analysis).
Source: entries/2026/06/06/next-greater-element-i-solution.md