In Example 1, it says "For number 2 in the first array, there is no next greater number for it in the second array, so output -1." But 4 is in the second array. What am I missing here?
There is no number that is greater than 2 AND that is at the right of 2 in the second array. 2 being the latest element of this second array, there is obviously no greater element on its right.
The description of this question is so confusing....
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.