mirror of
https://github.com/prdlk/leetcode.git
synced 2026-11-02 13:12:44 +00:00
docs(docs): add Reorder List page, rename phase titles, update redirects
This commit is contained in:
1 parent
0a4b8d8b49
commit
def494d524
7 files changed
+48
-5
No files matched your search
@@ -1,3 +1,3 @@
|
|||||||
import { defineMeta } from "blume";
|
import { defineMeta } from "blume";
|
||||||
|
|
||||||
export default defineMeta({ title: "1. Linear Structures", order: 1 });
|
export default defineMeta({ title: "Linear Structures", order: 1 });
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
title: '143. Reorder List'
|
||||||
|
description: 'You are given the head of a singly linked-list. The list can be represented as:'
|
||||||
|
icon: dot
|
||||||
|
topics:
|
||||||
|
- { name: "Linked List", slug: "linked-list" }
|
||||||
|
- { name: "Two Pointers", slug: "two-pointers" }
|
||||||
|
- { name: "Stack", slug: "stack" }
|
||||||
|
- { name: "Recursion", slug: "recursion" }
|
||||||
|
issue: "https://github.com/prdlk/leetcode/issues/81"
|
||||||
|
sidebar:
|
||||||
|
label: 'Reorder List'
|
||||||
|
badge: 'Medium'
|
||||||
|
---
|
||||||
|
|
||||||
|
### Example 1:
|
||||||
|
- Input: `head = [1,2,3,4]`
|
||||||
|
- Output: `[1,4,2,3]`
|
||||||
|
|
||||||
|
### Example 2:
|
||||||
|
- Input: `head = [1,2,3,4,5]`
|
||||||
|
- Output: `[1,5,2,4,3]`
|
||||||
|
|
||||||
|
### Constraints:
|
||||||
|
|
||||||
|
- The number of nodes in the list is in the range [1, 5 * 10^4].
|
||||||
|
- `1 <= Node.val <= 1000`
|
||||||
|
|
||||||
|
## Solution
|
||||||
|
|
||||||
|
```py
|
||||||
|
# Definition for singly-linked list.
|
||||||
|
# class ListNode:
|
||||||
|
# def __init__(self, val=0, next=None):
|
||||||
|
# self.val = val
|
||||||
|
# self.next = next
|
||||||
|
class Solution:
|
||||||
|
def reorderList(self, head: ListNode | None) -> None:
|
||||||
|
"""
|
||||||
|
Do not return anything, modify head in-place instead.
|
||||||
|
"""
|
||||||
|
```
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
import { defineMeta } from "blume";
|
import { defineMeta } from "blume";
|
||||||
|
|
||||||
export default defineMeta({ title: "2. Nodal & Grid", order: 2 });
|
export default defineMeta({ title: "Nodal & Grid", order: 2 });
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
import { defineMeta } from "blume";
|
import { defineMeta } from "blume";
|
||||||
|
|
||||||
export default defineMeta({ title: "3. Hierarchical", order: 3 });
|
export default defineMeta({ title: "Hierarchical", order: 3 });
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
import { defineMeta } from "blume";
|
import { defineMeta } from "blume";
|
||||||
|
|
||||||
export default defineMeta({ title: "4. Relational", order: 4 });
|
export default defineMeta({ title: "Relational", order: 4 });
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
import { defineMeta } from "blume";
|
import { defineMeta } from "blume";
|
||||||
|
|
||||||
export default defineMeta({ title: "5. Decision Space", order: 5 });
|
export default defineMeta({ title: "Decision Space", order: 5 });
|
||||||
@@ -47,6 +47,7 @@ export default [
|
|||||||
{ from: "/133", to: "/graph-dfs/clone-graph" },
|
{ from: "/133", to: "/graph-dfs/clone-graph" },
|
||||||
{ from: "/134", to: "/greedy/gas-station" },
|
{ from: "/134", to: "/greedy/gas-station" },
|
||||||
{ from: "/141", to: "/linked-list/linked-list-cycle" },
|
{ from: "/141", to: "/linked-list/linked-list-cycle" },
|
||||||
|
{ from: "/143", to: "/linked-list/reorder-list" },
|
||||||
{ from: "/146", to: "/hybrid-structures/lru-cache" },
|
{ from: "/146", to: "/hybrid-structures/lru-cache" },
|
||||||
{ from: "/150", to: "/stack/evaluate-reverse-polish-notation" },
|
{ from: "/150", to: "/stack/evaluate-reverse-polish-notation" },
|
||||||
{ from: "/153", to: "/binary-search/find-minimum-in-rotated-sorted-array" },
|
{ from: "/153", to: "/binary-search/find-minimum-in-rotated-sorted-array" },
|
||||||
|
|||||||
Reference in new issue
Block a user