<doocs>0496.Next Greater Element I_1.py
def nextGreaterElement( nums1: List[int], nums2: List[int]) -> List[int]:
    m = {}
    stk = []
    for v in nums2:
        while stk and stk[-1] < v:
            m[stk.pop()] = v
        stk.append(v)
    return [m.get(v, -1) for v in nums1]
def sample_funcname ( var_0 : List [ int ] , var_3 : List [ int ] ) -> List [ int ] :
    var_4 = { }
    var_5 = [ ]
    for var_6 in var_3 :
        while var_5 and var_5 [ - 1 ] < var_6 :
            var_4 [ var_5.pop ( ) ] = var_6
        var_5.append ( var_6 )
    return [ var_4.get ( var_6 , - 1 ) for var_6 in var_0 ]
