# om-lathigara/leetcode architecture

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

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

## Overview

This repository is a collection of independent C++ solutions to LeetCode problems, not a single application. For each solution, an external judge supplies problem input, invokes that solution, and receives its result; the solutions do not form a shared runtime pipeline. The graph groups the implementations by problem domain. Source excerpts show algorithm behavior, but do not show the judge integration, so those invocation and return relationships are marked unverified.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_arrays["Arrays and selection"]
  node_two_sum["Two Sum<br/>[code.cpp]"]
  node_running_sum["Running Sum<br/>[code.cpp]"]
  node_wealth["Customer Wealth<br/>[code.cpp]"]
  node_stock["Stock Profit"]
  node_majority["Majority Element"]
  node_maximum_subarray["Maximum Subarray"]
  node_kth_largest["Kth Largest"]
  node_sort_array["Sort Array<br/>[sort-an-array.cpp]"]
  node_missing_number["Missing Number<br/>[missing-number.cpp]"]
  node_merge_array["Merge Sorted Array"]
  node_one_two_sum["Two Sum<br/>[code.cpp]"]
end

subgraph group_lists["Linked lists"]
  node_merge_lists["Merge Sorted Lists"]
  node_dedupe_list["Deduplicate List"]
  node_remove_list["Remove List Elements"]
  node_middle_list["Middle List Node"]
end

subgraph group_trees["Tree construction"]
  node_list_to_tree["List to BST"]
  node_array_to_tree["Array to BST<br/>[code.cpp]"]
end

subgraph group_strings["Strings and numbers"]
  node_nice_substring["Longest Nice Substring"]
  node_binary_add["Add Binary<br/>[add-binary.cpp]"]
  node_fizz_buzz["Fizz Buzz<br/>[fizz-buzz.cpp]"]
  node_reverse_integer["Reverse Integer"]
  node_palindrome["Palindrome Number"]
  node_reverse_bits["Reverse Bits<br/>[reverse-bits.cpp]"]
  node_bit_count["Number of 1 Bits"]
  node_power_two["Power of Two<br/>[power-of-two.cpp]"]
  node_complement["Number Complement"]
  node_hexadecimal["Integer to Hex"]
  node_perfect_number["Perfect Number<br/>[perfect-number.cpp]"]
  node_digit_sum["Alternating Digit Sum"]
end

node_judge(("External judge"))

