Introducing LeetcodeSolutions
On a Saturday afternoon last fall, I found myself in front of an expansive whiteboard covered in diagrams, tables, and somewhat legible hand-writing. I was there with a new coworker, and we had just finished going through the data models she’d be working with. Along the way, we’d taken a long digression into database design, and I’d explained the differences between SQL databases and Mongo and when it made sense to use one or the other; our codebase worked with both. At the end, she looked up from her notes and exclaimed, “That makes sense! Wow, why didn’t anyone explain it this way?”
Rewind to eight years ago. I was sitting with a close friend around his kitchen table covered with papers, notebooks, and textbooks. We were both in high school at the time, and I spent that afternoon helping him study for a calculus exam. After working through a particular problem together, he looks at me and told me I was really good at explaining things — better than his teacher; that’s why he had me over in the first place.
Fast-forward to present day. I recently embarked on a new job search and spent a little over a month studying for technical interviews. That prep consisted entirely of reading about and understanding dozens of algorithms and data structures and techniques for solving a particular breed of technical questions embodied by sites like Leetcode. I mostly found this process to be difficult because most of what I was reading wasn’t easy to understand. Many explanations were mired in mathematical symbols and equations, technically-precise-but-complex language, and long-winded step-by-step walkthroughs that were difficult to follow. Code examples were often written in a language or in a way that obscured the basic idea of the underlying algorithm; in many cases I had to manually step through code examples to figure out what was actually happening. I found myself wondering “why didn’t they just say it this way?” many times.
I wished I had someone explain everything I was reading in an intuitive way. Fortunately, I somehow managed to figure out enough to convince companies that I knew what I was doing. And now that I have some free time between jobs, I’ve started writing the study guide and intuitive explanations I wish I had.
I’m starting with with Leetcode problems since they’ve become an integral part of everyone’s studying. From this, I’m creating LeetcodeSolutions.com, which is exactly what it sounds like — it’s a collection of solutions to various Leetcode problems, particularly the ones that don’t have an officially-published solution or the ones where I didn’t find the officially-published solution particularly helpful.
The easiest way to use this site is to browse to a specific problem on Leetcode, and then replace leetcode.com
in the URL with leetcodesolutions.com
. For example, if you’re working on https://leetcode.com/problems/reverse-integer/
, the corresponding solution on this site is at https://leetcodesolutions.com/problems/reverse-integer/
.
I’m writing the solutions for each problem manually (they’re artisanally hand-crafted!). Right now, it’s just me working on this. I probably won’t get to every single problem — some of them are really hard! But I’ll keep writing solutions as long as people find it useful. If you end up on a page for a problem that I haven’t gotten to yet, you’ll have the ability to request it. I’ll get back to you once I’ve published a solution for that problem!
I hope LeetcodeSolutions is useful for you. If you’re just browsing, I hope it’s informative and enjoyable enough to read! If you’re also prepping for interviews, I genuinely hope this is helpful for you, and I wish you the best of luck!