• How to Practice LeetCode Problems (The Right Way)

Woman working at home

tl;dr: You’re doing it wrong. Use “The Six Steps” any time you practice LeetCode questions, preferably with another person. Keep an interview prep journal to track your progress.

The struggle is real

Have you been tackling LeetCode problems but don’t feel like you’re actually getting better in interviews? Feel like you’re able to come up with solutions but never make it to the optimal one? Do you keep running out of time before you can finish the question? Are you constantly having a tough time making it through difficult questions?

As a former Google software engineer and now career and interview coach, many of my clients have had this problem over the years. And if you were my client, I’d tell you that the problem isn’t that you’re not smart enough. Nor is it that you’re not working hard enough.

You’re probably practicing wrong.

Maybe you’ve been  working through the Blind 75 . Or maybe you’re just using example problems from Cracking the Coding Interview . You can pull questions from wherever you want, I don’t care. If you’re using the wrong strategy, it’s not gonna help you very much, no matter how many questions you practice.

Anyone who’s done weightlifting in the gym knows that good form and flexibility are essential. Those elements are necessary for getting the most out of your workout. Similarly, you need to practice good problem solving techniques when you’re doing LeetCode questions so that you’re maximizing the time you spend.

Keeping the real interview in mind

Many of you practice LeetCode problems incorrectly because you may be unfamiliar with how technical interviews work in real life. Let’s break that down real quick.

More than anything else, you need to understand that technical interviewing is a collaborative problem-solving exercise . The real interview won’t be you working through a LeetCode question by yourself. You’re going to be talking to a real human being. That’s important to state because, if you’re practicing by yourself, you probably aren’t thinking about the fact that you need to communicate out loud to another person and ask questions.

The biggest weakness with LeetCode problems is that there’s no human involved outside of yourself. The question needs to provide every detail necessary for you to solve the problem up front. In a real interview, your interviewer is probably going to hold back some information to see how you deal with ambiguity. In other words, they want to know if you’re going to ask questions or not.

Also, a LeetCode question can’t give you hints if you’re headed in the wrong direction. It can’t give you feedback on whether your approach is sound or not. All of this matters because your interviewer is going to assess how you handle feedback. If I, as your interviewer, ask you about whether you can optimize your solution, I’m going to expect something better than “I don’t know.”

Oh, and by the way, your interviewer isn’t obligated to provide you with examples or test cases. Some may do it to be helpful, and that’s great. But if you’re used to having all of that provided for you in your LeetCode questions, then you’re going to have a hard time in the real interview coming up with good examples and test cases.

A better way

With the necessary context established, let’s talk about how I think you should properly study example questions. The following strategy is what I used to ensure I got the most mileage out of every interview question. These steps will show how I applied my own problem solving framework (I call them “The Six Steps” ) to practice interview questions.

1) Grab something to code on (not an IDE)

Before you begin, make sure that you are set up correctly for your mock interview. You may choose to write out code using a whiteboard, pencil and paper, or using a computer and a text editor or lightweight code editor like Notepad++ or TextPad. Try to avoid using a full-on IDE since they will often include features that you’re not likely to get in a real coding interview.

If you’re working with a mock interviewer, make sure to choose something that they’ll also be able to see and edit.

2) Decide whether to practice with a mock interviewer (strongly recommended) or by yourself

The best way to practice a LeetCode question is with another person who will assess you as an interviewer. Now this is going to come as a shock, but they don’t necessarily need to be a coder! Having a fellow software engineer or developer is ideal of course, but the important thing is finding someone that you can talk to and that can give you feedback. When studying for the Google interview, I relied on my wife who is definitely not technical but provided great feedback on my presence and demeanor.

Of course, there will be times when you will need to study alone and that’s fine. It will be essential for you to keep yourself accountable by not giving yourself more than a mock interviewer would in a real interview.

Oh, and whoever you work with, show them some thanks and appreciation. There’s always something you can do to compensate them for their time, whether with money, coffee, a public acknowledgement, or a gift card.

3) Start the clock

Most interviews are timed for 45-60 minutes. Decide what length of time you’re going to spend doing your mock interview based upon what you can expect for the real thing. Remember, you want to keep things as realistic as possible. Once your time is up, stop working. It’s important to train yourself to work well within time constraints.

