Solution for Berry Picking Silver

I looked a little bit at solution to the Berry Picking problem for silver (Jan 2020), and I don’t get how you’re supposed to get to that approach. I understand that it’s a greedy algorithms problem, but I don’t understand the line of thinking that would lead to solving the problem.

Any help is appreciated!