mirror of
https://github.com/prdlk/leetcode.git
synced 2026-11-02 13:12:44 +00:00
docs: restructure problem paths, change section display to groups, and improve documentation content
This commit is contained in:
1 parent
cd5f416939
commit
7c7019ec0c
119 files changed
+52
-26
No files matched your search
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+24
@@ -36,4 +36,28 @@ sidebar:
|
||||
```py
|
||||
class Solution:
|
||||
def findMedianSortedArrays(self, nums1: list[int], nums2: list[int]) -> float:
|
||||
if len(nums1) > len(nums2):
|
||||
return self.findMedianSortedArrays(nums2, nums1)
|
||||
|
||||
m, n = len(nums1), len(nums2)
|
||||
left, right = 0, m
|
||||
|
||||
while left <= right:
|
||||
partA = (left + right) // 2
|
||||
partB = (m + n + 1) // 2 - partA
|
||||
|
||||
maxLeftA = float("-inf") if partA == 0 else nums1[partA - 1]
|
||||
minRightA = float("inf") if partA == m else nums1[partA]
|
||||
maxLeftB = float("-inf") if partB == 0 else nums2[partB - 1]
|
||||
minRightB = float("inf") if partB == n else nums2[partB]
|
||||
|
||||
if maxLeftA <= minRightB and maxLeftB <= minRightA:
|
||||
if (m + n) % 2 == 0:
|
||||
return (max(maxLeftA, maxLeftB) + min(minRightA, minRightB)) / 2
|
||||
else:
|
||||
return max(maxLeftA, maxLeftB)
|
||||
elif maxLeftA > minRightB:
|
||||
right = partA - 1
|
||||
else:
|
||||
left = partA + 1
|
||||
```
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
|
||||
import { defineMeta } from "blume";
|
||||
|
||||
export default defineMeta({ title: "Binary Search", order: 5, icon: "search", display: "page" });
|
||||
export default defineMeta({ title: "Binary Search", order: 5, icon: "search", display: "group" });
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -39,10 +39,12 @@ def get_counter(arr: list[int]) -> dict[int, int]:
|
||||
return counter
|
||||
```
|
||||
|
||||
::: tip[Python provides a built-in `collections.Counter` class]
|
||||
:::tip
|
||||
Python provides a built-in [`collections.Counter`](https://docs.python.org/3/library/collections.html#collections.Counter) class that does this for us.
|
||||
:::
|
||||
|
||||
```python
|
||||
from collections import Counter
|
||||
|
||||
fq = Counter(arr)
|
||||
```
|
||||
:::
|
||||
@@ -1,3 +1,3 @@
|
||||
import { defineMeta } from "blume";
|
||||
|
||||
export default defineMeta({ title: "Hash Table", order: 1, icon: "hash", display: "page" });
|
||||
export default defineMeta({ title: "Hash Table", order: 1, icon: "hash", display: "group" });
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
|
||||
import { defineMeta } from "blume";
|
||||
|
||||
export default defineMeta({ title: "Monotonic Stack", order: 7, icon: "trending-up", display: "page" });
|
||||
export default defineMeta({ title: "Monotonic Stack", order: 7, icon: "trending-up", display: "group" });
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
|
||||
import { defineMeta } from "blume";
|
||||
|
||||
export default defineMeta({ title: "Prefix Sum", order: 2, icon: "sigma", display: "page" });
|
||||
export default defineMeta({ title: "Prefix Sum", order: 2, icon: "sigma", display: "group" });
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
|
||||
import { defineMeta } from "blume";
|
||||
|
||||
export default defineMeta({ title: "Sliding Window", order: 4, icon: "app-window", display: "page" });
|
||||
export default defineMeta({ title: "Sliding Window", order: 4, icon: "app-window", display: "group" });
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
|
||||
import { defineMeta } from "blume";
|
||||
|
||||
export default defineMeta({ title: "Stack", order: 6, icon: "layers", display: "page" });
|
||||
export default defineMeta({ title: "Stack", order: 6, icon: "layers", display: "group" });
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
|
||||
import { defineMeta } from "blume";
|
||||
|
||||
export default defineMeta({ title: "Two Pointers", order: 3, icon: "arrow-left-right", display: "page" });
|
||||
export default defineMeta({ title: "Two Pointers", order: 3, icon: "arrow-left-right", display: "group" });
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
|
||||
import { defineMeta } from "blume";
|
||||
|
||||
export default defineMeta({ title: "Hybrid Structures", order: 9, icon: "combine", display: "page" });
|
||||
export default defineMeta({ title: "Hybrid Structures", order: 9, icon: "combine", display: "group" });
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
|
||||
import { defineMeta } from "blume";
|
||||
|
||||
export default defineMeta({ title: "Linked List", order: 8, icon: "link", display: "page" });
|
||||
export default defineMeta({ title: "Linked List", order: 8, icon: "link", display: "group" });
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
|
||||
import { defineMeta } from "blume";
|
||||
|
||||
export default defineMeta({ title: "Matrix Index Math", order: 10, icon: "grid-3x3", display: "page" });
|
||||
export default defineMeta({ title: "Matrix Index Math", order: 10, icon: "grid-3x3", display: "group" });
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
|
||||
import { defineMeta } from "blume";
|
||||
|
||||
export default defineMeta({ title: "Binary Search Tree", order: 13, icon: "git-fork", display: "page" });
|
||||
export default defineMeta({ title: "Binary Search Tree", order: 13, icon: "git-fork", display: "group" });
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
|
||||
import { defineMeta } from "blume";
|
||||
|
||||
export default defineMeta({ title: "Heap / Priority Queue", order: 14, icon: "triangle", display: "page" });
|
||||
export default defineMeta({ title: "Heap / Priority Queue", order: 14, icon: "triangle", display: "group" });
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
|
||||
import { defineMeta } from "blume";
|
||||
|
||||
export default defineMeta({ title: "Tree BFS", order: 12, icon: "network", display: "page" });
|
||||
export default defineMeta({ title: "Tree BFS", order: 12, icon: "network", display: "group" });
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
|
||||
import { defineMeta } from "blume";
|
||||
|
||||
export default defineMeta({ title: "Tree DFS", order: 11, icon: "folder-tree", display: "page" });
|
||||
export default defineMeta({ title: "Tree DFS", order: 11, icon: "folder-tree", display: "group" });
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
|
||||
import { defineMeta } from "blume";
|
||||
|
||||
export default defineMeta({ title: "Trie", order: 15, icon: "spell-check", display: "page" });
|
||||
export default defineMeta({ title: "Trie", order: 15, icon: "spell-check", display: "group" });
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
|
||||
import { defineMeta } from "blume";
|
||||
|
||||
export default defineMeta({ title: "Graph BFS", order: 17, icon: "radar", display: "page" });
|
||||
export default defineMeta({ title: "Graph BFS", order: 17, icon: "radar", display: "group" });
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
|
||||
import { defineMeta } from "blume";
|
||||
|
||||
export default defineMeta({ title: "Graph DFS", order: 16, icon: "waypoints", display: "page" });
|
||||
export default defineMeta({ title: "Graph DFS", order: 16, icon: "waypoints", display: "group" });
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
|
||||
import { defineMeta } from "blume";
|
||||
|
||||
export default defineMeta({ title: "Topological Sort", order: 18, icon: "workflow", display: "page" });
|
||||
export default defineMeta({ title: "Topological Sort", order: 18, icon: "workflow", display: "group" });
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
|
||||
import { defineMeta } from "blume";
|
||||
|
||||
export default defineMeta({ title: "Union-Find", order: 19, icon: "merge", display: "page" });
|
||||
export default defineMeta({ title: "Union-Find", order: 19, icon: "merge", display: "group" });
|
||||
File renamed without changes.
Loaded 100 of 119 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user