Initialize the maximum savings to a very small number (e.g., negative infinity).
For each nut in the nuts array:
a. Calculate the to-and-fro distance from the tree to the nut (2 times the distance between tree and nut).
b. Add this distance to the total distance.
c. Calculate the savings if this nut is the first nut to be collected.
d. Update the maximum savings if the current savings is greater than the maximum savings.
Subtract the maximum savings from the total distance to get the minimal distance.