@Harrywithcode I had the same issue - think of it like you are examining the value of nums1 and the array index of that value in nums2. For example, consider each of the following elements of num1:

4 -> corresponds to index 2 of nums2, so you note that all values beyond that index (i.e. just the value 2) from num2 are not greater. So output[0] = -1

1 -> corresponds to index 0 of nums 2, so you find that index 1 of nums2 with a value of 3 is > 1 (the value from num1).

2 -> corresponds to index 3 of nums2, so there are no elements beyond that value; output[2] = -1