LeetCode-Swift is a collection of algorithm solutions written in Swift, designed for coding interview preparation. Each solution is implemented as a self-contained function with no external dependencies, making it easy to run and test. The repository organizes solutions by topic and company, and every file includes time and space complexity annotations, allowing quick evaluation of algorithmic efficiency.
What sets this repository apart is its flat file structure and the way solutions are tagged with the companies that asked them in interviews, enabling targeted practice. All code resides in a single directory without additional packages or modules, simplifying navigation and compilation. The solutions cover fundamental data structures and algorithms, from array and string manipulation to linked list operations, dynamic programming, tree algorithms, and more.
The collection spans classic problem categories including array and string algorithms, linked list manipulations, binary tree traversals and reconstructions, dynamic programming optimizations, stack-based expression evaluation, and mathematical computations. It also includes implementations of common data structures such as an LRU cache. The repository is distributed as a Swift package, allowing others to add it as a dependency and explore the solutions.