Why sorting is required here

in valentine problem why do we require to sorting both arrays

We need to find absolute difference, we are using greedy approach.
Sort the array and then start comparing or do whatever you want.
How do you plan to do it without sorting?