Having trouble understanding the question


  • 0

    I seem to be having trouble properly understanding the requirement of this question.
    As per the following example, for 1 in num1, the next greater number in num2 is 3. Why is it not 2 ? Is it because 2 already exists in num1 ?

    Input: nums1 = [4,1,2], nums2 = [1,3,4,2].
    Output: [-1,3,-1]
    Explanation:
        For number 4 in the first array, you cannot find the next greater number for it in the second array, so output -1.
        For number 1 in the first array, the next greater number for it in the second array is 3.
    

    Thanks for any help.


  • 0
    P

    @hckrtst :Also by the same logic for 2 it should be '4' but the answer says '-1'.
    Any idea?


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.