{"id":"nge-linear-time","text":"`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).","truth_value":"IN","source":"entries/2026/06/06/next-greater-element-i-solution.md","source_url":"","source_hash":"","justifications":[],"dependents":[],"metadata":{},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"nge-linear-time","truth_value":"IN","reason":"premise"}]}}