As far as I understand it the Monte Carlo method creates a random subset of all potential outcomes based on specific constraints. In our case, you have for example 3 songs. Thus, you have the following potential outcomes
code:
1
2
3
12
13
23
123

The Monte-Carlo Method would create a subset of e.g. three potential outcomes that it generates randomly, e.g.
code:
1
12
23

or
code:
12
23
123

Then, only this subset is tested whether it fulfills the constraint of sum of all song lenghs smaller than media length and gap is minimized.

However, this apporach inplies that you might miss the 'perfect solution'. Thus,a limited search is appended, which checks if you can either add songs or substitute songs in order to minimize the gap further. Nevertheless, even this approach might miss the 'perfect' solution.

So, if you want the perfect solution all the time, either BF or LP will always give it to you. However, you might not finish running the script within the allotted time.
_________________________
There are two types of vessels, submarines and targets.