The LeetCode Editor is essentially a special Markdown editor, especially because it supports not only the traditional Markdown syntax, but also the special formats and functions unique to the LeetCode Editor.
Markdown syntax
# heading 1
## heading 2
### heading 3
#### heading 4
##### heading 5
###### heading 6
Insert the content you want to apply after >.
Here is an example.
Unordered List
Markdown Syntax
- text one
- text two
- text three
Ordered list
text one
text two
text three
Markdown syntax
1. text one
2. text two
3. text three
Italic Words
Markdown Syntax
_italic_
*itaic*
Bold Words
Markdown Syntax
__bold__
**bold**
Inline Latex Ssupport:
Markdown Syntax
Inline Latex Support:$O(n^2)$
Single Latex Use:
If you need a standalone Latex, use $$ brackets.
Use a paragraph: inline code.
Code Snippet
public class Main {
public static void main(String[] args) {
System.out.print("Hello LeetCode!");
}
}
Combining code modules
console.log('Hello world!')
Markdown Syntax:
Follow each code with three backticks. ''' will represent the backticks in the below situation.
'''javascript []
console.log('Hello World!')
'''
'''python[]
print('Hello world!')
'''
'''ruby[]
puts 'Hello world!'
'''
Languages | Abbreviation |
---|---|
JavaScript | js |
Python | py |
C++ | cpp |
Markdown Syntax
Languages | Abbreviation
--- | ---
JavaScript | js
Python | py
C++ | cpp
Defining alignment:
Problem Number | Title | Difficulty Level |
---|---|---|
1 | Sum of two numbers | Easy |
15 | Sum of three numbers | Medium |
262 | Itinerary and users | Hard |
Markdown Syntax:
| Problem Number | Title | Difficulty Level |
| :--- | ---:| :---: |
| 1 | Sum of two numbers | Easy |
| 15 | Sum of three numbers | Medium |
| 262 | Itinerary and users | Hard |
Write [TOC] & [toc] at the beginning of the article will generate a directory based on the titles. Click to locate to the specified position.
Markdown Syntax:
[This is a hyperlink](https://leetcode.com)
Use the traditional
markdown syntax or drag and drop the image directly into the editor to upload.
You can add {: style = "width: width pixels px"} at the end of the image to limit the width of the image, or {: style = "height: height pixels px"} to limit the height of the image; {: align = center} to adjust the position of the image.
Markdown Syntax:
{:style='width:600px'}
For more information about the markdown syntax, check out the markdown guideline https://www.markdownguide.org/basic-syntax/.