# sanju1098/leetcode-problems architecture

> Architecture diagram of the GitHub repository sanju1098/leetcode-problems, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sanju1098/leetcode-problems
- Repository: https://github.com/sanju1098/leetcode-problems

## Overview

This repository is a collection of independent LeetCode solution files, not a single application or shared runtime. Each JavaScript or Java file implements a problem-specific function or data structure that a judge supplies with inputs and consumes as a result. The tree includes algorithms for arrays and strings, trees and lists, grids and geometry, scheduling, and graph optimization. The README provides no broader product workflow, and the sampled solutions do not import one another, so the graph shows representative independent solutions rather than invented connections. Other files in the tree are likewise standalone solutions.

Main entry points: [`1710-find-servers-that-handled-most-number-of-requests/find-servers-that-handled-most-number-of-requests.js`](https://github.com/sanju1098/leetcode-problems/blob/main/1710-find-servers-that-handled-most-number-of-requests/find-servers-that-handled-most-number-of-requests.js) (Server metrics), [`2012-process-tasks-using-servers/process-tasks-using-servers.js`](https://github.com/sanju1098/leetcode-problems/blob/main/2012-process-tasks-using-servers/process-tasks-using-servers.js) (Task scheduling), [`3717-minimum-operations-to-make-elements-within-k-subarrays-equal/minimum-operations-to-make-elements-within-k-subarrays-equal.js`](https://github.com/sanju1098/leetcode-problems/blob/main/3717-minimum-operations-to-make-elements-within-k-subarrays-equal/minimum-operations-to-make-elements-within-k-subarrays-equal.js) (Window optimization), [`3772-minimum-pair-removal-to-sort-array-ii/minimum-pair-removal-to-sort-array-ii.js`](https://github.com/sanju1098/leetcode-problems/blob/main/3772-minimum-pair-removal-to-sort-array-ii/minimum-pair-removal-to-sort-array-ii.js) (Pair removal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_algorithms["Algorithm solutions"]
  node_scheduling["Task scheduling"]
  node_server_metrics["Server metrics"]
  node_window_dp["Window optimization"]
  node_pair_removal["Pair removal"]
  node_graph_paths["Graph paths"]
  node_tree_balance["BST balancing"]
  node_tree_ancestor["BST ancestor"]
  node_grid_oranges["Grid propagation<br/>[rotting-oranges.js]"]
  node_geometry["Rectangle geometry"]
  node_search["Binary search<br/>[binary-search.js]"]
end

subgraph group_structures["Data structures"]
  node_min_heap["Min heap"]
  node_segment_tree["Availability tree"]
  node_fenwick["Fenwick trees"]
  node_typed_heap["Typed min heap"]
  node_path_heap["Path min heap"]
end

node_judge(("LeetCode judge"))

node_judge -->|"calls"| node_scheduling
node_judge -->|"calls"| node_server_metrics
node_judge -->|"calls"| node_window_dp
node_judge -->|"calls"| node_pair_removal
node_judge -->|"calls"| node_graph_paths
node_judge -->|"calls"| node_tree_balance
node_judge -->|"calls"| node_tree_ancestor
node_judge -.->|"calls"| node_grid_oranges
node_judge -->|"calls"| node_geometry
node_judge -->|"calls"| node_search
node_scheduling -->|"defines and uses"| node_min_heap
node_server_metrics -->|"defines and uses"| node_segment_tree
node_server_metrics -->|"defines and uses"| node_min_heap
node_window_dp -->|"defines and uses"| node_fenwick
node_pair_removal -->|"uses"| node_typed_heap
node_graph_paths -->|"defines and uses"| node_path_heap

click node_scheduling "https://github.com/sanju1098/leetcode-problems/blob/main/2012-process-tasks-using-servers/process-tasks-using-servers.js"
click node_server_metrics "https://github.com/sanju1098/leetcode-problems/blob/main/1710-find-servers-that-handled-most-number-of-requests/find-servers-that-handled-most-number-of-requests.js"
click node_window_dp "https://github.com/sanju1098/leetcode-problems/blob/main/3717-minimum-operations-to-make-elements-within-k-subarrays-equal/minimum-operations-to-make-elements-within-k-subarrays-equal.js"
click node_pair_removal "https://github.com/sanju1098/leetcode-problems/blob/main/3772-minimum-pair-removal-to-sort-array-ii/minimum-pair-removal-to-sort-array-ii.js"
click node_graph_paths "https://github.com/sanju1098/leetcode-problems/blob/main/3887-minimum-cost-path-with-edge-reversals/minimum-cost-path-with-edge-reversals.js"
click node_tree_balance "https://github.com/sanju1098/leetcode-problems/blob/main/1285-balance-a-binary-search-tree/balance-a-binary-search-tree.js"
click node_tree_ancestor "https://github.com/sanju1098/leetcode-problems/blob/main/235-lowest-common-ancestor-of-a-binary-search-tree/lowest-common-ancestor-of-a-binary-search-tree.js"
click node_grid_oranges "https://github.com/sanju1098/leetcode-problems/blob/main/1036-rotting-oranges/rotting-oranges.js"
click node_geometry "https://github.com/sanju1098/leetcode-problems/blob/main/3325-find-the-largest-area-of-square-inside-two-rectangles/find-the-largest-area-of-square-inside-two-rectangles.js"
click node_search "https://github.com/sanju1098/leetcode-problems/blob/main/792-binary-search/binary-search.js"
click node_min_heap "https://github.com/sanju1098/leetcode-problems/blob/main/2012-process-tasks-using-servers/process-tasks-using-servers.js"
click node_segment_tree "https://github.com/sanju1098/leetcode-problems/blob/main/1710-find-servers-that-handled-most-number-of-requests/find-servers-that-handled-most-number-of-requests.js"
click node_fenwick "https://github.com/sanju1098/leetcode-problems/blob/main/3717-minimum-operations-to-make-elements-within-k-subarrays-equal/minimum-operations-to-make-elements-within-k-subarrays-equal.js"
click node_typed_heap "https://github.com/sanju1098/leetcode-problems/blob/main/3772-minimum-pair-removal-to-sort-array-ii/minimum-pair-removal-to-sort-array-ii.js"
click node_path_heap "https://github.com/sanju1098/leetcode-problems/blob/main/3887-minimum-cost-path-with-edge-reversals/minimum-cost-path-with-edge-reversals.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_scheduling,node_server_metrics,node_window_dp,node_pair_removal,node_graph_paths,node_tree_balance,node_tree_ancestor,node_grid_oranges,node_geometry,node_search toneBlue
class node_min_heap,node_segment_tree,node_fenwick,node_typed_heap,node_path_heap toneAmber
class node_judge toneIndigo
```

## Components

### Algorithm solutions

- [Task scheduling](https://github.com/sanju1098/leetcode-problems/blob/main/2012-process-tasks-using-servers/process-tasks-using-servers.js): `2012-process-tasks-using-servers/process-tasks-using-servers.js`
- [Server metrics](https://github.com/sanju1098/leetcode-problems/blob/main/1710-find-servers-that-handled-most-number-of-requests/find-servers-that-handled-most-number-of-requests.js): `1710-find-servers-that-handled-most-number-of-requests/find-servers-that-handled-most-number-of-requests.js`
- [Window optimization](https://github.com/sanju1098/leetcode-problems/blob/main/3717-minimum-operations-to-make-elements-within-k-subarrays-equal/minimum-operations-to-make-elements-within-k-subarrays-equal.js): `3717-minimum-operations-to-make-elements-within-k-subarrays-equal/minimum-operations-to-make-elements-within-k-subarrays-equal.js`
- [Pair removal](https://github.com/sanju1098/leetcode-problems/blob/main/3772-minimum-pair-removal-to-sort-array-ii/minimum-pair-removal-to-sort-array-ii.js): `3772-minimum-pair-removal-to-sort-array-ii/minimum-pair-removal-to-sort-array-ii.js`
- [Graph paths](https://github.com/sanju1098/leetcode-problems/blob/main/3887-minimum-cost-path-with-edge-reversals/minimum-cost-path-with-edge-reversals.js): `3887-minimum-cost-path-with-edge-reversals/minimum-cost-path-with-edge-reversals.js`
- [BST balancing](https://github.com/sanju1098/leetcode-problems/blob/main/1285-balance-a-binary-search-tree/balance-a-binary-search-tree.js): `1285-balance-a-binary-search-tree/balance-a-binary-search-tree.js`
- [BST ancestor](https://github.com/sanju1098/leetcode-problems/blob/main/235-lowest-common-ancestor-of-a-binary-search-tree/lowest-common-ancestor-of-a-binary-search-tree.js): `235-lowest-common-ancestor-of-a-binary-search-tree/lowest-common-ancestor-of-a-binary-search-tree.js`
- [Grid propagation](https://github.com/sanju1098/leetcode-problems/blob/main/1036-rotting-oranges/rotting-oranges.js): `1036-rotting-oranges/rotting-oranges.js`
- [Rectangle geometry](https://github.com/sanju1098/leetcode-problems/blob/main/3325-find-the-largest-area-of-square-inside-two-rectangles/find-the-largest-area-of-square-inside-two-rectangles.js): `3325-find-the-largest-area-of-square-inside-two-rectangles/find-the-largest-area-of-square-inside-two-rectangles.js`
- [Binary search](https://github.com/sanju1098/leetcode-problems/blob/main/792-binary-search/binary-search.js): `792-binary-search/binary-search.js`

### Data structures

- [Min heap](https://github.com/sanju1098/leetcode-problems/blob/main/2012-process-tasks-using-servers/process-tasks-using-servers.js): `2012-process-tasks-using-servers/process-tasks-using-servers.js`
- [Availability tree](https://github.com/sanju1098/leetcode-problems/blob/main/1710-find-servers-that-handled-most-number-of-requests/find-servers-that-handled-most-number-of-requests.js): `1710-find-servers-that-handled-most-number-of-requests/find-servers-that-handled-most-number-of-requests.js`
- [Fenwick trees](https://github.com/sanju1098/leetcode-problems/blob/main/3717-minimum-operations-to-make-elements-within-k-subarrays-equal/minimum-operations-to-make-elements-within-k-subarrays-equal.js): `3717-minimum-operations-to-make-elements-within-k-subarrays-equal/minimum-operations-to-make-elements-within-k-subarrays-equal.js`
- [Typed min heap](https://github.com/sanju1098/leetcode-problems/blob/main/3772-minimum-pair-removal-to-sort-array-ii/minimum-pair-removal-to-sort-array-ii.js): `3772-minimum-pair-removal-to-sort-array-ii/minimum-pair-removal-to-sort-array-ii.js`
- [Path min heap](https://github.com/sanju1098/leetcode-problems/blob/main/3887-minimum-cost-path-with-edge-reversals/minimum-cost-path-with-edge-reversals.js): `3887-minimum-cost-path-with-edge-reversals/minimum-cost-path-with-edge-reversals.js`

### Other components

- **LeetCode judge**

## Connections

- LeetCode judge → Task scheduling: calls (evidence: `2012-process-tasks-using-servers/process-tasks-using-servers.js`)
- LeetCode judge → Server metrics: calls (evidence: `1710-find-servers-that-handled-most-number-of-requests/find-servers-that-handled-most-number-of-requests.js`)
- LeetCode judge → Window optimization: calls (evidence: `3717-minimum-operations-to-make-elements-within-k-subarrays-equal/minimum-operations-to-make-elements-within-k-subarrays-equal.js`)
- LeetCode judge → Pair removal: calls (evidence: `3772-minimum-pair-removal-to-sort-array-ii/minimum-pair-removal-to-sort-array-ii.js`)
- LeetCode judge → Graph paths: calls (evidence: `3887-minimum-cost-path-with-edge-reversals/minimum-cost-path-with-edge-reversals.js`)
- LeetCode judge → BST balancing: calls (evidence: `1285-balance-a-binary-search-tree/balance-a-binary-search-tree.js`)
- LeetCode judge → BST ancestor: calls (evidence: `235-lowest-common-ancestor-of-a-binary-search-tree/lowest-common-ancestor-of-a-binary-search-tree.js`)
- LeetCode judge → Grid propagation: calls
- LeetCode judge → Rectangle geometry: calls (evidence: `3325-find-the-largest-area-of-square-inside-two-rectangles/find-the-largest-area-of-square-inside-two-rectangles.js`)
- LeetCode judge → Binary search: calls (evidence: `792-binary-search/binary-search.js`)
- Task scheduling → Min heap: defines and uses (evidence: `2012-process-tasks-using-servers/process-tasks-using-servers.js`)
- Server metrics → Availability tree: defines and uses (evidence: `1710-find-servers-that-handled-most-number-of-requests/find-servers-that-handled-most-number-of-requests.js`)
- Server metrics → Min heap: defines and uses (evidence: `1710-find-servers-that-handled-most-number-of-requests/find-servers-that-handled-most-number-of-requests.js`)
- Window optimization → Fenwick trees: defines and uses (evidence: `3717-minimum-operations-to-make-elements-within-k-subarrays-equal/minimum-operations-to-make-elements-within-k-subarrays-equal.js`)
- Pair removal → Typed min heap: uses (evidence: `3772-minimum-pair-removal-to-sort-array-ii/minimum-pair-removal-to-sort-array-ii.js`)
- Graph paths → Path min heap: defines and uses (evidence: `3887-minimum-cost-path-with-edge-reversals/minimum-cost-path-with-edge-reversals.js`)
