given an array of objects that represents a vehicle\'s paths sorted by date, what is the most efficient way of merging consecutive elements if :