How prathamesh612/coding-challenges works
1. This repository is not a single application; it is a catalog of 88 independent Java coding-challenge solutions. The architectural boundary is the problem folder: each problem-XX-* directory is a self-contained unit with its own README and one Java source file, or in a few cases multiple alternative solution files.
2. The root README.md is the entry point and index. It provides the problem list, difficulty labels, repository goals, and the shared execution model. For an architecture diagram, treat the root as documentation and navigation only, not as an executable subsystem.
3. Execution is strictly local and per-problem. The documented runtime flow is: enter one problem directory, compile the single .java file with javac, then run it with java. There is no global build tool, dependency manager, test harness, or multi-module orchestration visible in the repository.
4. The solution code is organized by algorithmic domain rather than by application feature. Most folders correspond to classic interview/problem categories: string manipulation, array operations, numeric checks, parsing/validation, dynamic programming, graph/grid traversal, and backtracking.
5. A large portion of the repo is string and text processing: examples include vowel checks, anagram detection, acronym building, sentence reversal/capitalization, HTML stripping, email/IP validation, camelCase conversion, password strength, and substring problems. These are independent implementations that do not share utility code.
6. Another major cluster is array and matrix algorithms: merge intervals, matrix rotation, spiral matrix, set matrix zeroes, search in sorted matrix, sort colors, move zeroes, top-k frequent elements, two-sum, three-sum, and duplicate detection. These folders represent the “array processing” subsystem in the repo’s conceptual architecture.
7. There is a distinct dynamic programming / optimization cluster: coin change variants, subset sum, knapsack, house robber, longest common subsequence, edit distance, Fibonacci DP, merge stones, split array largest sum, and number of islands. These problems are standalone but thematically related by stateful recurrence or search/optimization logic.
8. Search, greedy, and pointer-based problems form another group: peak finding, gas station, jump game, activity selection, Koko eating bananas, container with most water, trapping rain water, rotated array search, and first/last position lookup. These solutions likely emphasize invariant-driven traversal and binary search patterns.
9. Backtracking and combinatorial generation appear in folders like N-Queens, subsets, and generate parentheses, with tree/grid traversal in binary tree paths and number of islands. These are separate problem-specific exploration engines rather than shared framework components.
10. The repository has no apparent external services, persistence layer, API layer, or frontend. Its only real dependency is the Java standard library plus the local JDK used to compile and run each file. That means the architecture diagram should show a flat set of isolated compute units under a documentation/index layer.
11. A few folders contain multiple implementations of the same problem, such as SecondBest1.java and SecondBest2.java. Those should be modeled as alternate solution variants within the same problem boundary, not as separate subsystems.
12. The main cross-cutting concern is consistency of structure: each problem folder contains its own problem statement and solution code, and the root README aggregates status and links. In other words, the repo is a practice library of independent algorithm modules with zero runtime coupling between them.
Main entry points: README.md Root README · VowelBalance.java Vowel Balance · CamelCaseConverter.java CamelCase · AcronymBuilder.java Acronym Builder
Components 34
Docs & Index
Repository entry points and shared usage guidance.
- Root README · Repository index, goals, and per-problem compile/run workflow.
README.md - Problem Folders · Each problem directory is a self-contained Java solution boundary.
String & Text
String manipulation, parsing, formatting, and validation challenges.
- Text Problems · Independent string manipulation, tokenization, validation, and formatting challenges.
- Vowel Balance · Vowel-oriented text check.
problem-01-vowel-balance/VowelBalance.java - CamelCase · Token-to-camel-case conversion.
problem-14-camelcase-converter/CamelCaseConverter.java - Acronym Builder · Builds acronyms from phrases.
problem-26-acronym-builder/AcronymBuilder.java - Password Strength · Password policy and strength checking.
problem-36-password-strength/Passw0rdStr3ngth.java - HTML Strip · Removes HTML-like tags from text.
problem-38-html-tag-stripper/HtmlTagStripper.java - Email Validator · Email format validation.
problem-39-email-validator/EmailValidator.java - IPv4 Validator · IPv4 address validation.
problem-23-ipv4-validator/IPv4Validator.java
Arrays & Matrices
Array transforms, matrix operations, and interval-style problems.
- Array Problems · Array processing, interval handling, and matrix-oriented solutions.
- Array Diff · Array difference and filtering.
problem-28-array-diff/ArrayDiff.java - Merge Intervals · Combines overlapping ranges.
problem-45-merge-intervals/MergeIntervals.java - Top K Frequent · Frequency-based selection from arrays.
problem-50-top-k-frequent/TopKFrequentElements.java - Rotate Matrix · In-place matrix rotation.
problem-24-matrix-rotate/MatrixRotate.java - Spiral Matrix · Layered matrix walk.
problem-46-spiral-matrix/SpiralMatrix.java - Search Matrix · Searches sorted 2D matrix structure.
problem-48-search-sorted-matrix/SearchInSortedMatrix.java - Set Zeroes · Matrix zero propagation.
problem-65-set-matrix-zeroes/SetMatrixZeroes.java
DP & Optimization
Dynamic programming, recurrence, and optimization problems.
- DP Problems · Stateful recurrence, optimization, and subset-style problems.
- Coin Ways · Counts change-making combinations.
problem-52-coin-change-ways/CoinChangeWays.java - Coin Min · Minimizes coins for a target sum.
problem-53-coin-change-min/CoinChangeMin.java - Knapsack · 0/1 optimization over capacity.
problem-55-knapsack/Knapsack.java - LCS · Longest common subsequence.
problem-59-longest-common-subsequence/LongestCommonSubsequence.java - Edit Distance · String transformation DP.
problem-77-edit-distance/EditDistance.java - Split Array · Minimizes the largest partition sum.
problem-87-split-array-largest-sum/SplitArrayLargestSum.java
Search & Greedy
Binary search, greedy traversal, and pointer-driven selection.
- Search Problems · Binary search, greedy feasibility, and traversal-driven selection.
- Jump Game · Reachability via forward scan.
problem-80-jump-game/JumpGame.java - Koko Bananas · Feasibility search over eating speed.
problem-85-koko-eating-bananas/KokoEatingBananas.java - Rotated Search · Search in rotated sorted array.
problem-83-search-rotated-sorted-array/SearchRotatedSortedArray.java - Peak Element · Finds a local peak in an array.
problem-66-find-peak-element/FindPeakElement.java
Backtracking & Traversal
Combinatorial generation and graph/tree traversal problems.
Math & Numbers
Arithmetic checks, numeric sequences, and number-theory style tasks.
- Numeric Problems · Arithmetic checks, sequences, and classic numeric tasks.
Connections 33
- Root README → Problem Folders: documents · Explains the local compile-and-run workflow.
- Root README → Text Problems: indexes · Lists text-focused challenge solutions.
- Root README → Array Problems: indexes · Lists array and matrix solution folders.
- Root README → DP Problems: indexes · Lists dynamic programming and optimization problems.
- Root README → Search Problems: indexes · Lists search and greedy-style problems.
- Root README → Traversal Problems: indexes · Lists backtracking and traversal problems.
- Root README → Numeric Problems: indexes · Documents numeric practice problems.
- Text Problems → Vowel Balance: includes · Example string challenge.
- Text Problems → CamelCase: includes · CamelCase conversion.
- Text Problems → Acronym Builder: includes · Acronym construction.
- Text Problems → Password Strength: includes · Password strength validation.
- Text Problems → HTML Strip: includes · HTML-like tag stripping.
- Text Problems → Email Validator: includes · Email validation.
- Text Problems → IPv4 Validator: includes · IPv4 validation.
- Array Problems → Array Diff: includes · Array diff/filtering.
- Array Problems → Merge Intervals: includes · Interval merging.
- Array Problems → Top K Frequent: includes · Top-k frequency selection.
- Array Problems → Rotate Matrix: includes · Matrix rotation.
- Array Problems → Spiral Matrix: includes · Spiral traversal.
- Array Problems → Search Matrix: includes · Matrix search.
- Array Problems → Set Zeroes: includes · Set-zeroes transform.
- DP Problems → Coin Ways: includes · Counting combinations.
- DP Problems → Coin Min: includes · Minimum-coin optimization.
- DP Problems → Knapsack: includes · Capacity optimization.
- DP Problems → LCS: includes · Subsequence recurrence.
- DP Problems → Edit Distance: includes · Edit distance DP.
- DP Problems → Split Array: includes · Partition minimization.
- Search Problems → Jump Game: includes · Forward reachability scan.
- Search Problems → Koko Bananas: includes · Binary-search feasibility.
- Search Problems → Rotated Search: includes · Rotated-array search.
- Search Problems → Peak Element: includes · Peak-finding search.
- Traversal Problems → Subsets: includes · Subset generation.
- Traversal Problems → N-Queens: includes · Constraint-based board search.