✨ Milestone Achieved: Knight Badge | Top 5.69% Globally | 430+ Java Solutions
My solutions to LeetCode problems, primarily in Java. Automatically synced via LeetHub v2.
| Metric | Value |
|---|---|
| Total Solved | 430+ |
| Primary Language | Java |
| Global Rank | Top 5.69% |
| Achievement | Knight Badge |
Mastering algorithm patterns is critical for writing clean, optimized Java solutions. By identifying the underlying pattern, you avoid brittle ad-hoc logic, reduce time complexity, and produce readable, idiomatic code.
| Pattern | Why It Matters for Java Implementations | Key Problems |
|---|---|---|
| Sliding Window | Avoids nested loops (O(n²) -> O(n)) for subarray/substring problems. Perfect for optimizing String or char[] manipulations in Java. |
Longest Substring Without Repeating, Minimum Window Substring |
| Two Pointers | Minimizes space complexity (O(1)) and provides elegant solutions for sorted arrays and linked lists without extra collections overhead. | 3Sum, Container With Most Water, Trapping Rain Water |
| Monotonic Stack | Essential for O(n) solutions to "next greater element" problems. Java's ArrayDeque is the ideal non-synchronized, performant choice here. |
Next Greater Element, Stock Span, Trapping Rain Water |
| Dynamic Programming | Trades space for time by memoizing subproblems. Crucial for optimizing recursive tree explorations into efficient tabulated arrays. | Climbing Stairs, Longest Common Subsequence, Edit Distance |
| Graph BFS/DFS | Forms the backbone of connectivity and traversal problems. Leveraging Java's Queue for BFS and recursion/Stack for DFS handles complex topologies efficiently. |
Number of Islands, Course Schedule, Word Ladder |
| Binary Search | Drops O(n) to O(log n) for sorted data. Mastering off-by-one errors and loop invariants here is key to robust Java algorithms. | Search in Rotated Array, Median of Two Sorted Arrays |
Every accepted LeetCode submission is automatically pushed to this repository using the LeetHub v2 Chrome Extension. Each solution includes:
- ✅ Clean, optimized Java code
- 📁 Organized by problem number and title
- 🏷️ Tagged with difficulty level
Solutions by Himanshu Yadav • Built with consistency and caffeine ☕
| 1833-maximum-ice-cream-bars |
| 3517-smallest-palindromic-rearrangement-i |
| 0493-reverse-pairs |
| 0673-number-of-longest-increasing-subsequence |
| 2213-longest-substring-of-one-repeating-character |
| 3525-find-x-value-of-array-ii |
| 3737-count-subarrays-with-majority-element-i |
| 0493-reverse-pairs |
| 3737-count-subarrays-with-majority-element-i |
| 0022-generate-parentheses |
| 0039-combination-sum |
| 0494-target-sum |
| 3348-smallest-divisible-digit-product-ii |
| 0316-remove-duplicate-letters |
| 1008-construct-binary-search-tree-from-preorder-traversal |
| 1081-smallest-subsequence-of-distinct-characters |
| 0743-network-delay-time |
| 0778-swim-in-rising-water |
| 1464-maximum-product-of-two-elements-in-an-array |
| 1631-path-with-minimum-effort |
| 2812-find-the-safest-path-in-a-grid |
| 3620-network-recovery-pathways |
| 0207-course-schedule |
| 0210-course-schedule-ii |
| 0802-find-eventual-safe-states |
| 1976-number-of-ways-to-arrive-at-destination |
| 3620-network-recovery-pathways |
| 0743-network-delay-time |
| 1334-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance |
| 1976-number-of-ways-to-arrive-at-destination |
| 3620-network-recovery-pathways |
| 0070-climbing-stairs |
| 0044-wildcard-matching |
| 0486-predict-the-winner |
| 1106-parsing-a-boolean-expression |
| 3483-unique-3-digit-even-numbers |
| 1260-shift-2d-grid |
| 2149-rearrange-array-elements-by-sign |
| 3069-distribute-elements-into-two-arrays-i |
| 3498-reverse-degree-of-a-string |
| 3867-sum-of-gcd-of-formed-pairs |
| 0493-reverse-pairs |
| 0673-number-of-longest-increasing-subsequence |
| 0493-reverse-pairs |
| 2213-longest-substring-of-one-repeating-character |
| 0486-predict-the-winner |
| 0877-stone-game |
| 1140-stone-game-ii |
| 1406-stone-game-iii |
| 1510-stone-game-iv |
| 1563-stone-game-v |
| 1872-stone-game-viii |
| 1927-sum-game |
| 2029-stone-game-ix |
| 0236-lowest-common-ancestor-of-a-binary-tree |
| 0236-lowest-common-ancestor-of-a-binary-tree |
| 0207-course-schedule |
| 1140-stone-game-ii |
| 1510-stone-game-iv |
| 1872-stone-game-viii |
| 2029-stone-game-ix |
| 1140-stone-game-ii |
| 1510-stone-game-iv |
| 1872-stone-game-viii |
| 2029-stone-game-ix |
| 1510-stone-game-iv |
| 2029-stone-game-ix |
| 1510-stone-game-iv |
| 2058-find-the-minimum-and-maximum-number-of-nodes-between-critical-points |
| 0056-merge-intervals |
| 0075-sort-colors |
| 0075-sort-colors |
| 0287-find-the-duplicate-number |
| 0287-find-the-duplicate-number |
| 0169-majority-element |
| 0229-majority-element-ii |
| 0223-rectangle-area |
| 0836-rectangle-overlap |
| 1401-circle-and-rectangle-overlapping |
| 1190-reverse-substrings-between-each-pair-of-parentheses |