CF div 3 (Maximal intersection)

problem : Max intersection

Could someone explain me the tutorial solution in more simple language (main idea behind those sum arrays)

My Approach:

  1. For each (x;y) difference: a = y-x
  2. If a is less than 0 then a = 0 (if Intersection Is Empty)
  3. From the list of a's remove the smallest a.
  4. From the remaining list the smallest a is the answer.

Example Test Case(Codeforce):

input
4
1 3
2 6
0 4
3 3
output
1

Here.
The List of a= [ 2, 4, 4, 0]
remove the smallest i.e 0.
Now the list of a’s become [2, 4, 4]
the smallest a i.e 2 is the Answer.