https://github.com/bunu23/leetcode
Solution to LeetCode
https://github.com/bunu23/leetcode
algorithms array binary-search data-structures hashmap java linked-list stack string traversal-algorithms tree two-pointers
Last synced: 6 months ago
JSON representation
Solution to LeetCode
- Host: GitHub
- URL: https://github.com/bunu23/leetcode
- Owner: bunu23
- Created: 2024-06-07T02:11:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-26T01:16:17.000Z (10 months ago)
- Last Synced: 2025-06-21T10:06:36.594Z (6 months ago)
- Topics: algorithms, array, binary-search, data-structures, hashmap, java, linked-list, stack, string, traversal-algorithms, tree, two-pointers
- Language: Java
- Homepage:
- Size: 79.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LeetCode Solutions (JAVA)
### Table of Contents
1. [Easy](#-easy)
2. [Medium](#-medium)
3. [Hard](#-hard)
---
## 🟢 [Easy](easy)
| # | Problem | Solution | Type |
| --- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ------------------------- |
| 1 | [Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/description/) | [Solution](easy/reverse-linked-list/Solution.java) | LinkedList |
| 2 | [Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists/description/) | [Solution](easy/merge-two-sorted-lists/Solution.java) | LinkedList |
| 3 | [Palindrome Linked List](https://leetcode.com/problems/palindrome-linked-list/description/) | [Solution](easy/palindrome-linked-list/Solution.java) | LinkedList |
| 4 | [Remove Duplicates](https://leetcode.com/problems/remove-duplicates-from-sorted-list/) | [Solution](easy/remove-duplicates/Solution.java) | LinkedList |
| 5 | [ Linked List Cycle](https://leetcode.com/problems/linked-list-cycle/description/) | [Solution](easy/linked-list-cycle/Solution.java) | LinkedList |
| 6 | [ Intersection of Two Linked Lists](https://leetcode.com/problems/intersection-of-two-linked-lists/description/) | [Solution](easy/intersection-of-two-linked-list/Solution.java) | LinkedList |
| 7 | [Remove Linked List Elements](https://leetcode.com/problems/remove-linked-list-elements/description/) | [Solution](easy/remove-linked-list-elements/Solution.java) | LinkedList |
| 8 | [Middle of Linked List](https://leetcode.com/problems/middle-of-the-linked-list/) | [Solution](easy/middle-of-linked-list/Solution.java) | LinkedList |
| 9 | [Minimum String Length After Removing Substrings](https://leetcode.com/problems/minimum-string-length-after-removing-substrings/) | [Solution](easy/minimum-string-length-after-removing-substrings/Solution.java) | Stack |
| 10 | [Binary Tree InOrder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/) | [Solution](easy/binary-tree-inorder-traversal/Solution.java) | Stack, Tree |
| 11 | [Binary Tree Preorder Traversal](https://leetcode.com/problems/binary-tree-preorder-traversal/description/) | [Solution](easy/binary-tree-preorder-traversal/Solution.java) | Stack, Tree |
| 12 | [Binary Tree Postorder Traversal](https://leetcode.com/problems/binary-tree-postorder-traversal/description/) | [Solution](easy/binary-tree-postorder-traversal/Solution.java) | Stack, Tree |
| 13 | [Minimum Number of Swaps to Make the String Balanced](https://leetcode.com/problems/minimum-number-of-swaps-to-make-the-string-balanced/description/) | [Solution](easy/minimum-number-of-swaps-to-make-the-string-balanced/Solution.java) | Stack, String,Two Pointer |
| 14 | [ Palindrome Number](https://leetcode.com/problems/palindrome-number/description/) | [Solution](easy/palindrome-number/Solution.java) | Math |
| 15 | [ Majority Element](https://leetcode.com/problems/majority-element/description/) | [Solution](easy/majority-element/Solution.java) | Array |
| 16 | [ Missing Number](https://leetcode.com/problems/missing-number/description/) | [Solution](easy/missing-number/Solution.java) | Array |
| 17 | [ Move Zeroes](https://leetcode.com/problems/move-zeroes/description/) | [Solution](easy/move-zeroes/Solution.java) | Array |
| 18 | [ Roman to Integer](https://leetcode.com/problems/roman-to-integer/description/) | [Solution](easy/roman-to-integer/Solution.java) | String |
| 19 | [Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix/description/?envType=problem-list-v2&envId=string) | [Solution](easy/longest-common-prefix/Solution.java) | String |
| 20 | [Valid Parenthesis](https://leetcode.com/problems/valid-parentheses/?envType=problem-list-v2&envId=string) | [Solution](easy/valid-parentheses/Solution.java) | String , Stack |
| 21 | [Find the Index of the First Occurrence in a String](https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string/description/?envType=problem-list-v2&envId=string) | [Solution](easy/find-the-index-of-the-first-occurrence-in-a-string/Solution.java) | String |
| 22 | [Length of Last Word](https://leetcode.com/problems/length-of-last-word/description/?envType=problem-list-v2&envId=string) | [Solution](easy/length-of-last-word/Solution.java) | String |
| 23 | [ Add Binary](https://leetcode.com/problems/add-binary/description/?envType=problem-list-v2&envId=string) | [Solution](easy/add-binary/Solution.java) | String |
| 24 | [ Valid Palindrome](https://leetcode.com/problems/valid-palindrome/description/?envType=problem-list-v2&envId=string) | [Solution](easy/valid-palindrome/Solution.java) | String |
| 25 | [Excel Sheet Column Title](https://leetcode.com/problems/excel-sheet-column-title/description/?envType=problem-list-v2&envId=string) | [Solution](easy/excel-sheet-column-title/Solution.java) | String |
| 26 | [Excel Sheet Column Number](https://leetcode.com/problems/excel-sheet-column-number/description/?envType=problem-list-v2&envId=string) | [Solution](easy/excel-sheet-column-number/Solution.java) | String |
| 27 | [Valid Anagram](https://leetcode.com/problems/valid-anagram/description/?envType=problem-list-v2&envId=string) | [Solution](easy/valid-anagram/Solution.java) | String |
| 28 | [Binary Tree Paths](https://leetcode.com/problems/binary-tree-paths/description/?envType=problem-list-v2&envId=string) | [Solution](easy/binary-tree-paths/Solution.java) | String |
| 29 | [Contains Duplicate](https://leetcode.com/problems/contains-duplicate/description/) | [Solution](easy/contains-duplicate/Solution.java) | HashSet, Array |
[Back to TOC](#table-of-contents)
---
## 🟠[Medium](medium)
| # | Problem | Solution | Type |
| --- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------ |
| 1 | [Add Two Numbers](https://leetcode.com/problems/add-two-numbers/) | [Solution](medium/add-two-numbers/Solution.java) | LinkedList |
| 2 | [Delete Nodes from Linked List Present in Array](https://leetcode.com/problems/delete-nodes-from-linked-list-present-in-array/description/) | [Solution](medium/delete-nodes-from-linked-list-present-in-array/Solution.java) | LinkedList |
| 3 | [Minimum Add to Make Parentheses Valid](https://leetcode.com/problems/minimum-add-to-make-parentheses-valid/description/) | [Solution](medium/minimum-add-to-make-parentheses-valid/Solution.java) | String, Stack |
| 4 | [Maximum Width Ramp](https://leetcode.com/problems/maximum-width-ramp/description/) | [Solution](medium/maximum-width-ramp/Solution.java) | Array, Stack |
| 5 | [The Number of the Smallest Unoccupied Chair](https://leetcode.com/problems/the-number-of-the-smallest-unoccupied-chair/description/) | [Solution](medium/the-number-of-the-smallest-unoccupied-chair/Solution.java) | ArrayList, Priority Queue (Min-Heap) |
| 6 | [Separate Black and White Balls](https://leetcode.com/problems/separate-black-and-white-balls/description/) | [Solution](medium/separate-black-and-white-balls/Solution.java) | String |
| 7 | [Longest Square Streak in an Array](https://leetcode.com/problems/longest-square-streak-in-an-array/description/) | [Solution](medium/longest-square-streak-in-an-array/Solution.java) | Array, HashMap |
| 8 | [ Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/description/) | [Solution](medium/product-of-array-except-self/Solution.java) | Array |
[Back to TOC](#table-of-contents)
---
## 🔴 [Hard](hard)
| # | Problem | Solution | Type |
| --- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------- | ------ |
| 1 | [First Missing Positive](https://leetcode.com/problems/first-missing-positive/description/) | [Solution](hard/first-missing-positive/Solution.java) | Arrays |
[Back to TOC](#table-of-contents)
---
## Directory Structure
```bash
📂 project-root
├── 📂 easy
│ ├── 📂 TwoSum
│ │ └── Solution.java
│ ├── 📂 ValidPalindrome
│ └── Solution.java
├── 📂 medium
│ ├── 📂 AddTwoNumbers
│ │ └── Solution.java
│ ├── 📂 LongestSubstring
│ └── Solution.java
├── 📂 hard
│ ├── 📂 MedianSortedArrays
│ │ └── Solution.java
│ ├── 📂 RegexMatching
│ └── Solution.java
└── README.md
```