I build solutions that are earned, not copied. This repository tracks my transition from brute-force attempts to structured pattern recognition.
Quick access to my work and professional profiles:
| Metric | Baseline (Nov 2025) | Current (Jan 2026) | Delta |
|---|---|---|---|
| LeetCode Acceptance | 52.9% | 76.23% | +23.33% 📈 |
| LeetCode Problems | ~35 | 45 | +28.6% |
| Unique Problems (Total) | ~35 | 68 | +94% 🚀 |
| Total Implementations | ~45 | 95 | Multi-solution mastery |
| Solving Strategy | Brute-Force Guessing | Pattern-First Methodology | ✅ Systematic |
A clean, logical hierarchy for easy code review and navigation.
DSA-in-Java/
├── 📂 Basics/
│ ├── 📁 Patterns/ # 17 pattern problems + PATTERN_RULES.txt method guide
│ ├── 📁 Basic Maths/ # 38 files in 6 subfolders
│ │ ├── Array_Operations/ # 7 (AP, Plus1, Duplicate×2, SortedSquares×2)
│ │ ├── Divisors/ # 5 (Divisors×2, PerfectNumber×2, Ugly)
│ │ ├── HCF_LCM/ # 3 (HCF, LCM×2)
│ │ ├── Miscellaneous/ # 9 (Power2/3, SQRT, Expo, Excel, UniqueChar×2…)
│ │ ├── Modulus_Digit/ # 10 (digits, palindrome, happy×2, repunit…)
│ │ └── Sieve_Prime/ # 4 (Prime, Count, Range, SPF)
│ ├── 📁 Basic Array/ # 4 fundamentals (sum, reverse, sort-check, odd count)
│ ├── 📁 Basic Strings/ # 3 fundamentals (reverse, palindrome, anagram)
│ ├── 📁 Basic Hashing/ # 16 (frequency arrays → HashMap/HashSet problems)
│ ├── 📁 Basic Recursion/ # 15 warm-ups (print, factorial, reverse, digit sums)
│ └── 📁 JAVA COLLECTIONS/ # 15 reference demos (NOT problems)
├── 📂 Recursion/ # 5 intermediate problems
│ └── 📁 Medium/ # Kth_Symbol (LeetCode 779)
├── 📂 Strings/
│ ├── 📁 Easy/ # 4 (Isomorphic, Rotate, LargestOdd, Prefix)
│ └── 📁 Medium/ # 1 (Sort by frequency)
├── 📂 CP/ # 2 HackerRank problems
└── 📂 Misc/ # 3 standalone (Bank, FizzBuzz, Palindrome variant)
Every folder has its own README with a linked file index, topic notes and
per-approach time/space complexity; every .java file starts with a //TODO:
problem statement + complexity header.
| Module | Status | Problems Solved | Key Achievement |
|---|---|---|---|
| Patterns | ✅ COMPLETE | 17/17 | Formula derivation mastery |
| Basic Maths | ✅ COMPLETE | 17/17 (Striver) + 14 additional | Multiple optimization approaches |
| Basic Recursion | ✅ COMPLETE | 14/14 | Dual implementations (iterative + recursive) |
| Basic Hashing | ✅ COMPLETE | 16/16 | HashMap mastery + frequency counting |
| JAVA Collections | 📚 Reference | 0 (not problems) | Deep understanding of Java internals |
| Codeforces | 🟡 Started | 3 | Competitive programming practice |
| Sorting | ⚪ NEXT | 0/14 | Starting after exam break |
| Binary Search | ⚪ Upcoming | 0/47 | Planned after Sorting |
COMPLETE: 47/47 Striver reference problems + 17 patterns + 4 bonus = 68 unique problems total
- ✅ Basic Maths: 17/17 (100%)
- ✅ Basic Recursion: 14/14 (100%)
- ✅ Basic Hashing: 16/16 (100%)
- ✅ Patterns: 17/17 (100%)
Next Section: Sorting Techniques (7 Striver + 7 Additional = 14 total) - Starting March 6, 2026 after exams
What makes this different from tutorial code:
- 12 problems with multiple approaches - Evolution from brute force to optimal visible in code
- 8 recursion files with dual implementations - Both iterative and recursive in same file
- Optimization examples: Duplicate detection (O(n log n)→O(n)), Perfect Number (O(n)→O(√n)), Sorted Squares (O(n log n)→O(n))
Every solution in this repo adheres to Interview-Grade Standards:
- Meaningful Naming: Variables like
leftPtr,sumTotal, andisFoundreplacei,s, andf. - Complexity Comments: Every file includes a header with Time Complexity () and Space Complexity () analysis.
- Local Validation: Code is only committed after passing a custom local test rig including edge cases.
"In a world of copy-paste, I ship solutions I actually understand."
68 Unique Problems • 95 Total Implementations • 12 Multi-Solution Problems
Maintained by Yuvraj Sarathe • B.Tech Cyber Security Student
Last System Update: January 2025
The DSA REV app (DSAREV) tracks this repository automatically: every
.java file becomes a revision-ready problem with its statement, notes and
code synced into the app. No manual entry, no imports — keep solving here and
the app picks it up on every sync.
| Convention | Becomes in the app |
|---|---|
//TODO: <one-line gist> - LeetCode 70 |
Problem gist + LeetCode id |
/* ! ... */ block paragraphs |
Statement (each paragraph = one block) |
//! note (anywhere in the file) |
Approach note |
// Time: O(n) ... / // Space: O(n) ... |
Complexity fields + notes |
TITLE:, LINK:, TOPIC(S):, DIFFICULTY:, SOURCE:, NOTES:, APPROACH:, STATEMENT: header keys |
Optional overrides |
Folder path (Basics/Basic Hashing/…) |
Topic tags |
Folder named Easy / Medium / Hard |
Difficulty (else "Unknown") |
| File name | Display title (Merge_Two_Sorted_Lists → "Merge Two Sorted Lists") |
Files that solve the same problem merge into one problem with multiple
solutions — the same file name in different folders (e.g. Valid_Anagram in
two places) or an X2 / X_2 variant suffix. Bare digit tails (Pattern1 …
Pattern17) always stay separate.
Code edits in the app autosave locally; Save to file writes them back into this repo. Files with unsaved app edits are never overwritten by a sync — push them first. Everything else (statement, notes, topics) is owned by the repo: edit the file, re-sync, done.
A growing subset of files carries two extra machine-readable lines that let the
app run a problem without any main(): the app generates a temporary
harness, feeds it your attempt and prints a per-case PASS/FAIL verdict with a
pass rate — just like an online judge.
// SOLVE: ListNode mergeTwoLists(ListNode list1, ListNode list2) ← entry point
// ...solution code...
// TEST: list1=[1,2,4], list2=[1,3,4] -> [1,1,2,3,4,4] ← test cases
// TEST: list1=[], list2=[] -> []// SOLVE:(near the top) declares the method to call:[static]prefix for static methods, then return type, name and parameter list. One per file.// TEST:lines (usually at the end) each hold one case:paramName=literal, paramName=literal -> expectedLiteral. Parameter names must match the SOLVE signature order.- Literals are a JSON-ish subset: numbers,
true/false,"strings"(escapes\n\t\\\"),'c', and nested arrays — plusListNode/TreeNodeshorthand: a flat array[1,2,4]builds a linked list/tree (level order). -> ""is the empty-string expectation (unquoted, because"->"content is taken literally otherwise).- Empty lists:
[]as an argument means a nullListNode/TreeNodehead, and a null list/tree result is shown as[]— matching LeetCode semantics. - Void methods that print nothing get their (possibly mutated) arguments
serialized back, so in-place mutators like
reverseArray(int[])are testable. - Whole-number
doubles print without the trailing.0(4.0→4). - If the code references
ListNode/TreeNodewithout defining them, the app injects standard definitions automatically (they never need to be pasted).
Some files intentionally have no SOLVE/TEST: interactive mains that read
stdin (Factorial, CP problems, basic recursion demos), reference/demonstration
files (JAVA COLLECTIONS demos, Bank), and files with multiple classes. Pattern
and sorting files use captured-stdout replay cases instead. Attempt code is
never written back into this repo — it lives in the app only.