# shubhamsarda/leetcode architecture

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

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

## Overview

This repository is a multi-language collection of interview-problem solutions, not an application or shared runtime. The documented user workflow is to browse the problem list, choose a solution, and use it to solve that problem; each solution is independent. The graph groups representative problem domains and patterns rather than implying that solutions call one another. The README documents the browse-to-solution flow, but implementation excerpts are limited, so no internal calls or execution mechanism are inferred.

Main entry points: [`README.md`](https://github.com/shubhamsarda/leetcode/blob/main/README.md) (Problem list), [`0001-two-sum`](https://github.com/shubhamsarda/leetcode/tree/main/0001-two-sum) (Hashing problems), [`0015-3sum`](https://github.com/shubhamsarda/leetcode/tree/main/0015-3sum) (Two-pointer problems), [`0643-maximum-average-subarray-i/0643-maximum-average-subarray-i.py`](https://github.com/shubhamsarda/leetcode/blob/main/0643-maximum-average-subarray-i/0643-maximum-average-subarray-i.py) (Array windows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_arrays["Arrays and intervals"]
  node_hashing["Hashing problems"]
  node_two_pointers["Two-pointer problems"]
  node_array_windows["Array windows"]
  node_array_search["Array search"]
  node_intervals["Interval problems"]
  node_matrix["Matrix problems"]
end

subgraph group_strings["Strings and search"]
  node_string_windows["String windows"]
  node_string_search["String search"]
  node_trie_words["Trie word search"]
  node_word_dictionary["Word dictionary"]
end

subgraph group_lists["Linked lists"]
  node_list_operations["List operations"]
  node_list_merging["List merging"]
end

subgraph group_trees["Trees and graphs"]
  node_tree_traversal["Tree traversal"]
  node_tree_search["Tree properties"]
  node_tree_building["Tree construction"]
  node_graph_problems["Graph problems"]
end

subgraph group_dp["Dynamic programming"]
  node_sequence_dp["Sequence DP"]
  node_grid_dp["Grid problems"]
  node_optimization_dp["Optimization DP"]
end

node_user(("Problem solver"))
node_problem_index["Problem list<br/>[README.md]"]

node_user -->|"browses"| node_problem_index
node_problem_index -->|"selects solution"| node_hashing
node_problem_index -->|"selects solution"| node_two_pointers
node_problem_index -->|"selects solution"| node_array_windows
node_problem_index -->|"selects solution"| node_array_search
node_problem_index -->|"selects solution"| node_intervals
node_problem_index -->|"selects solution"| node_matrix
node_problem_index -->|"selects solution"| node_string_windows
node_problem_index -->|"selects solution"| node_string_search
node_problem_index -->|"selects solution"| node_trie_words
node_problem_index -->|"selects solution"| node_word_dictionary
node_problem_index -->|"selects solution"| node_list_operations
node_problem_index -->|"selects solution"| node_list_merging
node_problem_index -->|"selects solution"| node_tree_traversal
node_problem_index -->|"selects solution"| node_tree_search
node_problem_index -->|"selects solution"| node_tree_building
node_problem_index -->|"selects solution"| node_graph_problems
node_problem_index -->|"selects solution"| node_sequence_dp
node_problem_index -->|"selects solution"| node_grid_dp
node_problem_index -->|"selects solution"| node_optimization_dp

click node_problem_index "https://github.com/shubhamsarda/leetcode/blob/main/README.md"
click node_hashing "https://github.com/shubhamsarda/leetcode/tree/main/0001-two-sum"
click node_two_pointers "https://github.com/shubhamsarda/leetcode/tree/main/0015-3sum"
click node_array_windows "https://github.com/shubhamsarda/leetcode/blob/main/0643-maximum-average-subarray-i/0643-maximum-average-subarray-i.py"
click node_array_search "https://github.com/shubhamsarda/leetcode/blob/main/0033-search-in-rotated-sorted-array/0033-search-in-rotated-sorted-array.py"
click node_intervals "https://github.com/shubhamsarda/leetcode/tree/main/0056-merge-intervals"
click node_matrix "https://github.com/shubhamsarda/leetcode/tree/main/0048-rotate-image"
click node_string_windows "https://github.com/shubhamsarda/leetcode/tree/main/0076-minimum-window-substring"
click node_string_search "https://github.com/shubhamsarda/leetcode/blob/main/0079-word-search/0079-word-search.py"
click node_trie_words "https://github.com/shubhamsarda/leetcode/blob/main/0212-word-search-ii/0212-word-search-ii.py"
click node_word_dictionary "https://github.com/shubhamsarda/leetcode/blob/main/0211-design-add-and-search-words-data-structure/0211-design-add-and-search-words-data-structure.py"
click node_list_operations "https://github.com/shubhamsarda/leetcode/tree/main/0019-remove-nth-node-from-end-of-list"
click node_list_merging "https://github.com/shubhamsarda/leetcode/tree/main/0023-merge-k-sorted-lists"
click node_tree_traversal "https://github.com/shubhamsarda/leetcode/tree/main/0102-binary-tree-level-order-traversal"
click node_tree_search "https://github.com/shubhamsarda/leetcode/blob/main/0098-validate-binary-search-tree/0098-validate-binary-search-tree.py"
click node_tree_building "https://github.com/shubhamsarda/leetcode/tree/main/0105-construct-binary-tree-from-preorder-and-inorder-traversal"
click node_graph_problems "https://github.com/shubhamsarda/leetcode/tree/main/0207-course-schedule"
click node_sequence_dp "https://github.com/shubhamsarda/leetcode/tree/main/1143-longest-common-subsequence"
click node_grid_dp "https://github.com/shubhamsarda/leetcode/tree/main/0062-unique-paths"
click node_optimization_dp "https://github.com/shubhamsarda/leetcode/tree/main/0322-coin-change"

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_hashing,node_two_pointers,node_array_windows,node_array_search,node_intervals,node_matrix toneBlue
class node_string_windows,node_string_search,node_trie_words,node_word_dictionary toneAmber
class node_list_operations,node_list_merging toneMint
class node_tree_traversal,node_tree_search,node_tree_building,node_graph_problems toneRose
class node_sequence_dp,node_grid_dp,node_optimization_dp,node_user toneIndigo
class node_problem_index toneTeal
```

## Components

### Arrays and intervals

- [Hashing problems](https://github.com/shubhamsarda/leetcode/tree/main/0001-two-sum): `0001-two-sum`
- [Two-pointer problems](https://github.com/shubhamsarda/leetcode/tree/main/0015-3sum): `0015-3sum`
- [Array windows](https://github.com/shubhamsarda/leetcode/blob/main/0643-maximum-average-subarray-i/0643-maximum-average-subarray-i.py): `0643-maximum-average-subarray-i/0643-maximum-average-subarray-i.py`
- [Array search](https://github.com/shubhamsarda/leetcode/blob/main/0033-search-in-rotated-sorted-array/0033-search-in-rotated-sorted-array.py): `0033-search-in-rotated-sorted-array/0033-search-in-rotated-sorted-array.py`
- [Interval problems](https://github.com/shubhamsarda/leetcode/tree/main/0056-merge-intervals): `0056-merge-intervals`
- [Matrix problems](https://github.com/shubhamsarda/leetcode/tree/main/0048-rotate-image): `0048-rotate-image`

### Strings and search

- [String windows](https://github.com/shubhamsarda/leetcode/tree/main/0076-minimum-window-substring): `0076-minimum-window-substring`
- [String search](https://github.com/shubhamsarda/leetcode/blob/main/0079-word-search/0079-word-search.py): `0079-word-search/0079-word-search.py`
- [Trie word search](https://github.com/shubhamsarda/leetcode/blob/main/0212-word-search-ii/0212-word-search-ii.py): `0212-word-search-ii/0212-word-search-ii.py`
- [Word dictionary](https://github.com/shubhamsarda/leetcode/blob/main/0211-design-add-and-search-words-data-structure/0211-design-add-and-search-words-data-structure.py): `0211-design-add-and-search-words-data-structure/0211-design-add-and-search-words-data-structure.py`

### Linked lists

- [List operations](https://github.com/shubhamsarda/leetcode/tree/main/0019-remove-nth-node-from-end-of-list): `0019-remove-nth-node-from-end-of-list`
- [List merging](https://github.com/shubhamsarda/leetcode/tree/main/0023-merge-k-sorted-lists): `0023-merge-k-sorted-lists`

### Trees and graphs

- [Tree traversal](https://github.com/shubhamsarda/leetcode/tree/main/0102-binary-tree-level-order-traversal): `0102-binary-tree-level-order-traversal`
- [Tree properties](https://github.com/shubhamsarda/leetcode/blob/main/0098-validate-binary-search-tree/0098-validate-binary-search-tree.py): `0098-validate-binary-search-tree/0098-validate-binary-search-tree.py`
- [Tree construction](https://github.com/shubhamsarda/leetcode/tree/main/0105-construct-binary-tree-from-preorder-and-inorder-traversal): `0105-construct-binary-tree-from-preorder-and-inorder-traversal`
- [Graph problems](https://github.com/shubhamsarda/leetcode/tree/main/0207-course-schedule): `0207-course-schedule`

### Dynamic programming

- [Sequence DP](https://github.com/shubhamsarda/leetcode/tree/main/1143-longest-common-subsequence): `1143-longest-common-subsequence`
- [Grid problems](https://github.com/shubhamsarda/leetcode/tree/main/0062-unique-paths): `0062-unique-paths`
- [Optimization DP](https://github.com/shubhamsarda/leetcode/tree/main/0322-coin-change): `0322-coin-change`

### Other components

- **Problem solver**
- [Problem list](https://github.com/shubhamsarda/leetcode/blob/main/README.md): `README.md`

## Connections

- Problem solver → Problem list: browses (evidence: `README.md`)
- Problem list → Hashing problems: selects solution (evidence: `README.md`)
- Problem list → Two-pointer problems: selects solution (evidence: `README.md`)
- Problem list → Array windows: selects solution (evidence: `README.md`)
- Problem list → Array search: selects solution (evidence: `README.md`)
- Problem list → Interval problems: selects solution (evidence: `README.md`)
- Problem list → Matrix problems: selects solution (evidence: `README.md`)
- Problem list → String windows: selects solution (evidence: `README.md`)
- Problem list → String search: selects solution (evidence: `README.md`)
- Problem list → Trie word search: selects solution (evidence: `README.md`)
- Problem list → Word dictionary: selects solution (evidence: `README.md`)
- Problem list → List operations: selects solution (evidence: `README.md`)
- Problem list → List merging: selects solution (evidence: `README.md`)
- Problem list → Tree traversal: selects solution (evidence: `README.md`)
- Problem list → Tree properties: selects solution (evidence: `README.md`)
- Problem list → Tree construction: selects solution (evidence: `README.md`)
- Problem list → Graph problems: selects solution (evidence: `README.md`)
- Problem list → Sequence DP: selects solution (evidence: `README.md`)
- Problem list → Grid problems: selects solution (evidence: `README.md`)
- Problem list → Optimization DP: selects solution (evidence: `README.md`)
