# krishnatiwari005/data-structure-and-algorithm architecture

> Architecture diagram of the GitHub repository krishnatiwari005/data-structure-and-algorithm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/krishnatiwari005/data-structure-and-algorithm
- Repository: https://github.com/krishnatiwari005/data-structure-and-algorithm

## Overview

This repository is a collection of independent C++ LeetCode solutions, not a single application: a caller supplies problem-specific inputs to a solution method and receives its result. The sampled files show array/search, string transformation, and numeric or combinatorial algorithms. Each solution implements its own logic; there is no shared runtime pipeline or persistent state. The graph samples these independent entry points rather than enumerating the full collection. Source excerpts were sampled, so relationships among unsampled solutions are not inferred.

Main entry points: [`0033-search-in-rotated-sorted-array/0033-search-in-rotated-sorted-array.cpp`](https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/0033-search-in-rotated-sorted-array/0033-search-in-rotated-sorted-array.cpp) (Rotated search), [`3912-valid-elements-in-an-array/3912-valid-elements-in-an-array.cpp`](https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/3912-valid-elements-in-an-array/3912-valid-elements-in-an-array.cpp) (Valid elements), [`2091-removing-minimum-and-maximum-from-array/2091-removing-minimum-and-maximum-from-array.cpp`](https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/2091-removing-minimum-and-maximum-from-array/2091-removing-minimum-and-maximum-from-array.cpp) (Minimum deletions), [`1658-minimum-operations-to-reduce-x-to-zero/1658-minimum-operations-to-reduce-x-to-zero.cpp`](https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/1658-minimum-operations-to-reduce-x-to-zero/1658-minimum-operations-to-reduce-x-to-zero.cpp) (Reduce x)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_arrays["Arrays and Search"]
  node_rotated_search["Rotated search"]
  node_valid_elements["Valid elements"]
  node_min_deletions["Minimum deletions"]
  node_reduce_x["Reduce x"]
  node_decrypt["Decrypt circular code"]
  node_product_difference["Product difference"]
end

subgraph group_strings["String Algorithms"]
  node_interpret["Goal interpretation"]
  node_similar_pairs["Similar string pairs"]
  node_palindrome["Palindrome rearrangement"]
end

subgraph group_numeric["Numeric and Combinatorial"]
  node_even_numbers["Even numbers"]
  node_unique_even["Unique even totals"]
  node_diagonal_prime["Diagonal prime"]
end

node_caller(("Solution caller"))

node_caller -->|"calls"| node_rotated_search
node_rotated_search -->|"returns index"| node_caller
node_caller -->|"calls"| node_valid_elements
node_valid_elements -->|"returns elements"| node_caller
node_caller -->|"calls"| node_min_deletions
node_min_deletions -->|"returns count"| node_caller
node_caller -->|"calls"| node_reduce_x
node_reduce_x -->|"returns count"| node_caller
node_caller -->|"calls"| node_decrypt
node_decrypt -->|"returns array"| node_caller
node_caller -->|"calls"| node_product_difference
node_product_difference -->|"returns value"| node_caller
node_caller -->|"calls"| node_interpret
node_interpret -->|"returns string"| node_caller
node_caller -->|"calls"| node_similar_pairs
node_similar_pairs -->|"returns count"| node_caller
node_caller -->|"calls"| node_palindrome
node_palindrome -->|"returns string"| node_caller
node_caller -->|"calls"| node_even_numbers
node_even_numbers -->|"returns numbers"| node_caller
node_caller -->|"calls"| node_unique_even
node_unique_even -->|"returns count"| node_caller
node_caller -->|"calls"| node_diagonal_prime
node_diagonal_prime -->|"returns prime"| node_caller

