I was confused with the same problem.

but according to @hstall2529 's answer, which makes sense.

Explain it in a more straightforward way would be like:

Step 1: looking for all the numbers of nums1 in nums2.

for example, nums1=[4,1,2] in nums2 would be nums2 [1,3,4,2].

Step 2: get rid of nums1, find the NEXT GREATER NUMBER ONLY in nums2 [1,3,4,2].

Step 3: And you can see in [1,3,4,2]

The next great number of [1] is 3

The next great number of [4] is null, so -1

The next great number of [2] is null since [2] is the last element, no numbers follow it! So the result is -1

Step 4: Back to nums1's sequence, [ 4,1,2] would return [-1, 3, -1]

Hope this helps!