# yeswanthsrip/leetcode-gfg-solutions architecture

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

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

## Overview

This repository is a collection of standalone Java solutions to GeeksforGeeks and LeetCode problems, also organized by algorithmic pattern. The user supplies problem inputs to an individual solution method, which computes and returns a result or mutates an input array. There is no shared application runtime, dispatcher, persistence layer, or integration workflow. The graph groups related solution families; shown relationships are limited to duplicated problem implementations confirmed by matching excerpts. Other solutions are independent, and the README is empty.

Main entry points: [`GeeksforGeeks/Java/Medium/Infix to Postfix/Solution.java`](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Medium/Infix%20to%20Postfix/Solution.java) (Infix conversion), [`GeeksforGeeks/Java/Medium/Sort according to an Array/Solution.java`](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Medium/Sort%20according%20to%20an%20Array/Solution.java) (Relative sorting), [`GeeksforGeeks/Java/Medium/Sort According to Another Array/Solution.java`](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Medium/Sort%20According%20to%20Another%20Array/Solution.java) (Alternate relative sort), [`LeetCode/Java/Easy/1306. Minimum Absolute Difference/Solution.java`](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Java/Easy/1306.%20Minimum%20Absolute%20Difference/Solution.java) (Difference pairs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gfg_arrays["GeeksforGeeks arrays"]
  node_gfg_arr["Array solutions<br/>[Solution.java]"]
  node_gfg_window["Window solutions<br/>[Solution.java]"]
  node_gfg_subarray["Subarray solutions<br/>[Solution.java]"]
  node_gfg_platforms["Platform scheduling<br/>[Solution.java]"]
  node_gfg_candy["Candy allocation<br/>[Solution.java]"]
end

subgraph group_gfg_strings["GeeksforGeeks strings"]
  node_gfg_strings["String solutions<br/>[Solution.java]"]
  node_gfg_distinct["Distinct substrings<br/>[Solution.java]"]
  node_gfg_endchars["Matching-end substrings<br/>[Solution.java]"]
end

subgraph group_gfg_ordering["GeeksforGeeks ordering"]
  node_gfg_postfix["Infix conversion<br/>[Solution.java]"]
  node_gfg_relative["Relative sorting<br/>[Solution.java]"]
  node_gfg_relative_alt["Alternate relative sort<br/>[Solution.java]"]
  node_gfg_pattern_postfix["Pattern postfix solution<br/>[Solution.java]"]
  node_gfg_pattern_relative["Pattern relative sort<br/>[Solution.java]"]
  node_gfg_pattern_relative_alt["Pattern alternate sort<br/>[Solution.java]"]
end

subgraph group_leetcode_arrays["LeetCode arrays"]
  node_lc_arrayform["Array-form addition<br/>[Solution.java]"]
  node_lc_abs["Minimum differences<br/>[Solution.java]"]
  node_lc_abs_alt["Difference pairs<br/>[Solution.java]"]
  node_lc_window["Distinct window sum<br/>[Solution.java]"]
  node_lc_pattern_window["Pattern window sum<br/>[Solution.java]"]
end

subgraph group_leetcode_strings["LeetCode strings"]
  node_lc_isomorphic["Isomorphic strings<br/>[Solution.java]"]
  node_lc_pattern_isomorphic["Pattern isomorphic strings<br/>[Solution.java]"]
  node_lc_distinct["Unique-character window<br/>[Solution.java]"]
  node_lc_endchars["Matching-end substrings<br/>[Solution.java]"]
end

subgraph group_leetcode_other["LeetCode other"]
  node_lc_other["Other problem solutions<br/>[Solution.java]"]
end

node_actor(("Problem caller"))

node_actor -.->|"calls method"| node_gfg_arr
node_actor -.->|"calls method"| node_gfg_window
node_actor -.->|"calls method"| node_gfg_subarray
node_actor -.->|"calls method"| node_gfg_platforms
node_actor -.->|"calls method"| node_gfg_candy
node_actor -.->|"calls method"| node_gfg_strings
node_actor -.->|"calls method"| node_gfg_distinct
node_actor -.->|"calls method"| node_gfg_endchars
node_actor -.->|"calls method"| node_gfg_postfix
node_actor -.->|"calls method"| node_gfg_relative
node_actor -.->|"calls method"| node_gfg_relative_alt
node_actor -.->|"calls method"| node_gfg_pattern_postfix
node_actor -.->|"calls method"| node_gfg_pattern_relative
node_actor -.->|"calls method"| node_gfg_pattern_relative_alt
node_actor -.->|"calls method"| node_lc_arrayform
node_actor -.->|"calls method"| node_lc_abs
node_actor -.->|"calls method"| node_lc_abs_alt
node_actor -.->|"calls method"| node_lc_window
node_actor -.->|"calls method"| node_lc_pattern_window
node_actor -.->|"calls method"| node_lc_isomorphic
node_actor -.->|"calls method"| node_lc_pattern_isomorphic
node_actor -.->|"calls method"| node_lc_distinct
node_actor -.->|"calls method"| node_lc_endchars
node_actor -.->|"calls method"| node_lc_other
node_gfg_postfix -->|"duplicates logic"| node_gfg_pattern_postfix
node_gfg_relative -->|"duplicates logic"| node_gfg_pattern_relative
node_gfg_relative_alt -->|"duplicates logic"| node_gfg_pattern_relative_alt
node_lc_window -->|"duplicates logic"| node_lc_pattern_window
node_lc_isomorphic -->|"duplicates logic"| node_lc_pattern_isomorphic
node_lc_abs_alt -->|"duplicates logic"| node_lc_abs

click node_gfg_arr "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Easy/Second%20Largest/Solution.java"
click node_gfg_window "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Easy/Smallest%20window%20containing%200%201%20and%202/Solution.java"
click node_gfg_subarray "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Medium/Max%20Sum%20Subarray%20of%20Non-Negative/Solution.java"
click node_gfg_platforms "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Medium/Minimum%20Platforms/Solution.java"
click node_gfg_candy "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Hard/Minimum%20Candy%20Distribution/Solution.java"
click node_gfg_strings "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Easy/Reverse%20Words/Solution.java"
click node_gfg_distinct "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Medium/Longest%20Substring%20with%20Distinct%20Characters/Solution.java"
click node_gfg_endchars "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Easy/Substrings%20with%20same%20first%20and%20last%20characters/Solution.java"
click node_gfg_postfix "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Medium/Infix%20to%20Postfix/Solution.java"
click node_gfg_relative "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Medium/Sort%20according%20to%20an%20Array/Solution.java"
click node_gfg_relative_alt "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Medium/Sort%20According%20to%20Another%20Array/Solution.java"
click node_gfg_pattern_postfix "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Patterns/Stack%20%26%20Queue/Infix%20to%20Postfix/Solution.java"
click node_gfg_pattern_relative "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Patterns/Sorting/Sort%20according%20to%20an%20Array/Solution.java"
click node_gfg_pattern_relative_alt "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Patterns/Sorting/Sort%20According%20to%20Another%20Array/Solution.java"
click node_lc_arrayform "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Java/Easy/1031.%20Add%20to%20Array-Form%20of%20Integer/Solution.java"
click node_lc_abs "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Java/Easy/1200.%20Minimum%20Absolute%20Difference/Solution.java"
click node_lc_abs_alt "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Java/Easy/1306.%20Minimum%20Absolute%20Difference/Solution.java"
click node_lc_window "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Java/Medium/2552.%20Maximum%20Sum%20of%20Distinct%20Subarrays%20With%20Length%20K/Solution.java"
click node_lc_pattern_window "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Patterns/Sliding%20Window/2552.%20Maximum%20Sum%20of%20Distinct%20Subarrays%20With%20Length%20K/Solution.java"
click node_lc_isomorphic "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Java/Easy/205.%20Isomorphic%20Strings/Solution.java"
click node_lc_pattern_isomorphic "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Patterns/Hash%20Map%20%26%20Hashing/205.%20Isomorphic%20Strings/Solution.java"
click node_lc_distinct "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Java/Medium/3.%20Longest%20Substring%20Without%20Repeating%20Characters/Solution.java"
click node_lc_endchars "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Java/Medium/3084.%20Count%20Substrings%20Starting%20and%20Ending%20with%20Given%20Character/Solution.java"
click node_lc_other "https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Java/Easy/258.%20Add%20Digits/Solution.java"

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_gfg_arr,node_gfg_window,node_gfg_subarray,node_gfg_platforms,node_gfg_candy toneBlue
class node_gfg_strings,node_gfg_distinct,node_gfg_endchars toneAmber
class node_gfg_postfix,node_gfg_relative,node_gfg_relative_alt,node_gfg_pattern_postfix,node_gfg_pattern_relative,node_gfg_pattern_relative_alt toneMint
class node_lc_arrayform,node_lc_abs,node_lc_abs_alt,node_lc_window,node_lc_pattern_window toneRose
class node_lc_isomorphic,node_lc_pattern_isomorphic,node_lc_distinct,node_lc_endchars,node_actor toneIndigo
class node_lc_other toneTeal
```

## Components

### GeeksforGeeks arrays

- [Array solutions](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Easy/Second%20Largest/Solution.java): `GeeksforGeeks/Java/Easy/Second Largest/Solution.java`
- [Window solutions](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Easy/Smallest%20window%20containing%200%201%20and%202/Solution.java): `GeeksforGeeks/Java/Easy/Smallest window containing 0 1 and 2/Solution.java`
- [Subarray solutions](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Medium/Max%20Sum%20Subarray%20of%20Non-Negative/Solution.java): `GeeksforGeeks/Java/Medium/Max Sum Subarray of Non-Negative/Solution.java`
- [Platform scheduling](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Medium/Minimum%20Platforms/Solution.java): `GeeksforGeeks/Java/Medium/Minimum Platforms/Solution.java`
- [Candy allocation](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Hard/Minimum%20Candy%20Distribution/Solution.java): `GeeksforGeeks/Java/Hard/Minimum Candy Distribution/Solution.java`

### GeeksforGeeks strings

- [String solutions](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Easy/Reverse%20Words/Solution.java): `GeeksforGeeks/Java/Easy/Reverse Words/Solution.java`
- [Distinct substrings](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Medium/Longest%20Substring%20with%20Distinct%20Characters/Solution.java): `GeeksforGeeks/Java/Medium/Longest Substring with Distinct Characters/Solution.java`
- [Matching-end substrings](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Easy/Substrings%20with%20same%20first%20and%20last%20characters/Solution.java): `GeeksforGeeks/Java/Easy/Substrings with same first and last characters/Solution.java`

### GeeksforGeeks ordering

- [Infix conversion](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Medium/Infix%20to%20Postfix/Solution.java): `GeeksforGeeks/Java/Medium/Infix to Postfix/Solution.java`
- [Relative sorting](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Medium/Sort%20according%20to%20an%20Array/Solution.java): `GeeksforGeeks/Java/Medium/Sort according to an Array/Solution.java`
- [Alternate relative sort](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Java/Medium/Sort%20According%20to%20Another%20Array/Solution.java): `GeeksforGeeks/Java/Medium/Sort According to Another Array/Solution.java`
- [Pattern postfix solution](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Patterns/Stack%20%26%20Queue/Infix%20to%20Postfix/Solution.java): `GeeksforGeeks/Patterns/Stack & Queue/Infix to Postfix/Solution.java`
- [Pattern relative sort](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Patterns/Sorting/Sort%20according%20to%20an%20Array/Solution.java): `GeeksforGeeks/Patterns/Sorting/Sort according to an Array/Solution.java`
- [Pattern alternate sort](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/GeeksforGeeks/Patterns/Sorting/Sort%20According%20to%20Another%20Array/Solution.java): `GeeksforGeeks/Patterns/Sorting/Sort According to Another Array/Solution.java`

### LeetCode arrays

- [Array-form addition](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Java/Easy/1031.%20Add%20to%20Array-Form%20of%20Integer/Solution.java): `LeetCode/Java/Easy/1031. Add to Array-Form of Integer/Solution.java`
- [Minimum differences](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Java/Easy/1200.%20Minimum%20Absolute%20Difference/Solution.java): `LeetCode/Java/Easy/1200. Minimum Absolute Difference/Solution.java`
- [Difference pairs](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Java/Easy/1306.%20Minimum%20Absolute%20Difference/Solution.java): `LeetCode/Java/Easy/1306. Minimum Absolute Difference/Solution.java`
- [Distinct window sum](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Java/Medium/2552.%20Maximum%20Sum%20of%20Distinct%20Subarrays%20With%20Length%20K/Solution.java): `LeetCode/Java/Medium/2552. Maximum Sum of Distinct Subarrays With Length K/Solution.java`
- [Pattern window sum](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Patterns/Sliding%20Window/2552.%20Maximum%20Sum%20of%20Distinct%20Subarrays%20With%20Length%20K/Solution.java): `LeetCode/Patterns/Sliding Window/2552. Maximum Sum of Distinct Subarrays With Length K/Solution.java`

### LeetCode strings

- [Isomorphic strings](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Java/Easy/205.%20Isomorphic%20Strings/Solution.java): `LeetCode/Java/Easy/205. Isomorphic Strings/Solution.java`
- [Pattern isomorphic strings](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Patterns/Hash%20Map%20%26%20Hashing/205.%20Isomorphic%20Strings/Solution.java): `LeetCode/Patterns/Hash Map & Hashing/205. Isomorphic Strings/Solution.java`
- [Unique-character window](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Java/Medium/3.%20Longest%20Substring%20Without%20Repeating%20Characters/Solution.java): `LeetCode/Java/Medium/3. Longest Substring Without Repeating Characters/Solution.java`
- [Matching-end substrings](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Java/Medium/3084.%20Count%20Substrings%20Starting%20and%20Ending%20with%20Given%20Character/Solution.java): `LeetCode/Java/Medium/3084. Count Substrings Starting and Ending with Given Character/Solution.java`

### LeetCode other

- [Other problem solutions](https://github.com/yeswanthsrip/leetcode-gfg-solutions/blob/main/LeetCode/Java/Easy/258.%20Add%20Digits/Solution.java): `LeetCode/Java/Easy/258. Add Digits/Solution.java`

### Other components

- **Problem caller**

## Connections

- Problem caller → Array solutions: calls method
- Problem caller → Window solutions: calls method
- Problem caller → Subarray solutions: calls method
- Problem caller → Platform scheduling: calls method
- Problem caller → Candy allocation: calls method
- Problem caller → String solutions: calls method
- Problem caller → Distinct substrings: calls method
- Problem caller → Matching-end substrings: calls method
- Problem caller → Infix conversion: calls method
- Problem caller → Relative sorting: calls method
- Problem caller → Alternate relative sort: calls method
- Problem caller → Pattern postfix solution: calls method
- Problem caller → Pattern relative sort: calls method
- Problem caller → Pattern alternate sort: calls method
- Problem caller → Array-form addition: calls method
- Problem caller → Minimum differences: calls method
- Problem caller → Difference pairs: calls method
- Problem caller → Distinct window sum: calls method
- Problem caller → Pattern window sum: calls method
- Problem caller → Isomorphic strings: calls method
- Problem caller → Pattern isomorphic strings: calls method
- Problem caller → Unique-character window: calls method
- Problem caller → Matching-end substrings: calls method
- Problem caller → Other problem solutions: calls method
- Infix conversion → Pattern postfix solution: duplicates logic (evidence: `GeeksforGeeks/Patterns/Stack & Queue/Infix to Postfix/Solution.java`)
- Relative sorting → Pattern relative sort: duplicates logic (evidence: `GeeksforGeeks/Patterns/Sorting/Sort according to an Array/Solution.java`)
- Alternate relative sort → Pattern alternate sort: duplicates logic (evidence: `GeeksforGeeks/Patterns/Sorting/Sort According to Another Array/Solution.java`)
- Distinct window sum → Pattern window sum: duplicates logic (evidence: `LeetCode/Patterns/Sliding Window/2552. Maximum Sum of Distinct Subarrays With Length K/Solution.java`)
- Isomorphic strings → Pattern isomorphic strings: duplicates logic (evidence: `LeetCode/Patterns/Hash Map & Hashing/205. Isomorphic Strings/Solution.java`)
- Difference pairs → Minimum differences: duplicates logic (evidence: `LeetCode/Java/Easy/1306. Minimum Absolute Difference/Solution.java`)