click node_rotated_search "https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/0033-search-in-rotated-sorted-array/0033-search-in-rotated-sorted-array.cpp"
click node_valid_elements "https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/3912-valid-elements-in-an-array/3912-valid-elements-in-an-array.cpp"
click node_min_deletions "https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/2091-removing-minimum-and-maximum-from-array/2091-removing-minimum-and-maximum-from-array.cpp"
click node_reduce_x "https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/1658-minimum-operations-to-reduce-x-to-zero/1658-minimum-operations-to-reduce-x-to-zero.cpp"
click node_decrypt "https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/1652-defuse-the-bomb/1652-defuse-the-bomb.cpp"
click node_product_difference "https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/1913-maximum-product-difference-between-two-pairs/1913-maximum-product-difference-between-two-pairs.cpp"
click node_interpret "https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/1678-goal-parser-interpretation/1678-goal-parser-interpretation.cpp"
click node_similar_pairs "https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/2506-count-pairs-of-similar-strings/2506-count-pairs-of-similar-strings.cpp"
click node_palindrome "https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/3517-smallest-palindromic-rearrangement-i/3517-smallest-palindromic-rearrangement-i.cpp"
click node_even_numbers "https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/2094-finding-3-digit-even-numbers/2094-finding-3-digit-even-numbers.cpp"
click node_unique_even "https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/3483-unique-3-digit-even-numbers/3483-unique-3-digit-even-numbers.cpp"
click node_diagonal_prime "https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/2614-prime-in-diagonal/2614-prime-in-diagonal.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_rotated_search,node_valid_elements,node_min_deletions,node_reduce_x,node_decrypt,node_product_difference toneBlue
class node_interpret,node_similar_pairs,node_palindrome toneAmber
class node_even_numbers,node_unique_even,node_diagonal_prime toneMint
class node_caller toneIndigo
```

## Components

### Arrays and Search

- [Rotated search](https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/0033-search-in-rotated-sorted-array/0033-search-in-rotated-sorted-array.cpp): `0033-search-in-rotated-sorted-array/0033-search-in-rotated-sorted-array.cpp`
- [Valid elements](https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/3912-valid-elements-in-an-array/3912-valid-elements-in-an-array.cpp): `3912-valid-elements-in-an-array/3912-valid-elements-in-an-array.cpp`
- [Minimum deletions](https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/2091-removing-minimum-and-maximum-from-array/2091-removing-minimum-and-maximum-from-array.cpp): `2091-removing-minimum-and-maximum-from-array/2091-removing-minimum-and-maximum-from-array.cpp`
- [Reduce x](https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/1658-minimum-operations-to-reduce-x-to-zero/1658-minimum-operations-to-reduce-x-to-zero.cpp): `1658-minimum-operations-to-reduce-x-to-zero/1658-minimum-operations-to-reduce-x-to-zero.cpp`
- [Decrypt circular code](https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/1652-defuse-the-bomb/1652-defuse-the-bomb.cpp): `1652-defuse-the-bomb/1652-defuse-the-bomb.cpp`
- [Product difference](https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/1913-maximum-product-difference-between-two-pairs/1913-maximum-product-difference-between-two-pairs.cpp): `1913-maximum-product-difference-between-two-pairs/1913-maximum-product-difference-between-two-pairs.cpp`

### String Algorithms

- [Goal interpretation](https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/1678-goal-parser-interpretation/1678-goal-parser-interpretation.cpp): `1678-goal-parser-interpretation/1678-goal-parser-interpretation.cpp`
- [Similar string pairs](https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/2506-count-pairs-of-similar-strings/2506-count-pairs-of-similar-strings.cpp): `2506-count-pairs-of-similar-strings/2506-count-pairs-of-similar-strings.cpp`
- [Palindrome rearrangement](https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/3517-smallest-palindromic-rearrangement-i/3517-smallest-palindromic-rearrangement-i.cpp): `3517-smallest-palindromic-rearrangement-i/3517-smallest-palindromic-rearrangement-i.cpp`

### Numeric and Combinatorial

- [Even numbers](https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/2094-finding-3-digit-even-numbers/2094-finding-3-digit-even-numbers.cpp): `2094-finding-3-digit-even-numbers/2094-finding-3-digit-even-numbers.cpp`
- [Unique even totals](https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/3483-unique-3-digit-even-numbers/3483-unique-3-digit-even-numbers.cpp): `3483-unique-3-digit-even-numbers/3483-unique-3-digit-even-numbers.cpp`
- [Diagonal prime](https://github.com/krishnatiwari005/data-structure-and-algorithm/blob/main/2614-prime-in-diagonal/2614-prime-in-diagonal.cpp): `2614-prime-in-diagonal/2614-prime-in-diagonal.cpp`

### Other components

- **Solution caller**

## Connections

- Solution caller → Rotated search: calls
- Rotated search → Solution caller: returns index
- Solution caller → Valid elements: calls
- Valid elements → Solution caller: returns elements
- Solution caller → Minimum deletions: calls
- Minimum deletions → Solution caller: returns count
- Solution caller → Reduce x: calls
- Reduce x → Solution caller: returns count
- Solution caller → Decrypt circular code: calls
- Decrypt circular code → Solution caller: returns array
- Solution caller → Product difference: calls
- Product difference → Solution caller: returns value
- Solution caller → Goal interpretation: calls
- Goal interpretation → Solution caller: returns string
- Solution caller → Similar string pairs: calls
- Similar string pairs → Solution caller: returns count
- Solution caller → Palindrome rearrangement: calls
- Palindrome rearrangement → Solution caller: returns string
- Solution caller → Even numbers: calls
- Even numbers → Solution caller: returns numbers
- Solution caller → Unique even totals: calls
- Unique even totals → Solution caller: returns count
- Solution caller → Diagonal prime: calls
- Diagonal prime → Solution caller: returns prime
