This article was originally intended to be added to the appendix of my new book "The Road to Algorithm Clearance". However, because the Likou official failed the trial, it had no choice but to give up. Send this part of the content here for your reference.
The introduction and purchase of "Algorithm Clearance Road" can be accessed at: https://leetcode-solution.cn/book-intro
How to use LeetCode website
LeetCode (LeetCode) official website contains a lot of Internet companies' algorithm problems, which was once called an artifact of brushing problems. Here we will introduce how to use the LeetCode website.
As LeetCode itself is after constant iteration, some of the content in this article may become no longer applicable in the future.
Take Likou International Station as an example. Its official website gives four categories: Algorithms, Database, Shell and Concurrency, which represent algorithm questions, database questions, Shell and concurrent questions. The first is the algorithm questions we need to brush.
Concurrency is a new module added in 2019.
After clicking on Algorithms, we can see a list of questions, and each question has a unique serial number. LeetCode currently has more than 1,000 questions and has been continuously updated, some of which are locked and require members to view.
The following acceptance rate (Acceptance) indicates the correct rate of submission, and Difficulty indicates the degree of difficulty. There are three levels of difficulty, namely Easy, Medium and Hard.
- Easy usually does not require much thinking and does not have complicated details. It is especially suitable for novices or warm-ups.
- The Medium level will be somewhat difficult, and it usually involves classic algorithms, which requires a certain amount of thinking.
- The Hard level is the most difficult. Sometimes it is the difficulty of the algorithm itself, and sometimes you need to consider various details.
Here is a little trick for everyone. In addition to looking at the difficulty, you can also look at the acceptance rate of a question. The lower the acceptance rate, the more difficult the question is. Sometimes this indicator is more reliable than the difficulty.
You can filter and sort the topics.
If we only want to find a certain type of question or the question bank of a certain company, we can filter by Tags or Company.
In addition, when we are doing a certain question, we feel that we want to do another similar one. You can click Show Similar Problems or Tags under the title description to find similar problems.
Each topic has its own Discuss area. Here, many people have put their own ideas and codes on it. You can post questions or reply to others. There are many great gods and the quality of the questions is very high. If there is really no idea or want to see if there is a better one Ideas can come and stroll. Generally speaking, I suggest that you give priority to the one with the most comments or the most votes.
Click on a question and you will be redirected to the specific question details page. You can switch to the programming language you need in the code area on the right.
After the code is written, don't rush to submit it, test and run it first (Run Code button). You can write a few more tests and run them hard, and submit them again if there are no problems. You must know that the wrong submission will take time during the competition.
After the submission is passed, you can click on More Details to view the detailed operation result information.
Next to each question, you can find your submission status for the question in My Submissions. Here you can see all your past submissions. Click Accepted or Wrong Answer to view the status of your past submissions, including what the code is and running time. And the time distribution map submitted by all users, etc.
The above are the main functions of LeetCode. I hope that through this section, you can learn more about the LeetCode website, so that you can write questions faster.
Brush tool
The so-called "workers must first sharpen their tools if they want to do well", and then I will bring you some small tools to improve the efficiency of writing questions.
Leikou Code Debugger
Leikou Code Debugger is a simple and easy-to-use code debugging tool, it can check the running status of the code at any time and selectively run the code, so that you can debug and debug.
Leikou Code Debugger supports the following features:
- Support unlimited addition of breakpoints, single-step debugging
- One-click monitoring expressions, dynamic tracking of variables, and timely positioning of errors
"Leikou Code Debugger" is in the stage of internal testing, and the specific functions may be adjusted from time to time. Please refer to the final release version. The code debugger currently supports 5 languages, including C++, Java, Python, Python3, and C, and is being updated continuously.
It is worth noting that this is a function that can only be used by a member.
LeetCode For VSCODE
This is a plug-in that allows you to select questions, write code, test, and submit questions in the VSCODE editor. The main feature is that you can use all the advantages of your own editor, including but not limited to editor themes, code smart tips, code snippets, and debugging tools. In other words, most of the functions of the Leco code debugger mentioned above can be implemented through VSCODE and its extension plug-ins.
The disadvantage is that some functions have a bad experience, such as unobvious error prompts and frequent mis-submissions. However, what makes me most uncomfortable is the custom test cases, which are obviously not as good as the official ones.
You can search for leetcode in the vscode plug-in store to download and install it.
LeetCode-Cheat
Problem solution template
In order to make it easy for everyone to write well-formatted solution templates, the plug-in now has a built-in solution template function. Currently, there is only one set of templates. This set of templates is , the solution template I often use.
After installing our plug-in (version needs v0.8.0 and above), open the Chinese version of Likou, and you will find the following buttons.
After clicking, it will automatically lead you to a new page,
The question solution language , question address and question name information on this page will be automatically filled in.
You can quickly complete the insertion of time complexity and space complexity. The complexity has been arranged for everyone in order of performance. Click to insert.
In addition, we provide several commonly used formulas for you to quickly copy and use. Except formulas, other content can be viewed in the preview area on the right.
After writing, you can click Copy to copy it to other places for persistent storage. Since we did not make persistent storage, the page refresh will disappear .
Finally, I wish you all write beautiful solutions!
Data structure visualization
You can use canvas to freely draw various data structures, whether it is to write a problem solution or to help understand the problem is very useful.
We provide a lot of built-in templates for you to get started quickly.
If you are not satisfied with the built-in templates, you can also save your own templates for future use.
Learning route
How to learn algorithms? It is recommended to come by topic. How to learn specific topics? Here is a learning route to help you. This function aims to classify the topics in a topic. The essence of the topic is a division of the topic, and the learning route is divided again based on the topic.
Complexity analysis
Can your code time out? Complexity analysis helps you.
Copy all built-in test cases with one click
Eliminates the manual copying process one by one, and doubles the efficiency!
Code template
Provides a large number of templates that have been verified repeatedly. The function of the template is to write quickly based on your understanding of the problem, and to reduce the probability of error, even if it is wrong, it is easy to debug.
Meditation mode
After clicking, it will become like this:
The bottom console will disappear, and it will appear when you move the mouse over or exit the meditation mode.
View the solution
When you are on any non-topic detail page or topic detail page that I have not included, I will list all the solutions that I have summarized.
In fact, I have solved more classic questions, so the number of questions is not very large, and there are currently 173 questions. In addition, sometimes I wrote the topic directly, and did not write the solution for each topic separately, so the number is much more than 173.
When you enter the detail page of a problem where I wrote the solution, you can officially use my plug-in. it can:
- Give the pre-knowledge on this topic. In other words, what do I need to master before I can do this question .
- The key point of this topic.
- Which companies have this problem.
- I really won't, show me the solution. Okay, satisfy you.
- I won’t read the solution, just show me code. Okay, satisfy you.
- According to the company, find the problem. Essentials for interview assault
Later planning:
- More company information. Continue to improve the company information of the topic. This process requires your help. You can send me the questions you encounter during the interview (with company and job information), and I can provide consulting services for free.
- Post information.
- Visual debugging. Visually show your code allows.
- Automatically develop a review plan.
- AI smart reminder. That is, new hints can also infer possible solutions based on the problem information.
- and many more
If you need it, you can go to my public account "Likoujiajia" to reply to the plug-in to get it.
LeetBoard
This is a browser extension tool to help you write and draw. Many times, we need to do calculations on paper to verify our ideas, and this tool can be used at this time.
This tool provides visualization of a variety of common data structures, which is convenient for everyone to write quickly. The currently supported data formats are: arrays, linked lists, and binary trees.
debug-visualizer
This is a VSCODE plug-in that supports visual debugging. Compared with usual debugging, it can help us visualize the data structure in memory. For example, arrays, trees, graphs, etc. are all competent. Since it is not tailor-made for Likou, in fact it has many other uses, such as visualization charts, such as line charts. Its function is very powerful, you can even customize a set of your own exclusive data structure based on it.
You can search for leetcode in the vscode plug-in store to download and install it.
Summarize
These five tools, except debug-visualizer, are all tailor-made for Likou.
The functions of each tool are different, and you can also use them in combination. In general:
- If you want to write Leetcode in the editor, LeetCode (LeetCode) editor plug-in is a good choice. With debug-visualizer, you can achieve a silky smooth feeling.
- If you want to write and draw in the process of solving problems, and keep thinking, LeetBoard is recommended.
- If you want to see the company information of the title, the solution, etc., I suggest using LeetCode-Cheat written by me.
- If you don't want to use a local editor, and follow a bunch of plug-ins, but only want to use the browser to complete, then Leco Code Debugger is definitely the best choice.
In addition, there are some websites that can visualize the execution of the algorithm, which is especially important for algorithm beginners. algorithm-visualizer is such a website, which contains almost all common algorithms, I believe it can satisfy you.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。