LeetCode-Top-Interview-150

LeetCode-Top-Interview-150

LeetCode-Top-Interview-150

Welcome to the LeetCode-Top-Interview-150 repository! This project documents my journey of solving one programming problem from LeetCode every day for the next 150 days. Let’s code and conquer together! πŸ’»πŸ’ͺ

🌟 Introduction

This repository is all about sharpening my problem-solving skills by tackling one programming problem from LeetCode each day. Starting from 28/08/2024, I’ll be pushing my limits for 150 consecutive days. Each solution will be recorded here, along with the problem statement and a breakdown of my approach. Let’s get coding! πŸš€

πŸ—‚οΈ Repository Structure

The repository is structured as follows:

.
β”œβ”€β”€ README.md
β”œβ”€β”€ Day_1
β”‚   β”œβ”€β”€ problem.md
β”‚   β”œβ”€β”€ solution.py
β”‚   └── solution.java
β”œβ”€β”€ Day_2
β”‚   β”œβ”€β”€ problem.md
β”‚   β”œβ”€β”€ solution.py
β”‚   └── solution.java
...
β”œβ”€β”€ Day_150
    β”œβ”€β”€ problem.md
    β”œβ”€β”€ solution.py
    └── solution.java
  • Each day’s folder contains:
    • problem.md: πŸ“œ The problem statement from LeetCode.
    • solution: πŸ’Ύ My solution in Java and Python.

πŸ“ˆ Progress

Day Problem Title Solution Link
1 Merge Sorted Array Solution
2 Remove Element Solution
3 Remove Duplicates from Sorted Array Solution
4 Remove Duplicates from Sorted Array II Solution
5 Majority Element Solution
6 Rotate Array Solution
7 Best Time to Buy and Sell Stock Solution
8 Best Time to Buy and Sell Stock II Solution
9 Jump Game Solution
10 Jump Game II Solution
11 H-Index Solution
12 Insert Delete GetRandom O(1) Solution
13 Product of Array Except Self Solution
14 Gas Station Solution
15 Candy Solution
16 Trapping Rain Water Solution
17 Roman to Integer Solution
18 Integer to Roman Solution
19 Length of Last Word Solution
20 Longest Common Prefix Solution
21 Reverse Words in a String Solution
22 Zigzag Conversion Solution
23 Find the Index of the First Occurrence in a String Solution
24 Text Justification Solution
25 Valid Palindrome Solution
26 Is Subsequence Solution
27 Two Sum II Input Array Is Sorted Solution
28 Container With Most Water Solution
29 3Sum Solution
30 Minimum Size Subarray Sum Solution
31 Longest Substring Without Repeating Characters Solution
32 Substring with Concatenation of All Words Solution
33 Minimum Window Substring Solution
34 Valid Sudoku Solution
35 Spiral Matrix Solution
36 Rotate Image Solution
37 Set Matrix Zeroes Solution
38 Game of Life Solution
39 Ransom Note Solution
40 Isomorphic Strings Solution
41 Word Pattern Solution
42 Valid Anagram Solution
43 Group Anagrams Solution
44 Two Sum Solution
45 Happy Number Solution
46 Contains Duplicate II Solution
47 Longest Consecutive Sequence Solution
48 Summary Ranges Solution
49 Merge Intervals Solution
50 Insert Interval Solution
51 Minimum Number of Arrows to Burst Balloons Solution
52 Valid Parentheses Solution
53 Simplify Path Solution
54 Min Stack Solution
55 Evaluate Reverse Polish Notation Solution
56 Basic Calculator Solution
57 Linked List Cycle Solution
58 Add Two Numbers Solution
59 Merge Two Sorted Lists Solution
60 Copy List with Random Pointer Solution
61 Reverse Linked List II Solution
62 Reverse Nodes in k-Group Solution
63 Remove Nth Node From End of List Solution
64 Remove Duplicates from Sorted List II Solution
65 Rotate List Solution
66 Partition List Solution
67 LRU Cache Solution
68 Maximum Depth of Binary Tree Solution
69 Same Tree Solution
70 Invert Binary Tree Solution
71 Symmetric Tree Solution
72 Construct Binary Tree from Preorder and Inorder Traversal Solution
73 Construct Binary Tree from Inorder and Postorder Traversal Solution
74 Populating Next Right Pointers in Each Node II Solution
75 Flatten BinaryTree to Linked List Solution
76 Path Sum Solution
77 Sum Root to Leaf Numbers Solution
78 Binary Tree Maximum Path Sum Solution
79 Binary Search Tree Iterator Solution
80 Count Complete Tree Nodes Solution
81 Lowest Common Ancestor of a Binary Tree Solution
82 Binary Tree Right Side View Solution
83 Average of Levels in Binary Tree Solution
84 Binary Tree Level Order Traversal Solution
85 Binary Tree Zigzag Level Order Traversal Solution
86 Minimum Absolute Difference in BST Solution
87 Kth Smallest Element in a BST Solution
88 Validate Binary Search Tree Solution
89 Number of Islands Solution
90 Surrounded Regions Solution
91 Clone Graph Solution
92 Evaluate Division Solution
93 Course Schedule Solution
94 Course Schedule II Solution
95 Snakes and Ladders Solution
96 Minimum Genetic Mutation Solution
97 Word Ladder Solution
98 Implement Trie Solution
99 Design Add and Search Words Data Structure Solution
100 Word Search II Solution
101 Letter Combinations of a Phone Number Solution
102 Combinations Solution
103 Permutation Solution
104 Combination Sum Solution
105 N-Queens II Solution
106 Generate Parentheses Solution
107 Word Search Solution
108 Convert Sorted Array to Binary Search Tree Solution
109 Sort List Solution
110 Construct Quad Tree Solution
111 Merge k Sorted Lists Solution
112 Maximum Subarray Solution
113 Maximum Sum Circular Subarray Solution
114 Search Insert Position Solution
115 Search a 2D Matrix Solution
116 Find Peak Element Solution
117 Search in Rotated Sorted Array Solution
118 Find First and Last Position of Element in Sorted Array Solution
119 Find Minimum in Rotated Sorted Array Solution
120 Median of Two Sorted Arrays Solution
121 Kth Largest Element in an Array Solution
122 IPO Solution
123 Find K Pairs with Smallest Sums Solution
124 Find Median from Data Stream Solution
125 Add Binary Solution
126 Reverse Bits Solution
127 Number of 1 Bits Solution
128 Single Number Solution
129 Single Number II Solution
130 Bitwise AND of Numbers Range Solution
131 Palindrome Number Solution

πŸš€ Getting Started

To dive into the solutions, navigate to the corresponding day’s folder and open the solution.py or solution.java.

πŸ”— Get A Copy for yourself !!

git clone https://github.com/Krushnal121/LeetCode-Top-Interview-150.git

🀝 Contributions

This repository is a personal learning journey, but I welcome contributions! Got a better solution or an alternate approach? Feel free to open a pull request or create an issue. Let’s learn together! 🌟

πŸ™ Acknowledgments

  • LeetCode for providing an excellent platform for coding challenges.
  • The programming community for continuous learning and inspiration.

πŸ“¬ Contact

Questions or suggestions? Reach out via GitHub issues.

Happy coding! πŸŽ‰