One caveat here is that if you’re early into your interview prep journey, you may want to just benchmark yourself a few times to see how well you perform. You’ll still want to time yourself, but don’t stop by a specific time. Keep going until you reach an optimal solution or can’t think of anything else to do.

4) Articulate the problem

Your mock interviewer will begin by reading the question out loud. Under no circumstances during the whole interview are you to look at the sample question, examples, or constraints. Depend completely on your mock interviewer for any information you will need to solve the problem. This is why it is absolutely essential that you take notes as your interviewer is speaking so that you don’t have to ask them repeatedly for information they’ve already revealed.

To ensure you’ve heard the question correctly and that you’ve captured all the details, repeat the question back to your interviewer in your own words. If you’ve missed any details or added something unnecessary, your mock interviewer should let you know before proceeding.

If you’re practicing on your own, read the question out loud exactly one time along with the example. Once done, hide the question from view and then repeat the question in your own words as though you were actually talking to a real person. Take notes, but avoid writing the full problem statement out. Focus on short statements that help you remember the key parts of the problem you’re solving.

5) Ask questions and confirm assumptions

Here’s a handy tip for any interview. Always ask questions as the interviewee. Even if you think you know everything about how to solve a problem, and even if you’ve solved it before—still ask questions. Here are some questions you can ask for nearly any technical question:

  • What’s the data type of the input and range of valid data?
  • Does the input fit in memory?
  • Can I expect to receive invalid data?
  • How will input data be provided?
  • Is the input data sorted already?

Remember, you should avoid asking questions that already have answers in the problem statement itself. It is important and encouraged, however, to re-state your assumptions in the hearing of your interviewer based on your understanding of the problem. For instance, if the problem mentions sorting whole numbers, you might assume that you’re going to be sorting 32-bit signed integers. State that assumption clearly or ask if that’s the case. The problem might actually require you to sort values that fit in a short integer, thus allowing you to save space (or a long 64-bit integer, which would obviously require more).

If you’re practicing alone or if  you’re working with someone non-technical, you won’t have someone to answer your questions. Once you’ve documented all your questions and assumptions, you can peek at the LeetCode constraints at this point and write down the answers.

Again, try not to do a lot of writing. Prefer the least number of words needed to capture the essentials so you don’t have to keep details in your head.

6) Come up with example inputs and their outputs

At this point, you should begin working through examples. Two things are important at this step. One, look through any examples provided for you and reverse engineer them to figure out what details they reveal about the problem or its constraints. Two, add a couple of your own examples to demonstrate your understanding of those constraints or to prompt more questions. A way to think of examples is to treat them like test cases. Read up on test driven development (TDD) and unit testing as part of your interview prep if you habitually struggle to come up with good test cases.

A note to the mock interviewer. If the interviewee comes up with an example that violates constraints, let them know immediately. You are obligated to inform or remind them of the constraints in this case since this information may be critical to their being able to solve the problem.

Again, if you’re studying alone then you won’t have someone who can give you feedback on your examples. That’s OK. Still come up with examples and make best-guess assumptions to any unanswered questions you may generate at this step. LeetCode questions are generally specific enough that this shouldn’t be hard to do.

7) Brainstorm solutions and estimate their Big-O

You should now have enough information to start coming up with solutions to the problem. This is where the rubber meets the road. All of your studying of algorithms and data structures should amply prepare you for generating two or three viable ways to solve the problem. If you struggle a lot at this step, hit the books. You’ve got more learning to do.

The first step to good brainstorming is making a good guess about what the optimal solution looks like as expressed in Big-O. Is it possible that a constant time and constant space solution could exist? Why not? How about a logarithmic solution that ‘s O(lg n)? Remember, you’re always driving towards an optimal solution.

As an example, if I need to sort an array, I’m pretty sure that I can’t do any better than a O(n) time complexity and O(1) space complexity in the worst case. I claim linear time complexity because I’ll probably have to look at every element of input at least once, and I claim constant space because some sorts move elements in place so that I don’t need to use a separate data structure.

Once you think you know the ideal, the next step to good brainstorming is coming up with solutions and predicting their time and space complexity. Note that your first solution is probably going to be a brute force approach that is less than ideal. It also might also be the only solution you can come up with quickly. That’s OK! If that’s all you are able to come up with after a couple of minutes, just move on and go with it. But take the time to try to think about what you can do to get closer to the ideal, optimal solution.