click node_two_sum "https://github.com/om-lathigara/leetcode/blob/main/1-two-sum/code.cpp"
click node_running_sum "https://github.com/om-lathigara/leetcode/blob/main/1603-running-sum-of-1d-array/code.cpp"
click node_wealth "https://github.com/om-lathigara/leetcode/blob/main/1791-richest-customer-wealth/code.cpp"
click node_stock "https://github.com/om-lathigara/leetcode/blob/main/122-best-time-to-buy-and-sell-stock-ii/best-time-to-buy-and-sell-stock-ii.cpp"
click node_majority "https://github.com/om-lathigara/leetcode/blob/main/169-majority-element/majority-element.cpp"
click node_maximum_subarray "https://github.com/om-lathigara/leetcode/blob/main/53-maximum-subarray/maximum-subarray.cpp"
click node_kth_largest "https://github.com/om-lathigara/leetcode/blob/main/215-kth-largest-element-in-an-array/kth-largest-element-in-an-array.cpp"
click node_sort_array "https://github.com/om-lathigara/leetcode/blob/main/948-sort-an-array/sort-an-array.cpp"
click node_missing_number "https://github.com/om-lathigara/leetcode/blob/main/268-missing-number/missing-number.cpp"
click node_merge_array "https://github.com/om-lathigara/leetcode/blob/main/88-merge-sorted-array/merge-sorted-array.cpp"
click node_merge_lists "https://github.com/om-lathigara/leetcode/blob/main/21-merge-two-sorted-lists/merge-two-sorted-lists.cpp"
click node_dedupe_list "https://github.com/om-lathigara/leetcode/blob/main/83-remove-duplicates-from-sorted-list/remove-duplicates-from-sorted-list.cpp"
click node_remove_list "https://github.com/om-lathigara/leetcode/tree/main/203-remove-linked-list-elements"
click node_middle_list "https://github.com/om-lathigara/leetcode/tree/main/908-middle-of-the-linked-list"
click node_list_to_tree "https://github.com/om-lathigara/leetcode/blob/main/109-convert-sorted-list-to-binary-search-tree/convert-sorted-list-to-binary-search-tree.cpp"
click node_array_to_tree "https://github.com/om-lathigara/leetcode/blob/main/108-convert-sorted-array-to-binary-search-tree/code.cpp"
click node_nice_substring "https://github.com/om-lathigara/leetcode/blob/main/1873-longest-nice-substring/longest-nice-substring.cpp"
click node_binary_add "https://github.com/om-lathigara/leetcode/blob/main/67-add-binary/add-binary.cpp"
click node_fizz_buzz "https://github.com/om-lathigara/leetcode/blob/main/412-fizz-buzz/fizz-buzz.cpp"
click node_reverse_integer "https://github.com/om-lathigara/leetcode/blob/main/7-reverse-integer/reverse-integer.cpp"
click node_palindrome "https://github.com/om-lathigara/leetcode/blob/main/9-palindrome-number/palindrome-number.cpp"
click node_reverse_bits "https://github.com/om-lathigara/leetcode/blob/main/190-reverse-bits/reverse-bits.cpp"
click node_bit_count "https://github.com/om-lathigara/leetcode/blob/main/191-number-of-1-bits/number-of-1-bits.cpp"
click node_power_two "https://github.com/om-lathigara/leetcode/blob/main/231-power-of-two/power-of-two.cpp"
click node_complement "https://github.com/om-lathigara/leetcode/blob/main/476-number-complement/number-complement.cpp"
click node_hexadecimal "https://github.com/om-lathigara/leetcode/blob/main/405-convert-a-number-to-hexadecimal/convert-a-number-to-hexadecimal.cpp"
click node_perfect_number "https://github.com/om-lathigara/leetcode/blob/main/507-perfect-number/perfect-number.cpp"
click node_digit_sum "https://github.com/om-lathigara/leetcode/blob/main/2630-alternating-digit-sum/alternating-digit-sum.cpp"
click node_one_two_sum "https://github.com/om-lathigara/leetcode/blob/main/1-two-sum/code.cpp"

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_running_sum,node_wealth,node_stock,node_majority,node_maximum_subarray,node_kth_largest,node_sort_array,node_missing_number,node_merge_array,node_one_two_sum toneBlue
class node_merge_lists,node_dedupe_list,node_remove_list,node_middle_list toneAmber
class node_list_to_tree,node_array_to_tree toneMint
class node_nice_substring,node_binary_add,node_fizz_buzz,node_reverse_integer,node_palindrome,node_reverse_bits,node_bit_count,node_power_two,node_complement,node_hexadecimal,node_perfect_number,node_digit_sum toneRose
class node_judge toneIndigo
```

## Components

### Arrays and selection

- [Two Sum](https://github.com/om-lathigara/leetcode/blob/main/1-two-sum/code.cpp): `1-two-sum/code.cpp`
- [Running Sum](https://github.com/om-lathigara/leetcode/blob/main/1603-running-sum-of-1d-array/code.cpp): `1603-running-sum-of-1d-array/code.cpp`
- [Customer Wealth](https://github.com/om-lathigara/leetcode/blob/main/1791-richest-customer-wealth/code.cpp): `1791-richest-customer-wealth/code.cpp`
- [Stock Profit](https://github.com/om-lathigara/leetcode/blob/main/122-best-time-to-buy-and-sell-stock-ii/best-time-to-buy-and-sell-stock-ii.cpp): `122-best-time-to-buy-and-sell-stock-ii/best-time-to-buy-and-sell-stock-ii.cpp`
- [Majority Element](https://github.com/om-lathigara/leetcode/blob/main/169-majority-element/majority-element.cpp): `169-majority-element/majority-element.cpp`
- [Maximum Subarray](https://github.com/om-lathigara/leetcode/blob/main/53-maximum-subarray/maximum-subarray.cpp): `53-maximum-subarray/maximum-subarray.cpp`
- [Kth Largest](https://github.com/om-lathigara/leetcode/blob/main/215-kth-largest-element-in-an-array/kth-largest-element-in-an-array.cpp): `215-kth-largest-element-in-an-array/kth-largest-element-in-an-array.cpp`
- [Sort Array](https://github.com/om-lathigara/leetcode/blob/main/948-sort-an-array/sort-an-array.cpp): `948-sort-an-array/sort-an-array.cpp`
- [Missing Number](https://github.com/om-lathigara/leetcode/blob/main/268-missing-number/missing-number.cpp): `268-missing-number/missing-number.cpp`
- [Merge Sorted Array](https://github.com/om-lathigara/leetcode/blob/main/88-merge-sorted-array/merge-sorted-array.cpp): `88-merge-sorted-array/merge-sorted-array.cpp`
- [Two Sum](https://github.com/om-lathigara/leetcode/blob/main/1-two-sum/code.cpp): `1-two-sum/code.cpp`

### Linked lists

- [Merge Sorted Lists](https://github.com/om-lathigara/leetcode/blob/main/21-merge-two-sorted-lists/merge-two-sorted-lists.cpp): `21-merge-two-sorted-lists/merge-two-sorted-lists.cpp`
- [Deduplicate List](https://github.com/om-lathigara/leetcode/blob/main/83-remove-duplicates-from-sorted-list/remove-duplicates-from-sorted-list.cpp): `83-remove-duplicates-from-sorted-list/remove-duplicates-from-sorted-list.cpp`
- [Remove List Elements](https://github.com/om-lathigara/leetcode/tree/main/203-remove-linked-list-elements): `203-remove-linked-list-elements`
- [Middle List Node](https://github.com/om-lathigara/leetcode/tree/main/908-middle-of-the-linked-list): `908-middle-of-the-linked-list`

### Tree construction

- [List to BST](https://github.com/om-lathigara/leetcode/blob/main/109-convert-sorted-list-to-binary-search-tree/convert-sorted-list-to-binary-search-tree.cpp): `109-convert-sorted-list-to-binary-search-tree/convert-sorted-list-to-binary-search-tree.cpp`
- [Array to BST](https://github.com/om-lathigara/leetcode/blob/main/108-convert-sorted-array-to-binary-search-tree/code.cpp): `108-convert-sorted-array-to-binary-search-tree/code.cpp`

### Strings and numbers

- [Longest Nice Substring](https://github.com/om-lathigara/leetcode/blob/main/1873-longest-nice-substring/longest-nice-substring.cpp): `1873-longest-nice-substring/longest-nice-substring.cpp`
- [Add Binary](https://github.com/om-lathigara/leetcode/blob/main/67-add-binary/add-binary.cpp): `67-add-binary/add-binary.cpp`
- [Fizz Buzz](https://github.com/om-lathigara/leetcode/blob/main/412-fizz-buzz/fizz-buzz.cpp): `412-fizz-buzz/fizz-buzz.cpp`
- [Reverse Integer](https://github.com/om-lathigara/leetcode/blob/main/7-reverse-integer/reverse-integer.cpp): `7-reverse-integer/reverse-integer.cpp`
- [Palindrome Number](https://github.com/om-lathigara/leetcode/blob/main/9-palindrome-number/palindrome-number.cpp): `9-palindrome-number/palindrome-number.cpp`
- [Reverse Bits](https://github.com/om-lathigara/leetcode/blob/main/190-reverse-bits/reverse-bits.cpp): `190-reverse-bits/reverse-bits.cpp`
- [Number of 1 Bits](https://github.com/om-lathigara/leetcode/blob/main/191-number-of-1-bits/number-of-1-bits.cpp): `191-number-of-1-bits/number-of-1-bits.cpp`
- [Power of Two](https://github.com/om-lathigara/leetcode/blob/main/231-power-of-two/power-of-two.cpp): `231-power-of-two/power-of-two.cpp`
- [Number Complement](https://github.com/om-lathigara/leetcode/blob/main/476-number-complement/number-complement.cpp): `476-number-complement/number-complement.cpp`
- [Integer to Hex](https://github.com/om-lathigara/leetcode/blob/main/405-convert-a-number-to-hexadecimal/convert-a-number-to-hexadecimal.cpp): `405-convert-a-number-to-hexadecimal/convert-a-number-to-hexadecimal.cpp`
- [Perfect Number](https://github.com/om-lathigara/leetcode/blob/main/507-perfect-number/perfect-number.cpp): `507-perfect-number/perfect-number.cpp`
- [Alternating Digit Sum](https://github.com/om-lathigara/leetcode/blob/main/2630-alternating-digit-sum/alternating-digit-sum.cpp): `2630-alternating-digit-sum/alternating-digit-sum.cpp`

### Other components

- **External judge**
