This repository contains leetcode Top 150 Interview Problems solutions source code in Java Programming languages.
| Problem | Difficulty | Solution | Status |
|---|---|---|---|
| Array / String | |||
| Merge Sorted Array | π’ Easy | ||
| Remove Element | π’ Easy | ||
| Remove Duplicates from Sorted Array | π’ Easy | ||
| Remove Duplicates from Sorted Array II | π‘ Medium | ||
| Majority Element | π’ Easy | ||
| Rotate Array | π‘ Medium | ||
| Best Time to Buy and Sell Stock | π’ Easy | ||
| Best Time to Buy and Sell Stock II | π‘ Medium | ||
| Jump Game | π‘ Medium | ||
| Jump Game II | π‘ Medium | ||
| H-Index | π‘ Medium | ||
| Insert Delete GetRandom O(1) | π‘ Medium | ||
| Product of Array Except Self | π‘ Medium | ||
| Gas Station | π‘ Medium | ||
| Candy | π΄ Hard | ||
| Trapping Rain Water | π΄ Hard | ||
| Roman to Integer | π’ Easy | ||
| Integer to Roman | π‘ Medium | ||
| Length of Last Word | π’ Easy | ||
| Longest Common Prefix | π’ Easy | ||
| Reverse Words in a String | π‘ Medium | ||
| Zigzag Conversion | π‘ Medium | ||
| Find the Index of the First Occurrence in a String | π’ Easy | ||
| Text Justification | π΄ Hard | ||
| Two Pointers | |||
| Valid Palindrome | π’ Easy | ||
| Is Subsequence | π’ Easy | ||
| Two Sum II - Input Array Is Sorted | π‘ Medium | ||
| Container With Most Water | π‘ Medium | ||
| 3Sum | π‘ Medium | ||
| Sliding Window | |||
| Minimum Size Subarray Sum | π‘ Medium | ||
| Longest Substring Without Repeating Characters | π‘ Medium | ||
| Substring with Concatenation of All Words | π΄ Hard | ||
| Minimum Window Substring | π΄ Hard | ||
| Matrix | |||
| Valid Sudoku | π‘ Medium | ||
| Spiral Matrix | π‘ Medium | ||
| Rotate Image | π‘ Medium | ||
| Set Matrix Zeroes | π‘ Medium | ||
| Game of Life | π‘ Medium | ||
| Hashmap | |||
| Ransom Note | π’ Easy | ||
| Isomorphic Strings | π’ Easy | ||
| Word Pattern | π’ Easy | ||
| Valid Anagram | π’ Easy | ||
| Group Anagrams | π‘ Medium | ||
| Two Sum | π’ Easy | ||
| Happy Number | π’ Easy | ||
| Contains Duplicate II | π’ Easy | ||
| Longest Consecutive Sequence | π‘ Medium | ||
| Intervals | |||
| Summary Ranges | π’ Easy | ||
| Merge Intervals | π‘ Medium | ||
| Insert Interval | π‘ Medium | ||
| Minimum Number of Arrows to Burst Balloons | π‘ Medium | ||
| Stack | |||
| Valid Parentheses | π’ Easy | ||
| Simplify Path | π‘ Medium | ||
| Min Stack | π‘ Medium | ||
| Evaluate Reverse Polish Notation | π‘ Medium | ||
| Basic Calculator | π΄ Hard | ||
| Linked List | |||
| Linked List Cycle | π’ Easy | ||
| Add Two Numbers | π‘ Medium | ||
| Merge Two Sorted Lists | π’ Easy | ||
| Copy List with Random Pointer | π‘ Medium | ||
| Reverse Linked List II | π‘ Medium | ||
| Reverse Nodes in k-Group | π΄ Hard | ||
| Remove Nth Node From End of List | π‘ Medium | ||
| Remove Duplicates from Sorted List II | π‘ Medium | ||
| Rotate List | π‘ Medium | ||
| Partition List | π‘ Medium | ||
| LRU Cache | π‘ Medium | ||
| Binary Tree General | |||
| Maximum Depth of Binary Tree | π’ Easy | ||
| Same Tree | π’ Easy | ||
| Invert Binary Tree | π’ Easy | ||
| Symmetric Tree | π’ Easy | ||
| Construct Binary Tree from Preorder and Inorder Traversal | π‘ Medium | ||
| Construct Binary Tree from Inorder and Postorder Traversal | π‘ Medium | ||
| Populating Next Right Pointers in Each Node II | π‘ Medium | ||
| Flatten Binary Tree to Linked List | π‘ Medium | ||
| Path Sum | π’ Easy | ||
| Sum Root to Leaf Numbers | π‘ Medium | ||
| Binary Tree Maximum Path Sum | π΄ Hard | ||
| Binary Search Tree Iterator | π‘ Medium | ||
| Count Complete Tree Nodes | π’ Easy | ||
| Binary Tree BFS | |||
| Binary Tree Right Side View | π‘ Medium | ||
| Average of Levels in Binary Tree | π’ Easy | ||
| Binary Tree Level Order Traversal | π‘ Medium | ||
| Binary Tree Zigzag Level Order Traversal | π‘ Medium | ||
| Binary Search Tree | |||
| Minimum Absolute Difference in BST | π’ Easy | ||
| Kth Smallest Element in a BST | π‘ Medium | ||
| Validate Binary Search Tree | π‘ Medium | ||
| Graph General | |||
| Number of Islands | π‘ Medium | ||
| Surrounded Regions | π‘ Medium | ||
| Clone Graph | π‘ Medium | ||
| Evaluate Division | π‘ Medium | ||
| Course Schedule | π‘ Medium | ||
| Course Schedule II | π‘ Medium | ||
| Graph BFS | |||
| Snakes and Ladders | π‘ Medium | ||
| Minimum Genetic Mutation | π‘ Medium | ||
| Word Ladder | π΄ Hard | ||
| Trie | |||
| Implement Trie (Prefix Tree) | π‘ Medium | ||
| Design Add and Search Words Data Structure | π‘ Medium | ||
| Word Search II | π΄ Hard | ||
| Backtracking | |||
| Letter Combinations of a Phone Number | π‘ Medium | ||
| Combinations | π‘ Medium | ||
| Permutations | π‘ Medium | ||
| Combination Sum | π‘ Medium | ||
| N-Queens II | π΄ Hard | ||
| Generate Parentheses | π‘ Medium | ||
| Word Search | π‘ Medium | ||
| Divide & Conquer | |||
| Convert Sorted Array to Binary Search Tree | π’ Easy | ||
| Sort List | π‘ Medium | ||
| Construct Quad Tree | π‘ Medium | ||
| Merge k Sorted Lists | π΄ Hard | ||
| Kadane's Algorithm | |||
| Maximum Subarray | π‘ Medium | ||
| Maximum Sum Circular Subarray | π‘ Medium | ||
| Binary Search | |||
| Search Insert Position | π’ Easy | ||
| Search a 2D Matrix | π‘ Medium | ||
| Find Peak Element | π‘ Medium | ||
| Search in Rotated Sorted Array | π‘ Medium | ||
| Find First and Last Position of Element in Sorted Array | π‘ Medium | ||
| Find Minimum in Rotated Sorted Array | π‘ Medium | ||
| Median of Two Sorted Arrays | π΄ Hard | ||
| Heap | |||
| Kth Largest Element in an Array | π‘ Medium | ||
| IPO | π΄ Hard | ||
| Find K Pairs with Smallest Sums | π‘ Medium | ||
| Find Median from Data Stream | π΄ Hard | ||
| Bit Manipulation | |||
| Add Binary | π’ Easy | ||
| Reverse Bits | π’ Easy | ||
| Number of 1 Bits | π’ Easy | ||
| Single Number | π’ Easy | ||
| Single Number II | π‘ Medium | ||
| Bitwise AND of Numbers Range | π‘ Medium | ||
| Math | |||
| Palindrome Number | π’ Easy | ||
| Plus One | π’ Easy | ||
| Factorial Trailing Zeroes | π‘ Medium | ||
| Sqrt(x) | π’ Easy | ||
| Pow(x, n) | π‘ Medium | ||
| Max Points on a Line | π΄ Hard | ||
| 1D DP | |||
| Climbing Stairs | π’ Easy | ||
| House Robber | π‘ Medium | ||
| Word Break | π‘ Medium | ||
| Coin Change | π‘ Medium | ||
| Longest Increasing Subsequence | π‘ Medium | ||
| Multidimensional DP | |||
| Triangle | π‘ Medium | ||
| Minimum Path Sum | π‘ Medium | ||
| Unique Paths II | π‘ Medium | ||
| Longest Palindromic Substring | π‘ Medium | ||
| Interleaving String | π‘ Medium | ||
| Edit Distance | π‘ Medium | ||
| Best Time to Buy and Sell Stock III | π΄ Hard | ||
| Best Time to Buy and Sell Stock IV | π΄ Hard | ||
| Maximal Square | π‘ Medium | ||
For any queries or suggestions:
Email: hiteshmahto786@gmail.com
LinkedIn: Hitesh Mahto's LinkedIn Profile