A couple of principles can be helpful here:

  • You usually have to use more space (memory) to make something go faster (and vice-versa), so if you’re optimizing for speed, you probably need to use a data structure.
  • If your task is to build a new data structure, you are likely going to need to put two data structures together that complement each other. That means that in your studying, you should strive to know the strengths and weaknesses of each data structure and what problems they are designed to solve.

Again, take only short notes of your approach along with the expected time and space complexity. Do the estimation up front, even if you aren’t exactly sure! This can help you navigate your way through potential optimizations before you write the first line of code. You might find that a more optimal solution is just as easy, if not easier, to implement than the initial one you devised.

One last thing. You’re going to have to choose a solution to start implementing in the next step. It is OK for you to get input from your interviewer about which one they’d prefer to see you implement. It’s also fine for you to implement the easiest one first and then write an optimal version after that. Hopefully, you can find a great mock interviewer who will provide you with good guidance here.

8) Implement a solution

Now comes the easiest part of the experience. If you don’t find this to be the easiest, then you need to spend more time practicing writing out code. There’s a practical reason why I say this. You want to spend the least amount of time in this step so that you can devote more time to the others. It’s like the old proverb says: “measure twice, cut once.”

Because you are on an artificially constrained, time-boxed schedule, you should also avoid writing in pseudocode. In real life interviews, pseudocode generally doesn’t count. That means you’ll have to turn all your fake code into real code for it to be assessed properly. Instead of pseudocoding, I suggest you make small notes about your proposed algorithm instead of writing out fake code since that will probably be faster and provide the same utility.

Again, we’re talking about coding interviews primarily used by the big tech companies. If you can pseudocode on a take home assignment and make the deadline, go for it! But at the big tech level, I assure you that writing code will be the easiest part of the job. Understanding the work you need to do and vetting your design will probably be the bulk of what makes your job challenging.

  • Say what you’re going to do before you write the code, then write the code. Don’t write code without explaining what you’re writing first. This ensures that the interviewer knows what you are thinking and has the opportunity to interrupt you if you’re going down the wrong path.
  • Use good, clear variable names. Prefer to be verbose (e.g. indexCount instead of idxCnt). In a real interview, your interviewer won’t be the only one looking at your code. Readability matters a lot and is one of the reasons why code reviews are practiced in any major software shop.
  • Don’t be afraid to use common APIs, syntactic sugar, and common idiomatic style for your language. If you have doubts, just ask your interviewer whether you can use something or not. And even more importantly, understand what is happening under the covers so that you’re aware of any performance penalty. For instance, calling the sort method on your collection costs between O(n lg n) or O(n2) depending on your language. Just calling that method won’t magically turn your code into a constant time solution.
  • As part of your practice regimen , writing algorithms from memory can help you both get stronger in your programming language while also strengthening your comprehension of the algorithm itself

Remember, I strongly advise against using an IDE for coding up your solution to practice problems. And if you decide to use the LeetCode editor, don’t compile and run the tests. In most cases, you’re not actually going to get that in a real interview and even if you do, you will be tempted to use it as a crutch instead of properly walking through your code and testing it. Use a real compiler and unit tests after your time is up!

If you find yourself getting stuck during the implementation, use an example and work out the steps on paper to get from input to output. Try to visualize what you need to do on paper so that you can see what your code needs to do and then implement it.

9) Test your code

After you’ve typed the last semicolon or curly brace, you are still not done. You probably have at least one bug, typo, or missing variable that you need to fix. Walk through your code line by line, and check that each line is doing what you designed it to do. You should have a mental checklist of a few things to watch out for:

  • Undeclared variables
  • Off-by-one errors
  • Reversed conditionals (e.g. “<” instead of “>=”)
  • Bad variable names
  • Null pointer exceptions

This is one of the big reasons why it’s essential to work out examples early in the problem solving process. You can easily use one of those examples to mentally run through the code and test that things work well, using paper and pencil or the text editor to track variable state.

10) Optimize

If you haven’t reached an optimal solution yet, either go back to brainstorming or implement a more optimal solution you’ve already devised. Until the timer hits zero, you’ve still got more work to do. Keep going!

Wrapping up your mock interview

