Skip to main content

DS&A

Leetcode Toolbox — This section isn’t about data structures and algorithms themselves. It’s a collection of tips and tricks for getting the solution submitted when you already know how to solve the problem conceptually, but the implementation is dragging you down. You know the problem is simple, but you’re stuck writing spaghetti — five slightly different, correct-but-messy versions — because you’re debating: should I do it like this… or that… or maybe that… This is where you’ll find ergonomic Python patterns that help you stop second-guessing and just get it done. If you’re still figuring out the underlying algorithm or data structure, head to the structure-specific sections (e.g. trees, graphs). All examples in this section are in Python, because it’s hands-down the best language for this kind of problem-solving under time pressure.