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.


Support Syntax

heading 1

heading 2

heading 3

heading 4

heading 5
heading 6

Markdown syntax

# heading 1
## heading 2
### heading 3
#### heading 4
##### heading 5
###### heading 6

Quote

Insert the content you want to apply after >.

Here is an example.

List

Unordered List

  • text one
  • text two
  • text three

Markdown Syntax

- text one
- text two
- text three

Ordered list

  1. text one

  2. text two

  3. text three

Markdown syntax

1. text one
2. text two
3. text three

Text Deformation

Italic Words

Markdown Syntax

_italic_
*itaic*

Bold Words

Markdown Syntax

__bold__
**bold**

Latex

Inline Latex Ssupport:

Markdown Syntax

Inline Latex Support:$O(n^2)$

Single Latex Use:

If you need a standalone Latex, use $$ brackets.


Code

Use a paragraph: inline code.

Code Snippet

public class Main {
    public static void main(String[] args) {
        System.out.print("Hello LeetCode!");
    }
}

Combining code modules

JavaScript
Python
Ruby
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!'
'''

Form

LanguagesAbbreviation
JavaScriptjs
Pythonpy
C++cpp

Markdown Syntax

Languages | Abbreviation
--- | ---
JavaScript | js
Python | py
C++ | cpp

Defining alignment:

Problem NumberTitleDifficulty Level
1Sum of two numbersEasy
15Sum of three numbersMedium
262Itinerary and usersHard

Markdown Syntax:

| Problem Number | Title | Difficulty Level | 
| :--- | ---:| :---: | 
| 1 | Sum of two numbers | Easy | 
| 15 | Sum of three numbers | Medium | 
| 262 | Itinerary and users | Hard | 

Table of Contents

Write [TOC] & [toc] at the beginning of the article will generate a directory based on the titles. Click to locate to the specified position.
image


This is a hyperlink.

Markdown Syntax:

[This is a hyperlink](https://leetcode.com)


Picture

LeetCode

Use the traditional![image name](image address)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:

![LeetCode](https://assets.leetcode.com/static_assets/others/LeetCode_logo_black.png){:style='width:600px'}

For more information about the markdown syntax, check out the markdown guideline https://www.markdownguide.org/basic-syntax/.

Comments (70)