Actually in this chapter, it is mentioned that Swift default “sort” function uses “Introsort” in the background.
But with the release of Swift 5, this “sort” function started using “Timsort”.
And as this book is updated for Swift 5 already, so I thought to bring into ur notice for further correction.
I agree solution 3 is hard to visualize. I spent a lot of time trying to understand it.
One hint I can give is to think of it as you are “expanding reachable stations on each stop”. Starting with enqueuing reachable stations prioritized by chargeCapacity. (Reachable stations has distance less than your current charge.) Then you keep dequeuing a station with highest chargeCapacity, each time expanding reachable stations and increase minStops by 1. Keep doing this until target is reached.