# yosefhosam/leetcode architecture

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

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

## Overview

This repository is a collection of independent C# LeetCode solutions, not a single application or shared runtime. The user-facing workflow is to choose a problem, provide its expected input to that solution’s public method, and receive its result. The groups reflect the README’s broad topic areas; individual solutions do not form a shared execution pipeline. The tree and README identify the collection, but the excerpts do not show a common caller, so invocation edges are marked unverified.

Main entry points: [`0001-two-sum/0001-two-sum.cs`](https://github.com/yosefhosam/leetcode/blob/main/0001-two-sum/0001-two-sum.cs) (Two Sum), [`0011-container-with-most-water/0011-container-with-most-water.cs`](https://github.com/yosefhosam/leetcode/blob/main/0011-container-with-most-water/0011-container-with-most-water.cs) (Container Water), [`0015-3sum/0015-3sum.cs`](https://github.com/yosefhosam/leetcode/blob/main/0015-3sum/0015-3sum.cs) (Three Sum), [`0121-best-time-to-buy-and-sell-stock/0121-best-time-to-buy-and-sell-stock.cs`](https://github.com/yosefhosam/leetcode/blob/main/0121-best-time-to-buy-and-sell-stock/0121-best-time-to-buy-and-sell-stock.cs) (Stock Profit)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_arrays["Array algorithms"]
  node_two_sum["Two Sum<br/>[0001-two-sum.cs]"]
  node_container["Container Water"]
  node_three_sum["Three Sum<br/>[0015-3sum.cs]"]
  node_stock["Stock Profit"]
  node_consecutive["Consecutive Sequence"]
  node_two_sum_sorted["Sorted Two Sum"]
  node_duplicates["Contains Duplicate"]
  node_product["Array Product"]
end

subgraph group_strings["Strings and hashing"]
  node_substring["Longest Unique Substring"]
  node_parentheses["Valid Parentheses"]
  node_anagrams["Group Anagrams"]
  node_palindrome["Valid Palindrome"]
  node_anagram["Valid Anagram"]
  node_replacement["Character Replacement"]
end

subgraph group_lists["Linked lists"]
  node_remove_node["Remove List Node"]
  node_merge_two["Merge Two Lists"]
  node_merge_k["Merge K Lists"]
  node_cycle["List Cycle"]
  node_reorder["Reorder List"]
  node_reverse["Reverse List"]
end

subgraph group_search["Search and selection"]
  node_rotated_search["Rotated Search"]
  node_rotated_min["Rotated Minimum"]
  node_top_k["Top K Frequent"]
  node_binary_search["Binary Search"]
end

node_user(("Problem solver"))

node_user -.->|"selects problem"| node_two_sum
node_user -.->|"selects problem"| node_container
node_user -.->|"selects problem"| node_three_sum
node_user -.->|"selects problem"| node_stock
node_user -.->|"selects problem"| node_consecutive
node_user -.->|"selects problem"| node_two_sum_sorted
node_user -.->|"selects problem"| node_duplicates
node_user -.->|"selects problem"| node_product
node_user -.->|"selects problem"| node_substring
node_user -.->|"selects problem"| node_parentheses
node_user -.->|"selects problem"| node_anagrams
node_user -.->|"selects problem"| node_palindrome
node_user -.->|"selects problem"| node_anagram
node_user -.->|"selects problem"| node_replacement
node_user -.->|"selects problem"| node_remove_node
node_user -.->|"selects problem"| node_merge_two
node_user -.->|"selects problem"| node_merge_k
node_user -.->|"selects problem"| node_cycle
node_user -.->|"selects problem"| node_reorder
node_user -.->|"selects problem"| node_reverse
node_user -.->|"selects problem"| node_rotated_search
node_user -.->|"selects problem"| node_rotated_min
node_user -.->|"selects problem"| node_top_k
node_user -.->|"selects problem"| node_binary_search

click node_two_sum "https://github.com/yosefhosam/leetcode/blob/main/0001-two-sum/0001-two-sum.cs"
click node_container "https://github.com/yosefhosam/leetcode/blob/main/0011-container-with-most-water/0011-container-with-most-water.cs"
click node_three_sum "https://github.com/yosefhosam/leetcode/blob/main/0015-3sum/0015-3sum.cs"
click node_stock "https://github.com/yosefhosam/leetcode/blob/main/0121-best-time-to-buy-and-sell-stock/0121-best-time-to-buy-and-sell-stock.cs"
click node_consecutive "https://github.com/yosefhosam/leetcode/blob/main/0128-longest-consecutive-sequence/0128-longest-consecutive-sequence.cs"
click node_two_sum_sorted "https://github.com/yosefhosam/leetcode/blob/main/0167-two-sum-ii-input-array-is-sorted/0167-two-sum-ii-input-array-is-sorted.cs"
click node_duplicates "https://github.com/yosefhosam/leetcode/blob/main/0217-contains-duplicate/0217-contains-duplicate.cs"
click node_product "https://github.com/yosefhosam/leetcode/blob/main/0238-product-of-array-except-self/0238-product-of-array-except-self.cs"
click node_substring "https://github.com/yosefhosam/leetcode/blob/main/0003-longest-substring-without-repeating-characters/0003-longest-substring-without-repeating-characters.cs"
click node_parentheses "https://github.com/yosefhosam/leetcode/blob/main/0020-valid-parentheses/0020-valid-parentheses.cs"
click node_anagrams "https://github.com/yosefhosam/leetcode/blob/main/0049-group-anagrams/0049-group-anagrams.cs"
click node_palindrome "https://github.com/yosefhosam/leetcode/blob/main/0125-valid-palindrome/0125-valid-palindrome.cs"
click node_anagram "https://github.com/yosefhosam/leetcode/blob/main/0242-valid-anagram/0242-valid-anagram.cs"
click node_replacement "https://github.com/yosefhosam/leetcode/blob/main/0424-longest-repeating-character-replacement/0424-longest-repeating-character-replacement.cs"
click node_remove_node "https://github.com/yosefhosam/leetcode/blob/main/0019-remove-nth-node-from-end-of-list/0019-remove-nth-node-from-end-of-list.cs"
click node_merge_two "https://github.com/yosefhosam/leetcode/blob/main/0021-merge-two-sorted-lists/0021-merge-two-sorted-lists.cs"
click node_merge_k "https://github.com/yosefhosam/leetcode/blob/main/0023-merge-k-sorted-lists/0023-merge-k-sorted-lists.cs"
click node_cycle "https://github.com/yosefhosam/leetcode/blob/main/0141-linked-list-cycle/0141-linked-list-cycle.cs"
click node_reorder "https://github.com/yosefhosam/leetcode/blob/main/0143-reorder-list/0143-reorder-list.cs"
click node_reverse "https://github.com/yosefhosam/leetcode/blob/main/0206-reverse-linked-list/0206-reverse-linked-list.cs"
click node_rotated_search "https://github.com/yosefhosam/leetcode/blob/main/0033-search-in-rotated-sorted-array/0033-search-in-rotated-sorted-array.cs"
click node_rotated_min "https://github.com/yosefhosam/leetcode/blob/main/0153-find-minimum-in-rotated-sorted-array/0153-find-minimum-in-rotated-sorted-array.cs"
click node_top_k "https://github.com/yosefhosam/leetcode/blob/main/0347-top-k-frequent-elements/0347-top-k-frequent-elements.cs"
click node_binary_search "https://github.com/yosefhosam/leetcode/blob/main/0704-binary-search/0704-binary-search.cs"

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_two_sum,node_container,node_three_sum,node_stock,node_consecutive,node_two_sum_sorted,node_duplicates,node_product toneBlue
class node_substring,node_parentheses,node_anagrams,node_palindrome,node_anagram,node_replacement toneAmber
class node_remove_node,node_merge_two,node_merge_k,node_cycle,node_reorder,node_reverse toneMint
class node_rotated_search,node_rotated_min,node_top_k,node_binary_search toneRose
class node_user toneIndigo
```

## Components

### Array algorithms

- [Two Sum](https://github.com/yosefhosam/leetcode/blob/main/0001-two-sum/0001-two-sum.cs): `0001-two-sum/0001-two-sum.cs`
- [Container Water](https://github.com/yosefhosam/leetcode/blob/main/0011-container-with-most-water/0011-container-with-most-water.cs): `0011-container-with-most-water/0011-container-with-most-water.cs`
- [Three Sum](https://github.com/yosefhosam/leetcode/blob/main/0015-3sum/0015-3sum.cs): `0015-3sum/0015-3sum.cs`
- [Stock Profit](https://github.com/yosefhosam/leetcode/blob/main/0121-best-time-to-buy-and-sell-stock/0121-best-time-to-buy-and-sell-stock.cs): `0121-best-time-to-buy-and-sell-stock/0121-best-time-to-buy-and-sell-stock.cs`
- [Consecutive Sequence](https://github.com/yosefhosam/leetcode/blob/main/0128-longest-consecutive-sequence/0128-longest-consecutive-sequence.cs): `0128-longest-consecutive-sequence/0128-longest-consecutive-sequence.cs`
- [Sorted Two Sum](https://github.com/yosefhosam/leetcode/blob/main/0167-two-sum-ii-input-array-is-sorted/0167-two-sum-ii-input-array-is-sorted.cs): `0167-two-sum-ii-input-array-is-sorted/0167-two-sum-ii-input-array-is-sorted.cs`
- [Contains Duplicate](https://github.com/yosefhosam/leetcode/blob/main/0217-contains-duplicate/0217-contains-duplicate.cs): `0217-contains-duplicate/0217-contains-duplicate.cs`
- [Array Product](https://github.com/yosefhosam/leetcode/blob/main/0238-product-of-array-except-self/0238-product-of-array-except-self.cs): `0238-product-of-array-except-self/0238-product-of-array-except-self.cs`

### Strings and hashing

- [Longest Unique Substring](https://github.com/yosefhosam/leetcode/blob/main/0003-longest-substring-without-repeating-characters/0003-longest-substring-without-repeating-characters.cs): `0003-longest-substring-without-repeating-characters/0003-longest-substring-without-repeating-characters.cs`
- [Valid Parentheses](https://github.com/yosefhosam/leetcode/blob/main/0020-valid-parentheses/0020-valid-parentheses.cs): `0020-valid-parentheses/0020-valid-parentheses.cs`
- [Group Anagrams](https://github.com/yosefhosam/leetcode/blob/main/0049-group-anagrams/0049-group-anagrams.cs): `0049-group-anagrams/0049-group-anagrams.cs`
- [Valid Palindrome](https://github.com/yosefhosam/leetcode/blob/main/0125-valid-palindrome/0125-valid-palindrome.cs): `0125-valid-palindrome/0125-valid-palindrome.cs`
- [Valid Anagram](https://github.com/yosefhosam/leetcode/blob/main/0242-valid-anagram/0242-valid-anagram.cs): `0242-valid-anagram/0242-valid-anagram.cs`
- [Character Replacement](https://github.com/yosefhosam/leetcode/blob/main/0424-longest-repeating-character-replacement/0424-longest-repeating-character-replacement.cs): `0424-longest-repeating-character-replacement/0424-longest-repeating-character-replacement.cs`

### Linked lists

- [Remove List Node](https://github.com/yosefhosam/leetcode/blob/main/0019-remove-nth-node-from-end-of-list/0019-remove-nth-node-from-end-of-list.cs): `0019-remove-nth-node-from-end-of-list/0019-remove-nth-node-from-end-of-list.cs`
- [Merge Two Lists](https://github.com/yosefhosam/leetcode/blob/main/0021-merge-two-sorted-lists/0021-merge-two-sorted-lists.cs): `0021-merge-two-sorted-lists/0021-merge-two-sorted-lists.cs`
- [Merge K Lists](https://github.com/yosefhosam/leetcode/blob/main/0023-merge-k-sorted-lists/0023-merge-k-sorted-lists.cs): `0023-merge-k-sorted-lists/0023-merge-k-sorted-lists.cs`
- [List Cycle](https://github.com/yosefhosam/leetcode/blob/main/0141-linked-list-cycle/0141-linked-list-cycle.cs): `0141-linked-list-cycle/0141-linked-list-cycle.cs`
- [Reorder List](https://github.com/yosefhosam/leetcode/blob/main/0143-reorder-list/0143-reorder-list.cs): `0143-reorder-list/0143-reorder-list.cs`
- [Reverse List](https://github.com/yosefhosam/leetcode/blob/main/0206-reverse-linked-list/0206-reverse-linked-list.cs): `0206-reverse-linked-list/0206-reverse-linked-list.cs`

### Search and selection

- [Rotated Search](https://github.com/yosefhosam/leetcode/blob/main/0033-search-in-rotated-sorted-array/0033-search-in-rotated-sorted-array.cs): `0033-search-in-rotated-sorted-array/0033-search-in-rotated-sorted-array.cs`
- [Rotated Minimum](https://github.com/yosefhosam/leetcode/blob/main/0153-find-minimum-in-rotated-sorted-array/0153-find-minimum-in-rotated-sorted-array.cs): `0153-find-minimum-in-rotated-sorted-array/0153-find-minimum-in-rotated-sorted-array.cs`
- [Top K Frequent](https://github.com/yosefhosam/leetcode/blob/main/0347-top-k-frequent-elements/0347-top-k-frequent-elements.cs): `0347-top-k-frequent-elements/0347-top-k-frequent-elements.cs`
- [Binary Search](https://github.com/yosefhosam/leetcode/blob/main/0704-binary-search/0704-binary-search.cs): `0704-binary-search/0704-binary-search.cs`

### Other components

- **Problem solver**

## Connections

- Problem solver → Two Sum: selects problem
- Problem solver → Container Water: selects problem
- Problem solver → Three Sum: selects problem
- Problem solver → Stock Profit: selects problem
- Problem solver → Consecutive Sequence: selects problem
- Problem solver → Sorted Two Sum: selects problem
- Problem solver → Contains Duplicate: selects problem
- Problem solver → Array Product: selects problem
- Problem solver → Longest Unique Substring: selects problem
- Problem solver → Valid Parentheses: selects problem
- Problem solver → Group Anagrams: selects problem
- Problem solver → Valid Palindrome: selects problem
- Problem solver → Valid Anagram: selects problem
- Problem solver → Character Replacement: selects problem
- Problem solver → Remove List Node: selects problem
- Problem solver → Merge Two Lists: selects problem
- Problem solver → Merge K Lists: selects problem
- Problem solver → List Cycle: selects problem
- Problem solver → Reorder List: selects problem
- Problem solver → Reverse List: selects problem
- Problem solver → Rotated Search: selects problem
- Problem solver → Rotated Minimum: selects problem
- Problem solver → Top K Frequent: selects problem
- Problem solver → Binary Search: selects problem
