# nerdylua/leetcode-solutions architecture

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

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

## Overview

##### Main Components Structure

**[Solution Collection]**

- [Categories]

- [Problems]

##### Category Organization

**Algorithm Types (Blue)**
- Math
- Array Manipulation
- String Processing
- Dynamic Programming

**Data Structures (Green)**
- Hash Table
- Tree
- Stack/Queue
- Graph

**Techniques (Orange)**
- Sliding Window
- Two Pointers
- Bit Manipulation
- Binary Search

##### Detailed Component Representation

a) Problem Nodes:
- Problem ID
- Problem Name
- Main Categories (tags)
- Solution Language (C++/C#)

b) Category Connections:
- Line thickness indicating the strength of relationship

##### Cross-Reference Visualization

**[Problem ID] → [Categories Used]**
- ↓
**[Implementation Details]**

**◆ Primary Category**
**◇ Secondary Category**
**→ Direct Relationship**
**⇢ Indirect Relationship**

##### Specific Design Elements

a) Top Level:
**[Master Collection]**

**[Category Index]**

**[Problem Groups]**

b) Category Relationships:
**[Math] ←→ [Dynamic Programming]**
- ↓         ↓
**[Problems] [Problems]**

c) Problem Details:
- ID: XXXX
- Name: Problem Name
- Categories: [Primary] [Secondary]
- Solution: C++/C#

##### Implementation strategy selection

Remember to maintain clarity while showing the complexity of relationships between different programming concepts and their implementations.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Legend
        L1[Rectangle: Problem]
        L2[(Circle: Category)]
        L3[[Rounded: Technique]]
        style L1 fill:#f9f,stroke:#333
        style L2 fill:#bbf,stroke:#333
        style L3 fill:#fb9,stroke:#333
    end

    Root["Solution Collection"]
    click Root "https://github.com/nerdylua/Leetcode-solutions/blob/main/README.md"
    Stats["Statistics Tracker"]
    click Stats "https://github.com/nerdylua/Leetcode-solutions/blob/main/stats.json"

    Root --> Stats
    Root --> Categories

    subgraph Categories
        DSA[(Data Structures & Algorithms)]
        
        subgraph DataStructures
            Trees[(Tree Operations)]
            click Trees "https://github.com/nerdylua/Leetcode-solutions/tree/main/0515-find-largest-value-in-each-tree-row"
            Strings[(String Processing)]
            click Strings "https://github.com/nerdylua/Leetcode-solutions/tree/main/0242-valid-anagram"
            Arrays[(Array Manipulation)]
            click Arrays "https://github.com/nerdylua/Leetcode-solutions/tree/main/0217-contains-duplicate"
        end

        subgraph Techniques
            BitMan[[Bit Manipulation]]
            click BitMan "https://github.com/nerdylua/Leetcode-solutions/tree/main/1667-find-kth-bit-in-nth-binary-string"
            SlidingWin[[Sliding Window]]
            click SlidingWin "https://github.com/nerdylua/Leetcode-solutions/tree/main/0567-permutation-in-string"
        end

        DSA --> DataStructures
        DSA --> Techniques
    end

    subgraph Problems
        %% Tree Problems
        Tree1["0515: Largest Value in Tree Row"]
        click Tree1 "https://github.com/nerdylua/Leetcode-solutions/tree/main/0515-find-largest-value-in-each-tree-row"
        Tree2["0988: Flip Equivalent Trees"]
        click Tree2 "https://github.com/nerdylua/Leetcode-solutions/tree/main/0988-flip-equivalent-binary-trees"
        Tree3["2493: Reverse Odd Levels"]
        click Tree3 "https://github.com/nerdylua/Leetcode-solutions/tree/main/2493-reverse-odd-levels-of-binary-tree"
        Tree4["2677: Cousins in Binary Tree II"]
        click Tree4 "https://github.com/nerdylua/Leetcode-solutions/tree/main/2677-cousins-in-binary-tree-ii"

        %% String Problems
        Str1["0242: Valid Anagram"]
        click Str1 "https://github.com/nerdylua/Leetcode-solutions/tree/main/0242-valid-anagram"
        Str2["0812: Rotate String"]
        click Str2 "https://github.com/nerdylua/Leetcode-solutions/tree/main/0812-rotate-string"
        Str3["1302: Delete Fancy String"]
        click Str3 "https://github.com/nerdylua/Leetcode-solutions/tree/main/1302-delete-characters-to-make-fancy-string"
        Str4["2232: Adding Spaces"]
        click Str4 "https://github.com/nerdylua/Leetcode-solutions/tree/main/2232-adding-spaces-to-a-string"

        %% Array Problems
        Arr1["0217: Contains Duplicate"]
        click Arr1 "https://github.com/nerdylua/Leetcode-solutions/tree/main/0217-contains-duplicate"
        Arr2["1256: Rank Transform"]
        click Arr2 "https://github.com/nerdylua/Leetcode-solutions/tree/main/1256-rank-transform-of-an-array"
        Arr3["2358: Split Array Ways"]
        click Arr3 "https://github.com/nerdylua/Leetcode-solutions/tree/main/2358-number-of-ways-to-split-array"

        %% Bit Manipulation Problems
        Bit1["1667: Kth Bit in Nth String"]
        click Bit1 "https://github.com/nerdylua/Leetcode-solutions/tree/main/1667-find-kth-bit-in-nth-binary-string"
        Bit2["1940: Maximum XOR Query"]
        click Bit2 "https://github.com/nerdylua/Leetcode-solutions/tree/main/1940-maximum-xor-for-each-query"
        Bit3["2170: Maximum Bitwise OR"]
        click Bit3 "https://github.com/nerdylua/Leetcode-solutions/tree/main/2170-count-number-of-maximum-bitwise-or-subsets"

        %% Sliding Window Problems
        SW1["0567: Permutation in String"]
        click SW1 "https://github.com/nerdylua/Leetcode-solutions/tree/main/0567-permutation-in-string"
        SW2["2552: Max Sum Distinct Subarrays"]
        click SW2 "https://github.com/nerdylua/Leetcode-solutions/tree/main/2552-maximum-sum-of-distinct-subarrays-with-length-k"
    end

    Trees --> Tree1
    Trees --> Tree2
    Trees --> Tree3
    Trees --> Tree4

    Strings --> Str1
    Strings --> Str2
    Strings --> Str3
    Strings --> Str4

    Arrays --> Arr1
    Arrays --> Arr2
    Arrays --> Arr3

    BitMan --> Bit1
    BitMan --> Bit2
    BitMan --> Bit3

    SlidingWin --> SW1
    SlidingWin --> SW2

    classDef default fill:#f9f,stroke:#333,stroke-width:2px
    classDef category fill:#bbf,stroke:#333,stroke-width:2px
    classDef technique fill:#fb9,stroke:#333,stroke-width:2px
    class Tree1,Tree2,Tree3,Tree4,Str1,Str2,Str3,Str4,Arr1,Arr2,Arr3,Bit1,Bit2,Bit3,SW1,SW2 default
    class Trees,Strings,Arrays category
    class BitMan,SlidingWin technique
```
