Welcome to my LeetCode problem-solving repository! This repository contains solutions to various LeetCode problems organized by algorithm patterns and data structures, implemented in both Python and Java.
- Total Problems Solved: 41
- Python Solutions: 41
- Java Solutions: 41
- Categories Covered: 10
The problems are categorized into the following algorithmic patterns:
- Binary Search - Efficient searching in sorted arrays
- Bit Manipulation - Operations using bitwise operators
- Dynamic Programming - Optimization problems using memoization
- Greedy - Locally optimal choices leading to global optimum
- Hashing - Hash table and hash map problems
- Linked List - Single and doubly linked list operations
- Sliding Window - Subarray/substring problems
- Stack - LIFO data structure problems
- String Manipulation - String processing and algorithms
- Two Pointers - Array problems using multiple pointers
S.No | Problem | Python | Java | LeetCode |
---|---|---|---|---|
Binary Search | ||||
1 | Search Insert Position | Python-LC-35 | Java-LC-35 | LC-35 |
2 | Find Minimum in Rotated Sorted Array | Python-LC-153 | Java-LC-153 | LC-153 |
3 | First Bad Version | Python-LC-278 | Java-LC-278 | LC-278 |
4 | Find Smallest Letter Greater Than Target | Python-LC-744 | Java-LC-744 | LC-744 |
Bit Manipulation | ||||
5 | Sum of Two Integers | Python-LC-371 | Java-LC-371 | LC-371 |
Dynamic Programming | ||||
6 | Longest Palindromic Subsequence | Python-LC-516 | Java-LC-516 | LC-516 |
Greedy | ||||
7 | Maximum Score From Removing Substrings | Python-LC-1717 | Java-LC-1717 | LC-1717 |
Hashing | ||||
8 | Two Sum | Python-LC-1 | Java-LC-1 | LC-1 |
9 | Group Anagrams | Python-LC-49 | Java-LC-49 | LC-49 |
10 | Longest Consecutive Sequence | Python-LC-128 | Java-LC-128 | LC-128 |
11 | Contains Duplicate | Python-LC-217 | Java-LC-217 | LC-217 |
Linked List | ||||
12 | Add Two Numbers | Python-LC-2 | Java-LC-2 | LC-2 |
13 | Remove Nth Node From End of List | Python-LC-19 | Java-LC-19 | LC-19 |
14 | Merge Two Sorted Lists | Python-LC-21 | Java-LC-21 | LC-21 |
15 | Reverse Linked List II | Python-LC-92 | Java-LC-92 | LC-92 |
16 | Linked List Cycle | Python-LC-141 | Java-LC-141 | LC-141 |
17 | Linked List Cycle II | Python-LC-142 | Java-LC-142 | LC-142 |
18 | Reverse Linked List | Python-LC-206 | Java-LC-206 | LC-206 |
19 | Delete Node in a Linked List | Python-LC-237 | Java-LC-237 | LC-237 |
20 | Palindrome Linked List | Python-LC-234 | Java-LC-234 | LC-234 |
21 | Middle of the Linked List | Python-LC-876 | Java-LC-876 | LC-876 |
22 | Delete the Middle Node of a Linked List | Python-LC-2095 | Java-LC-2095 | LC-2095 |
Sliding Window | ||||
23 | Longest Substring Without Repeating Characters | Python-LC-3 | Java-LC-3 | LC-3 |
24 | Minimum Size Subarray Sum | Python-LC-209 | Java-LC-209 | LC-209 |
25 | Maximum Average Subarray I | Python-LC-643 | Java-LC-643 | LC-643 |
26 | Fruit Into Baskets | Python-LC-904 | Java-LC-904 | LC-904 |
27 | Maximum Erasure Value | Python-LC-1695 | Java-LC-1695 | LC-1695 |
Stack | ||||
28 | Valid Parentheses | Python-LC-20 | Java-LC-20 | LC-20 |
29 | Removing Stars From a String | Python-LC-2390 | Java-LC-2390 | LC-2390 |
String Manipulation | ||||
30 | Longest Common Prefix | Python-LC-14 | Java-LC-14 | LC-14 |
31 | Length of Last Word | Python-LC-58 | Java-LC-58 | LC-58 |
32 | Reverse Words in a String | Python-LC-151 | Java-LC-151 | LC-151 |
33 | Delete Characters to Make Fancy String | Python-LC-1957 | Java-LC-1957 | LC-1957 |
Two Pointers | ||||
34 | Longest Palindromic Substring | Python-LC-5 | Java-LC-5 | LC-5 |
35 | Container With Most Water | Python-LC-11 | Java-LC-11 | LC-11 |
36 | Remove Duplicates from Sorted Array | Python-LC-26 | Java-LC-26 | LC-26 |
37 | Remove Element | Python-LC-27 | Java-LC-27 | LC-27 |
38 | Trapping Rain Water | Python-LC-42 | Java-LC-42 | LC-42 |
39 | Merge Sorted Array | Python-LC-88 | Java-LC-88 | LC-88 |
40 | Two Sum II - Input Array Is Sorted | Python-LC-167 | Java-LC-167 | LC-167 |
41 | Move Zeroes | Python-LC-283 | Java-LC-283 | LC-283 |
- Python 3.x for running Python solutions
- Java 8+ for running Java solutions