In the context of algorithms, dynamic programming is a technique for solving a certain type of problem by breaking it into subproblems, solving those subproblems, and using the results to find the solution to the original problem. The purpose of this tip isn’t to explain how dynamic programming works. There are already more than enough […]
ContinueLeetCode Tip 39: Learn the Process of Finding the Solution
Learning a model solution gives you a tool to solve problems of a particular type. If you write and study a model solution for binary search, you’ll be able to solve straightforward binary search problems. Doing the same thing with other common solution types will make you better than average at coding interview problems. But […]
ContinueLeetCode Tip 38: Write a Code Notebook
As we saw in Tip 31: Learn Problems and Sub-Problems, you sometimes need to learn a skill that’s smaller than a full LeetCode problem. Tip 31 explains how you can use the standard LeetCode interface to learn concepts at the sub-problem level. But there’s another way to accomplish that goal by using a REPL. The […]
ContinueLeetCode Tip 37: Understand Your Test Cases
You can’t debug a LeetCode solution without studying test cases, the textual input that every LeetCode program is required to process. The LeetCode platform verifies that every test case, whether an official test case or one you invent, meets the formatting and range specifications from the problem statement. The platform also gives you the correct […]
ContinueLeetCode Tip 36: Debugging Advice
LeetCode debugging is different from real-world debugging. But as in the real-world, you sometimes have to debug your LeetCode solutions. So it’s worth learning the techniques that work best for LeetCode-style programming. According to the model solution approach, the goal of LeetCode practice is not just to get your submission accepted, but to learn the […]
ContinueLeetCode Tip 35: Debug Prudently
When you write a LeetCode solution, it may have bugs. This is one way in which LeetCode programming and real-world programming are similar. But debugging your LeetCode solution doesn’t always work the same way as debugging your real-world code. In the real world, when someone gives you a task, you’re the one person responsible for […]
ContinueLeetCode Tip 34: Write Your Own Textbook
The study process that I describe in these tips is based on model problems and model solutions. To write a good model solution, you can learn a process for writing it and the format that makes it most useful. The goal of LeetCode practice is to learn all the common problem types. Model solutions best […]
ContinueLeetCode Tip 33: Prioritize Understanding
When you’re working on a challenging LeetCode problem, it’s easy to spend a lot of time on it. As long as you can keep thinking of ideas to try, you can keep adjusting your code to see if it improves your results. If your solution fails on large test cases, you can try to optimize […]
ContinueLeetCode Tip 32: Minimize the Time You Spend on Each Problem
When you’re working on a LeetCode problem, there is always a solution available, either the official solution or a solution from the discussion forums. So, as you’re working on your own solution, you always have the option of getting help. Your study strategy, therefore, needs to tell you how long to work on a problem […]
ContinueLeetCode Tip 31: Learn Problems and Sub-Problems
Consider this scenario: You’re repeating a problem. You skim the problem description and remember a good approach to use. You start implementing the solution, since you know the steps for the algorithm. Then at some point in the implementation, you get stuck. Maybe there’s some language syntax that you don’t use very often. Maybe you […]
Continue- « Previous Page
- 1
- 2
- 3
- 4
- 5
- 6
- …
- 49
- Next Page »