Thanks to https://github.com/raywenderlich/swift-algorithm-club , Algorithms and data structures in Swift, with explanations!