{"id":"nge-precompute-then-query","text":"`next_greater_element` separates into two phases: a single O(n) pass over nums2 using a monotonic stack to build the full next-greater mapping, then O(1)-per-element dict lookups for each query in nums1.","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-precompute-then-query","truth_value":"IN","reason":"premise"}]}}