Regardless of whether you practice with a partner or on your own, make sure to document feedback on your performance. Keeping a journal or notebook with all your learnings is a very useful way of organizing tips, resources, and your own progress. I still have my mock interview journal that reflects just some of the work I poured into being successful.

If you worked with a mock interviewer, there are two questions you should answer: 1) how do you feel about your own performance, and 2) how would your interviewer rate you between hire, no hire, or on the fence. The key to these two questions is figuring out whether your self-assignment aligns with that of your interviewer. This will help you to shape the right expectations as you prepare so that you can build confidence and gain a good sense for yourself about whether you’re headed in the right direction.

Allow your interviewer space to critique you on non-technical things as well. Did you stumble a lot in your speech or use non-sequiturs? Were you making any annoying noises that should be avoided? Did you go quiet for long stretches of the interview? This feedback might not help you code better, but it will help you to communicate better and that’s half the challenge of doing well on technical interviews.

Lastly, now that your interview is over, feel free to copy your code into the LeetCode tool and make sure that it compiles and that the tests pass. If they don’t take note of any edge cases you missed. I’d actually recommend copying into an IDE so that you can get more detail about compilation errors or use a debugger to step through your code. Take note of failures or missed edge cases so that you can add them to your implementation checklist on the next coding question you tackle.

Want to succeed technical interviews and winning six-figure offers? Register for my free live webinar at morganlatimer.com/webinar . Learn the strategies I’ve used to help my clients land FAANG offers and beyond.

Recent Posts

  • gRPC vs REST: Comparing API Styles in Practice
  • How to Transition into Tech: A Complete Guide
  • 9 Things You Didn’t Know About Your Coding Interviewer
  • ‘King Richard’: Reflections of a Black Software Engineer

How to Solve LeetCode Problems: Beginner’s Guide

how to solve LeetCode problems

Are you preparing for technical interviews and struggling to solve LeetCode problems? Don’t worry, you’re not alone. Solving these problems can be challenging, especially if you’re new to the platform or have limited experience with data structures and algorithms.

In this article, we’ll provide you with a comprehensive guide on how to solve LeetCode problems effectively. We’ll share tips and techniques that will help you improve your problem-solving skills and increase your chances of success in technical interviews.

Whether you’re a beginner or an experienced programmer, this guide will help you navigate the LeetCode platform and solve problems with quality and confidence.

Table of Contents

Understanding LeetCode Problems

LeetCode is a website that offers a collection of coding problems to help you improve your skills in programming and algorithms. It is a popular platform for practicing coding problems and preparing for coding interviews .

LeetCode has a large database of problems, ranging from easy to hard, and covers a wide range of topics, including arrays, linked lists, trees, dynamic programming, and more .

What is LeetCode?

LeetCode is an online platform that provides a collection of coding problems to help you improve your programming skills. It offers a wide range of problems, ranging from easy to hard, and covers a variety of topics.

LeetCode is popular among software developers, data scientists, and computer science students who want to improve their coding skills and prepare for coding interviews.

Why Practice LeetCode Problems?

Practicing LeetCode problems can help you improve your coding skills and prepare for coding interviews. Solving LeetCode problems can help you:

  • Develop problem-solving skills: LeetCode problems are designed to test your problem-solving skills and help you improve them.
  • Learn new algorithms and data structures: LeetCode problems cover a wide range of topics, including arrays, linked lists, trees, dynamic programming, and more. By solving these problems, you can learn new algorithms and data structures.
  • Prepare for coding interviews: Many companies use LeetCode problems to test the coding skills of job candidates. By practicing LeetCode problems, you can prepare for coding interviews and improve your chances of getting hired.

How to Choose LeetCode Problems to Solve

Choosing the right LeetCode problems to solve can be challenging, especially if you’re new to the platform. Here are some tips to help you choose the right problems:

  • Start with easy problems: If you’re new to LeetCode, start with easy problems to build your confidence and skills.
  • Focus on topics you’re weak in: If you’re weak in a particular topic, focus on solving problems related to that topic to improve your skills.
  • Look for related problems: LeetCode problems are often related to each other. If you solve a problem, look for related problems to reinforce your understanding of the topic.
  • Use tags and difficulty levels: LeetCode allows you to filter problems by tags and difficulty levels. Use these filters to find problems that match your interests and skill level.

