How techwhiz42/leetcode-submissions works
1. Repository purpose
- This is not a single application; it is a catalog of independent LeetCode submissions.
- Each numbered folder is a self-contained solution package for one problem, usually with one C++ source file and one problem-specific README.
2. Top-level structure
- The repo root contains:
- many problem directories such as 0001-two-sum, 0208-implement-trie-prefix-tree, 2685-count-the-number-of-complete-components
- a root README.md that acts as an index and topic catalog
- stats.json, likely generated metadata about submission counts / progress
- .github/workflows/sync_leetcode.yml, which automates syncing content from LeetCode
3. Per-problem module boundary
- Each problem directory is an isolated module with no cross-directory imports or shared library code.
- Typical contents:
- solution.cpp as the canonical submission source
- README.md copied or generated for that problem
- in some folders, a duplicate .cpp file named after the problem ID, suggesting an alternate export artifact from LeetHub or a retained backup copy
4. Execution model
- There is no long-running service, API server, or runtime orchestration.
- The effective “execution unit” is a single algorithm function/class in C++ that LeetCode compiles and runs against hidden tests.
- Architecturally, each folder maps to a problem-specific compile-and-test boundary.
5. Language and solution style
- The repo is overwhelmingly C++-based, with each solution written as a standalone submission file.
- Solutions are algorithmic and data-structure oriented rather than application-oriented, covering arrays, strings, linked lists, trees, graphs, dynamic programming, and design problems.
6. Documentation flow
- Problem READMEs appear to preserve the original LeetCode prompt, notes, or solution metadata.
- The root README aggregates topic tags and links to the corresponding problem folders, serving as a navigational index across the solution set.
7. Automation / synchronization
- .github/workflows/sync_leetcode.yml indicates the repo is automatically synchronized, likely pulling accepted submissions and README content from LeetCode via LeetHub.
- This workflow is the main infrastructure boundary in the repository: it updates source files and metadata, but does not affect algorithm runtime behavior.
8. Data flow
- The main flow is:
- problem solved on LeetCode
- solution and metadata synced into a problem folder
- root README and stats/index data updated for browsing
- There is no data flow between problems; all shared structure is editorial, not computational.
9. Subsystem grouping by topic
- The root README groups problems by technique, which reflects the codebase’s conceptual structure:
- arrays / hashing / sorting
- linked lists / two pointers / stack
- trees / DFS / BFS / binary tree
- graphs / union-find
- trie / design
- This grouping is for discovery, not runtime dependency.
10. Important architectural takeaway
- When drawing a diagram, model this repo as:
- a central index/documentation layer at the root
- a set of independent problem solution packages
- a sync automation layer feeding the packages from LeetCode
- There is no shared backend, no shared service graph, and no inter-module coupling beyond documentation and generated metadata.
Main entry points: README.md README · sync_leetcode.yml Sync LeetCode · 0208-implement-trie-prefix-tree Trie · stats.json Stats
Components 19
Documentation
Root-level browsing and progress index for the submission catalog.
Automation
Sync workflow that updates submissions and metadata from LeetCode.
- Sync LeetCode · Automation that syncs accepted submissions and README content.
.github/workflows/sync_leetcode.yml
Array / Math
Representative problem modules centered on array, numeric, and greedy techniques.
- Two Sum · Standalone C++ solution package for a single LeetCode problem.
0001-two-sum - 3Sum · Standalone C++ solution package for a single LeetCode problem.
0015-3sum - Product Except · Standalone C++ solution package for a single LeetCode problem.
0238-product-of-array-except-self - Top K · Standalone C++ solution package for a single LeetCode problem.
0347-top-k-frequent-elements
Linked Structures
Representative modules for linked lists and stack-style manipulation.
- Remove Nth · Standalone C++ solution package for a single LeetCode problem.
0019-remove-nth-node-from-end-of-list - Merge K Lists · Standalone C++ solution package for a single LeetCode problem.
0023-merge-k-sorted-lists - Reorder List · Standalone C++ solution package for a single LeetCode problem.
0143-reorder-list
Trees
Representative binary-tree and BST solution modules.
- Inorder · Standalone C++ solution package for a single LeetCode problem.
0094-binary-tree-inorder-traversal - Build Tree · Standalone C++ solution package for a single LeetCode problem.
0105-construct-binary-tree-from-preorder-and-inorder-traversal - LCA Tree · Standalone C++ solution package for a single LeetCode problem.
0236-lowest-common-ancestor-of-a-binary-tree
Graphs
Representative graph and grid traversal modules.
- Islands · Standalone C++ solution package for a single LeetCode problem.
0200-number-of-islands - Min Score Path · Standalone C++ solution package for a single LeetCode problem.
2582-minimum-score-of-a-path-between-two-cities - Safest Path · Standalone C++ solution package for a single LeetCode problem.
2914-find-the-safest-path-in-a-grid
Strings / Design
Representative string, trie, and design-oriented modules.
- Trie · Standalone C++ solution package for a single LeetCode problem.
0208-implement-trie-prefix-tree - Word Search · Standalone C++ solution package for a single LeetCode problem.
0211-design-add-and-search-words-data-structure - Dup Substring · Standalone C++ solution package for a single LeetCode problem.
1122-longest-duplicate-substring
Connections 17
- Sync LeetCode → Two Sum: syncs · Updates standalone submission folders from LeetCode.
- Sync LeetCode → Merge K Lists: syncs · Updates standalone submission folders from LeetCode.
- Sync LeetCode → Trie: syncs · Updates standalone submission folders from LeetCode.
- Sync LeetCode → Stats: updates · Refreshes repository progress metadata.
- Sync LeetCode → README: refreshes · Keeps the catalog index aligned with synced submissions.
- README → Two Sum: indexes · Points to problem modules in the catalog.
- README → 3Sum: indexes · Points to problem modules in the catalog.
- README → Product Except: indexes · Points to problem modules in the catalog.
- README → Inorder: indexes · Points to problem modules in the catalog.
- README → Islands: indexes · Points to problem modules in the catalog.
- README → Trie: indexes · Points to problem modules in the catalog.
- README → Min Score Path: indexes · Points to problem modules in the catalog.
- README → Safest Path: indexes · Points to problem modules in the catalog.
- Stats → README: summarizes · Provides repository-wide progress context for the index.
- Trie → Word Search: same pattern · Both are independent trie/design-style submission modules.
- Inorder → Build Tree: same pattern · Both are independent tree-algorithm submission modules.
- Islands → Safest Path: same pattern · Both are grid/graph traversal style problems.