problem : Max intersection

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

problem : Max intersection

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

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

```
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.