# saif-pixel1/leetcode architecture

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

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

## Overview

This repository is a collection of independent LeetCode/DSA solutions, not a single application: a user chooses a problem, supplies its inputs to that problem’s solution, and receives a return value or in-place mutation. The README organizes problems by algorithm topics; the source index shows standalone implementations and no shared runtime or dispatcher. Nodes represent the problem directories, including problems not excerpted. The edges are omitted because no common invocation mechanism or inter-solution calls are evidenced.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_arrays["Array Algorithms"]
  node_two_sum["Two Sum"]
  node_three_sum["3Sum"]
  node_sort_colors["Sort Colors"]
  node_merge_sorted["Merge Sorted Array"]
  node_two_sum_sorted["Sorted Two Sum"]
  node_majority_element["Majority Element"]
  node_max_ones["Max Consecutive Ones"]
  node_set_mismatch["Set Mismatch"]
  node_pivot_index["Pivot Index"]
  node_monotonic_array["Monotonic Array"]
  node_sort_parity["Sort By Parity"]
  node_sort_parity_ii["Sort By Parity II"]
  node_sorted_squares["Sorted Squares"]
  node_running_sum["Running Sum"]
  node_highest_altitude["Highest Altitude"]
  node_count_pairs["Count Small-Sum Pairs"]
end

subgraph group_strings["String Algorithms"]
  node_valid_palindrome["Valid Palindrome"]
  node_reverse_words["Reverse Words"]
  node_reverse_string["Reverse String"]
  node_reverse_string_ii["Reverse String II"]
  node_reverse_words_iii["Reverse Words III"]
  node_palindrome_delete["Palindrome With Deletion"]
  node_remove_pal_subseq["Remove Palindromic Subsequences"]
  node_merge_strings["Merge Strings"]
  node_almost_equal["Almost Equal Strings"]
  node_first_palindrome["First Palindrome"]
  node_append_subsequence["Append For Subsequence"]
  node_smallest_palindrome["Smallest Palindrome"]
end

subgraph group_math["Math Algorithms"]
  node_plus_one["Plus One"]
  node_even_digits["Even Digit Count"]
  node_palindrome_number["Palindrome Number"]
end

subgraph group_dynamic["Dynamic Programming"]
  node_pascals_triangle["Pascal Triangle"]
  node_pascals_row["Pascal Row"]
  node_stock_profit["Stock Profit"]
end