In summary, LeetCode is a great platform for improving your programming skills and preparing for coding interviews. By practicing LeetCode problems, you can develop problem-solving skills, learn new algorithms and data structures, and prepare for coding interviews.

When choosing LeetCode problems to solve, start with easy problems, focus on topics you’re weak in, look for related problems, and use tags and difficulty levels to find problems that match your interests and skill level.

Turned-on Computer Monitor Displaying a LeetCode problem in code

Solving LeetCode Problems

LeetCode is a popular platform for practicing coding interview questions. It provides a vast collection of problems that cover various data structures and algorithms topics. In this section, we will discuss how to approach solving LeetCode problems .

Understanding the Problem

The first step in solving a LeetCode problem is to understand the problem statement. Read the problem statement carefully and make sure you understand what is being asked. Identify the input and output formats, constraints, and edge cases. It is essential to have a clear understanding of the problem before moving on to the solution.

Brute Force Solution

Once you understand the problem, the next step is to come up with a brute force solution. A brute force solution is a straightforward and inefficient solution that solves the problem but might not be optimal. Implementing a brute force solution will help you understand the problem better and come up with an optimized solution.

Optimizing the Solution

After implementing the brute force solution, the next step is to optimize the solution. Look for patterns, use data structures, and algorithms to come up with an optimized solution. Keep in mind the time and space complexity of the solution. Always aim for the most optimal solution.

Testing the Solution

Once you have implemented the solution, it is essential to test it thoroughly. Test the solution with different inputs, edge cases, and constraints. Use a timer to measure the time taken by the solution to execute. Testing the solution will help you identify bugs and optimize the solution further.

Example: Solving a Sample LeetCode Problem

Let’s take an example of solving a sample LeetCode problem. Suppose we have the problem of finding the maximum subarray in an array.

The brute force solution would be to iterate over all possible subarrays and find the maximum sum. The optimized solution would be to use Kadane’s algorithm , which has a time complexity of O(n).

Once you have implemented the solution, test it with different inputs and measure the time taken by the solution to execute.

In conclusion, solving LeetCode problems requires a systematic approach. Understand the problem, implement a brute force solution, optimize the solution, and test it thoroughly.

LeetCode is an excellent platform to practice coding interview questions and improve your problem-solving skills. Use popular interview prep resources like Cracking the Coding Interview and GeeksforGeeks to learn more about data structures and algorithms.

a close up of a computer screen with LeetCode problem

Improving Your LeetCode Skills

If you want to improve your LeetCode skills , there are a few things you can do to get better. Here are some tips to help you practice and prepare for your next technical interview.

Practicing with Quantity and Quality

One of the best ways to improve your LeetCode skills is to practice with both quantity and quality. You can start by solving the easy problems and then move on to the harder ones. It is also necessary to practice LeetCode daily to make consistent incremental progress.

As you solve more problems, you will start to recognize patterns and develop your problem-solving skills.

It’s important to remember that it’s not just about solving the problems quickly, but also about solving them correctly. Take the time to understand the problem and think through your solution before coding. This will help you avoid mistakes and improve your overall accuracy.

Sharpening Your Technical Interview Skills

LeetCode problems are great for preparing for technical interviews. They give you a chance to practice your problem-solving skills and develop your technical knowledge. But it’s important to remember that technical interviews are not just about solving problems. They are also about communication and collaboration.

When you’re practicing LeetCode problems, try to simulate a real interview as much as possible . Talk through your thought process out loud, ask questions, and engage with your interviewer. This will help you develop your communication skills and prepare for the collaborative nature of technical interviews.

Other Resources to Improve Your LeetCode Skills

In addition to practicing LeetCode problems, there are other resources you can use to improve your skills. Books like “Cracking the Coding Interview” and websites like GeeksforGeeks are great resources for learning new concepts and preparing for technical interviews. LeetCode itself has learning modules, too.

You can also participate in coding challenges and competitions to further develop your skills. These challenges will help you practice under pressure and give you a chance to work on real-world problems.

Remember, improving your LeetCode skills takes time and practice. But with the right mindset and resources, you can develop the skills you need to succeed in technical interviews.

not able to solve leetcode problems

Elmar Mammadov is a software developer, tech startup founder, and computer science career specialist. He is the founder of CS Careerline and a true career changer who has previously pursued careers in medicine and neuroscience.

Due to his interest in programming and years of past personal experience in coding, he decided to break into the tech industry by attending a Master’s in Computer Science for career changers at University of Pennsylvania. Elmar passionately writes and coaches about breaking into the tech industry and computer science in general.

Share this:

  • Click to email a link to a friend (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to share on WhatsApp (Opens in new window)

Search code, repositories, users, issues, pull requests...

Provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications

Troubleshooting

This document provides the information needed to troubleshoot common errors of LeetCode for VS Code extension.

🤔 The LeetCode Explorer Icon Is Not Showing

The LeetCode Explorer is located in the customized activity bar, which is supported in VS Code 1.31.1+.

🤔 Got Error: command 'leetcode.xxx' not found

This means the extension is failed to start up. Mostly this is because the requirement is not satisfied. For example, the installed Node.js version is lower than 8 .

🤔 Cannot Sign in

There are multiple factors causing the user not able to sign in the extension:

You may use the wrong endpoint. Please Try to switch to the correct endpoint that you want to use.

Note: The accounts of different LeetCode endpoints are not shared.

If you are behind the proxy, please update the VS Code setting: http.proxy .

You can trigger the command Preferences: Open User Settings to open the setting page.

🤔 Got HTTP error [code=404] When Submitting the Answer

Users cannot submit code until they have the email or phone verified in LeetCode.

🤔 Cannot show the locked problems

The extension will hide the locked problems by default. You can enable the setting leetcode.showLocked to see them.

  • 疑难解答 / Troubleshooting
  • Customize File Path

Clone this wiki locally

VIDEO

  1. 5 Tips I learned after solving 1583 Leetcode problems

  2. Repeated DNA Subsequences

  3. Set Mismatch Solved in java

  4. First Missing Positive Solved in java

  5. Flight Occupancy and Waitlist Analysis

  6. I did 285 leetcode problems

COMMENTS

  1. Why You Can't Solve Leetcode Problems

    4. **Consistency is Key**: Solve at least one problem daily. Consistency will make it easier for you as you start to see patterns and develop your problem-solving intuition. 5. **Prepare for ...

  2. Why can't I solve any Leetcode problems? Even easy ones?

    I imagine the issues arise from your lack of experience in data structures and algorithms. Take a course in DSA and revisit the problems. There's most likely a whole world you didn't explore (the world being DSA). Implement these DSA and create a program using these DSA. Granted, a lot of problems are pattern recognition.

  3. How to Practice LeetCode Problems (The Right Way)

    Focus on short statements that help you remember the key parts of the problem you're solving. 5) Ask questions and confirm assumptions. Here's a handy tip for any interview. Always ask questions as the interviewee. Even if you think you know everything about how to solve a problem, and even if you've solved it before—still ask questions.

  4. 6 Easy Steps to Master Any LeetCode Problem

    Let's move on. 3. Attempt to Solve The Problem With Help, If You Haven't Already. If you didn't manage to solve the problem blind with no help, then there is no shame in looking up ...

  5. Mastering LeetCode : A Step-by-Step Guide to Problem Solving

    Step 1: Setting the Foundation. 1.1 Understand the Basics. Before diving into LeetCode problems, ensure you have a strong grasp of fundamental data structures and algorithms, including: Arrays ...

  6. How to Solve LeetCode Problems: Beginner's Guide

    Understanding the Problem. The first step in solving a LeetCode problem is to understand the problem statement. Read the problem statement carefully and make sure you understand what is being asked. Identify the input and output formats, constraints, and edge cases.

  7. A Guide to grinding Leetcode

    Leetcode Patterns. and solve problems by category, this will help you master a data structure or some algorithm. don't get afraid by "hard" questions, there is no hard problem which can't be broken up, try to break it, you might not be able to solve it but you'll convert it to much shorter set of problems which can be solved with some practice.

  8. Cannot even Solve the easy problems on LeetCode : r/leetcode

    Cannot even Solve the easy problems on LeetCode. Even though, I have solved nearly 100 easy problems on LeetCode, I am not able to solve some easy problems in the weekly and bi-weekly contest. Also, I just wanted to check my progress on LeetCode and took a random interview assessment where I encountered "Toeplitz Matrix" which was an easy ...

  9. How to start solving problems with LeetCode [2023 Edition]

    It often gives some free hints on what algorithms could be used to solve the task. Related topics are at the bottom of the page. 2. Follow the tips from Regis AI bot. It can give hints without giving away a solution. After installation, such an option would be available in the "Right Click" menu on LeetCode.

  10. Crack the LeetCode: Tips & Strategies on How to Tackle 15 Common

    Visualize the Process: Visualize the movement of the sliding window on paper or mentally to better understand and debug your solution. 3. Binary Search: Binary search is a powerful algorithm for efficiently finding a target element in a sorted collection. Here are tips and strategies for solving binary search problems:

  11. 3 months in and I still cant solve a single Leetcode Problem

    Leetcode started as a collection of problems that companies asked students with a 4-year Computer Science degree. You can't expect to solve problems intended for CS grads with 4 years of experience after only 3 months. First, learn to program. Learn to solve small problems by programming.

  12. Work on LeetCode problems in VS Code

    5. Use the LeetCode extension commands to test and submit your solution. Wrap Up. This setup enables all of the tools of VS Code while working on LeetCode problems while avoiding the issue of cutting and pasting between the browser and the IDE. It provides a modern development experience and speeds up the process of solving LeetCode problems.

  13. My 2021 Journey to solving 1000 Leetcode Problems

    My 2021 Journey to solving 1000 Leetcode Problems - LeetCode Discuss. Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

  14. Problems

    Boost your coding interview skills and confidence by practicing real interview questions with LeetCode. Our platform offers a range of essential problems for practice, as well as the latest questions being asked by top-tier companies.

  15. Troubleshooting · LeetCode-OpenSource/vscode-leetcode Wiki · GitHub

    You may use the wrong endpoint. Please Try to switch to the correct endpoint that you want to use. Note: The accounts of different LeetCode endpoints are not shared. If you are behind the proxy, please update the VS Code setting: http.proxy. You can trigger the command Preferences: Open User Settings to open the setting page.

  16. How to get started with DSA and practice Leetcode Efficiently

    Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

  17. Tips to solve LeetCode problems

    The problem stated that the recursion is not allowed in the solution, try to think about the Stack data structure. 7. If the problem is related to the strings or counting, Map or Dictionary can be ...

  18. Tips on improving at contests. : r/leetcode

    As of now, I've done 4 contests (3 leetcode contests and 1 on some other site). In my first contest, I was able to solve only 1 problem, which was okay given that it was my first contest. In my 2nd contest (on the other site) I was able to solve the medium one and scored about 45% on the easy one (scored 98 out of 320) which was an improvement.

  19. What do you do when you don't know how to solve a LeetCode ...

    This is good practice. One suggestion: go back to the ones you checked out the answers for in a few days. Without looking at the answers again, solve the problem. That'll help you confirm that you understand how to apply a solution. stratcat22.

  20. Before you start solving problems on Leetcode (Prep Work)

    Before you start Leetcoding, you need to study/brush up a list of important topics. If you don't, you'll end up wasting your time. Remember the two following rules: Don't spend too much time ...

  21. How do peoples solve all the questions in the leetcode contest within

    How do peoples solve all the questions in the leetcode contest within 20 minutes? - LeetCode Discuss. Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

  22. Can't solve medium level leetcode problems without looking at ...

    Hi, I am unable to solve medium level leetcode problems without looking at the solution or hints after spending 1 hour trying to come up with a solution. However, I am able to solve easy level problems in 15-20 minutes with no issues. ... Once you get a handle of this and solve a few problems, you should be able to notice a pattern on a lot of ...

  23. I have to literally lookup up every leetcode solution. Is it normal?

    Don't worry about efficiency for this part; just look for the simplest thing that could possibly work. For example, if the problem was "Test if an array contains 42", your non-code explanation would be something like "Look at each thing in the array, starting at the beginning. If it's 42, the answer is true.

  24. r/leetcode on Reddit: Is it okay to not be able to solve most mediums

    I'm 20 problems (10 easies, 10 mediums) into the neetcode 150 list. I was able to get through most easies so far without too much trouble. But I think I've only been to solve 1 or 2 mediums of the 10 without looking at the solution. And I was probably able to come up with a non optimal solution for about half the mediums I solved without ...