click node_two_sum "https://github.com/saif-pixel1/leetcode/tree/main/0001-two-sum"
click node_three_sum "https://github.com/saif-pixel1/leetcode/tree/main/0015-3sum"
click node_plus_one "https://github.com/saif-pixel1/leetcode/tree/main/0066-plus-one"
click node_sort_colors "https://github.com/saif-pixel1/leetcode/tree/main/0075-sort-colors"
click node_merge_sorted "https://github.com/saif-pixel1/leetcode/tree/main/0088-merge-sorted-array"
click node_pascals_triangle "https://github.com/saif-pixel1/leetcode/tree/main/0118-pascals-triangle"
click node_pascals_row "https://github.com/saif-pixel1/leetcode/tree/main/0119-pascals-triangle-ii"
click node_stock_profit "https://github.com/saif-pixel1/leetcode/tree/main/0121-best-time-to-buy-and-sell-stock"
click node_valid_palindrome "https://github.com/saif-pixel1/leetcode/tree/main/0125-valid-palindrome"
click node_reverse_words "https://github.com/saif-pixel1/leetcode/tree/main/0151-reverse-words-in-a-string"
click node_two_sum_sorted "https://github.com/saif-pixel1/leetcode/tree/main/0167-two-sum-ii-input-array-is-sorted"
click node_majority_element "https://github.com/saif-pixel1/leetcode/tree/main/0169-majority-element"
click node_reverse_string "https://github.com/saif-pixel1/leetcode/tree/main/0344-reverse-string"
click node_max_ones "https://github.com/saif-pixel1/leetcode/tree/main/0485-max-consecutive-ones"
click node_reverse_string_ii "https://github.com/saif-pixel1/leetcode/tree/main/0541-reverse-string-ii"
click node_reverse_words_iii "https://github.com/saif-pixel1/leetcode/tree/main/0557-reverse-words-in-a-string-iii"
click node_set_mismatch "https://github.com/saif-pixel1/leetcode/tree/main/0645-set-mismatch"
click node_palindrome_delete "https://github.com/saif-pixel1/leetcode/tree/main/0680-valid-palindrome-ii"
click node_pivot_index "https://github.com/saif-pixel1/leetcode/tree/main/0724-find-pivot-index"
click node_monotonic_array "https://github.com/saif-pixel1/leetcode/tree/main/0896-monotonic-array"
click node_sort_parity "https://github.com/saif-pixel1/leetcode/tree/main/0905-sort-array-by-parity"
click node_sort_parity_ii "https://github.com/saif-pixel1/leetcode/tree/main/0922-sort-array-by-parity-ii"
click node_sorted_squares "https://github.com/saif-pixel1/leetcode/tree/main/0977-squares-of-a-sorted-array"
click node_even_digits "https://github.com/saif-pixel1/leetcode/tree/main/1295-find-numbers-with-even-number-of-digits"
click node_remove_pal_subseq "https://github.com/saif-pixel1/leetcode/tree/main/1332-remove-palindromic-subsequences"
click node_running_sum "https://github.com/saif-pixel1/leetcode/tree/main/1480-running-sum-of-1d-array"
click node_highest_altitude "https://github.com/saif-pixel1/leetcode/tree/main/1732-find-the-highest-altitude"
click node_merge_strings "https://github.com/saif-pixel1/leetcode/tree/main/1768-merge-strings-alternately"
click node_almost_equal "https://github.com/saif-pixel1/leetcode/tree/main/1790-check-if-one-string-swap-can-make-strings-equal"
click node_first_palindrome "https://github.com/saif-pixel1/leetcode/tree/main/2108-find-first-palindromic-string-in-the-array"
click node_append_subsequence "https://github.com/saif-pixel1/leetcode/tree/main/2486-append-characters-to-string-to-make-subsequence"
click node_smallest_palindrome "https://github.com/saif-pixel1/leetcode/tree/main/2697-lexicographically-smallest-palindrome"
click node_count_pairs "https://github.com/saif-pixel1/leetcode/tree/main/2824-count-pairs-whose-sum-is-less-than-target"
click node_palindrome_number "https://github.com/saif-pixel1/leetcode/tree/main/0009-palindrome-number"

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_three_sum,node_sort_colors,node_merge_sorted,node_two_sum_sorted,node_majority_element,node_max_ones,node_set_mismatch,node_pivot_index,node_monotonic_array,node_sort_parity,node_sort_parity_ii,node_sorted_squares,node_running_sum,node_highest_altitude,node_count_pairs toneBlue
class node_valid_palindrome,node_reverse_words,node_reverse_string,node_reverse_string_ii,node_reverse_words_iii,node_palindrome_delete,node_remove_pal_subseq,node_merge_strings,node_almost_equal,node_first_palindrome,node_append_subsequence,node_smallest_palindrome toneAmber
class node_plus_one,node_even_digits,node_palindrome_number toneMint
class node_pascals_triangle,node_pascals_row,node_stock_profit toneRose
```

## Components

### Array Algorithms

- [Two Sum](https://github.com/saif-pixel1/leetcode/tree/main/0001-two-sum): `0001-two-sum`
- [3Sum](https://github.com/saif-pixel1/leetcode/tree/main/0015-3sum): `0015-3sum`
- [Sort Colors](https://github.com/saif-pixel1/leetcode/tree/main/0075-sort-colors): `0075-sort-colors`
- [Merge Sorted Array](https://github.com/saif-pixel1/leetcode/tree/main/0088-merge-sorted-array): `0088-merge-sorted-array`
- [Sorted Two Sum](https://github.com/saif-pixel1/leetcode/tree/main/0167-two-sum-ii-input-array-is-sorted): `0167-two-sum-ii-input-array-is-sorted`
- [Majority Element](https://github.com/saif-pixel1/leetcode/tree/main/0169-majority-element): `0169-majority-element`
- [Max Consecutive Ones](https://github.com/saif-pixel1/leetcode/tree/main/0485-max-consecutive-ones): `0485-max-consecutive-ones`
- [Set Mismatch](https://github.com/saif-pixel1/leetcode/tree/main/0645-set-mismatch): `0645-set-mismatch`
- [Pivot Index](https://github.com/saif-pixel1/leetcode/tree/main/0724-find-pivot-index): `0724-find-pivot-index`
- [Monotonic Array](https://github.com/saif-pixel1/leetcode/tree/main/0896-monotonic-array): `0896-monotonic-array`
- [Sort By Parity](https://github.com/saif-pixel1/leetcode/tree/main/0905-sort-array-by-parity): `0905-sort-array-by-parity`
- [Sort By Parity II](https://github.com/saif-pixel1/leetcode/tree/main/0922-sort-array-by-parity-ii): `0922-sort-array-by-parity-ii`
- [Sorted Squares](https://github.com/saif-pixel1/leetcode/tree/main/0977-squares-of-a-sorted-array): `0977-squares-of-a-sorted-array`
- [Running Sum](https://github.com/saif-pixel1/leetcode/tree/main/1480-running-sum-of-1d-array): `1480-running-sum-of-1d-array`
- [Highest Altitude](https://github.com/saif-pixel1/leetcode/tree/main/1732-find-the-highest-altitude): `1732-find-the-highest-altitude`
- [Count Small-Sum Pairs](https://github.com/saif-pixel1/leetcode/tree/main/2824-count-pairs-whose-sum-is-less-than-target): `2824-count-pairs-whose-sum-is-less-than-target`

### String Algorithms

- [Valid Palindrome](https://github.com/saif-pixel1/leetcode/tree/main/0125-valid-palindrome): `0125-valid-palindrome`
- [Reverse Words](https://github.com/saif-pixel1/leetcode/tree/main/0151-reverse-words-in-a-string): `0151-reverse-words-in-a-string`
- [Reverse String](https://github.com/saif-pixel1/leetcode/tree/main/0344-reverse-string): `0344-reverse-string`
- [Reverse String II](https://github.com/saif-pixel1/leetcode/tree/main/0541-reverse-string-ii): `0541-reverse-string-ii`
- [Reverse Words III](https://github.com/saif-pixel1/leetcode/tree/main/0557-reverse-words-in-a-string-iii): `0557-reverse-words-in-a-string-iii`
- [Palindrome With Deletion](https://github.com/saif-pixel1/leetcode/tree/main/0680-valid-palindrome-ii): `0680-valid-palindrome-ii`
- [Remove Palindromic Subsequences](https://github.com/saif-pixel1/leetcode/tree/main/1332-remove-palindromic-subsequences): `1332-remove-palindromic-subsequences`
- [Merge Strings](https://github.com/saif-pixel1/leetcode/tree/main/1768-merge-strings-alternately): `1768-merge-strings-alternately`
- [Almost Equal Strings](https://github.com/saif-pixel1/leetcode/tree/main/1790-check-if-one-string-swap-can-make-strings-equal): `1790-check-if-one-string-swap-can-make-strings-equal`
- [First Palindrome](https://github.com/saif-pixel1/leetcode/tree/main/2108-find-first-palindromic-string-in-the-array): `2108-find-first-palindromic-string-in-the-array`
- [Append For Subsequence](https://github.com/saif-pixel1/leetcode/tree/main/2486-append-characters-to-string-to-make-subsequence): `2486-append-characters-to-string-to-make-subsequence`
- [Smallest Palindrome](https://github.com/saif-pixel1/leetcode/tree/main/2697-lexicographically-smallest-palindrome): `2697-lexicographically-smallest-palindrome`

### Math Algorithms

- [Plus One](https://github.com/saif-pixel1/leetcode/tree/main/0066-plus-one): `0066-plus-one`
- [Even Digit Count](https://github.com/saif-pixel1/leetcode/tree/main/1295-find-numbers-with-even-number-of-digits): `1295-find-numbers-with-even-number-of-digits`
- [Palindrome Number](https://github.com/saif-pixel1/leetcode/tree/main/0009-palindrome-number): `0009-palindrome-number`

### Dynamic Programming

- [Pascal Triangle](https://github.com/saif-pixel1/leetcode/tree/main/0118-pascals-triangle): `0118-pascals-triangle`
- [Pascal Row](https://github.com/saif-pixel1/leetcode/tree/main/0119-pascals-triangle-ii): `0119-pascals-triangle-ii`
- [Stock Profit](https://github.com/saif-pixel1/leetcode/tree/main/0121-best-time-to-buy-and-sell-stock): `0121-best-time-to-buy-and-sell-stock`
