Skip to content

This repository consists of the Leetcode solutions for the Data Structures & Algorithms solved with Java.

License

Notifications You must be signed in to change notification settings

SahilRathod17/Leetcode_Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Solutions for Leetcode Questions

If you like this repository then drop a star and don't forget to follow me !

Problems & Solutiuons

# Problem Category Difficulty Solution
2235 Add Two Integers Math Easy Solution
1281 Subtract the Product and Sum of Digits of an Integer Loops, Math Easy Solution
338 Counting Bits Bit Manipulation Easy Solution
9 Palindrome Number Math, Loops Easy Solution
1 Two-Sum Array Easy Solution
561 Array Partition Array Easy Solution
1295 Find Numbers with Even Number of Digits Array Easy Solution
1672 Richest Customer Wealth Array Easy Solution
1920 Build Array from Permutation Array Easy Solution
1929 Concatenation of Array Array Easy Solution
1480 Running Sum of 1d Array Array Easy Solution
387 First Unique Character in a String Array Easy Solution
1470 Shuffle the Array Array Easy Solution
804 Unique Morse Code Words Array Easy Solution
1512 Number of Good Pairs Array Easy Solution
485 Max Consecutive Ones Array Easy Solution
1365 How Many Numbers Are Smaller Than the Current Number Array Easy Solution
1389 Create Target Array in the Given Order Array Easy Solution
1832 Check if the Sentence Is Pangram Array Easy Solution
1773 Count Items Matching a Rule Array, String Easy Solution
1732 Find the Highest Altitude Array, Prfix Sum Easy Solution
832 Flipping an Image Array, Matrix Easy Solution
234 Palindrome Linked List LinkedList, Two Pointer, Recursion, Stack Easy Solution
342 Power of Four Math, Bit Manipulation, Recursion Easy Solution
383 Ransom Note Hash Table, Counting, String Easy Solution
326 Power of Three Math, Recursion Easy Solution
1252 Cells with Odd Values in a Matrix Array, Math Easy Solution
1572 Matrix Diagonal Sum Array, Matrix Easy Solution
867 Transpose Matrix Array, Matrix, Simulation Easy Solution
989 Add to Array-Form of Integer Array, Math Easy Solution
1854 Maximum Population Year Array, Counting Easy Solution
1886 Determine Whether Matrix Can Be Obtained By Rotation Array, Matrix Easy Solution
26 Remove Duplicate from Sorted Array Array, Two Pointers Easy Solution
66 Plus One Math, Array Easy Solution
724 Find Pivot Index Array, Prefix Sum Easy Solution
463 Island Perimeter Array, Matrix Easy Solution
136 Single Number Array, Bit Manipulation Easy Solution
27 Remove Element Array, Two Pointers Easy Solution
217 Contains Duplicate Array, Hash Table, Sorting Easy Solution
219 Contains Duplicate II Array, Hash Table, Sliding Window Easy Solution
977 Squares of a Sorted Array Array, Two Pointers, Sorting Easy Solution
121 Best Time to Buy and Sell Stock Array (Without DP) Easy Solution
448 Find All Numbers Disappeared in an Array Array, Hash Table Easy Solution
645 Set Mismatch Array, Hash Table, Bit Manipulation, Sorting Easy Solution
704 Binary Search Array, Binary Search Easy Solution
69 Sqrt(x) Math, Binary Search Easy Solution
374 Guess Number Higher or Lower Binary Search Easy Solution
278 First Bad Version Binary Search Easy Solution
744 Find Smallest Letter Greater Than Target Array, Binary Search Easy Solution
1351 Count Negative Numbers in a Sorted Matrix Array, Binary Search, Matrix Easy Solution
349 Intersection of Two Array Array, Binary Search,Two Pointers, Hash Table, Sorting Easy Solution
350 Intersection of Two Arrays II Array, Hash Table, Two Pointers, Binary Search, Sorting Easy Solution
268 Missing Number Array, Binary Search, Math, Hash Table, Sorting, Bit Manipulation Easy Solution
441 Arranging Coins Array, Binary Search Easy Solution
35 Search Insert Position Array, Binary Search Easy Solution
169 Majority Element Array, Moore Voting Algorithm Easy Solution
1108 Defanging an IP Address String Easy Solution
520 Detect Capital Strings Easy Solution
344 Reverse String Two Pointers, String Easy Solution
412 Fizz Buzz String, Math, Simulation Easy Solution
859 Buddy Strings Strings, Hash Table Easy Solution
13 Roman to Integer String, Hash Table, Math Easy Solution
1768 Merge Strings Alternately String, Two Pointers Easy Solution
1528 Shuffle String Array, String Easy Solution
7 Reverse Integer Math, Loops Medium Solution
172 Factorial Trailing Zeroes Math, Loops Medium Solution
50 Pow(x,n) Math, Loops (Without Recursion) Medium Solution
869 Reordered Power of 2 Math, Sorting Medium Solution
1338 Reduce Array Size to The Half Array Medium Solution
659 Split Array into Consecutive Subsequences Array Medium Solution
1329 Sort the Matrix Diagonally Array, Sorting, Matrix Medium Solution
48 Rotate Image Array, Math, Matrix Medium Solution
55 Jump Game Array, DP, Greedy Medium Solution
75 Sort Colors Array, Two Pointers, Sorting Medium Solution
137 Single Number II Array, Bit Manipulation Medium Solution
1493 Longest Subarray of 1's After Deleting One Element Array (Without DP) Medium Solution
442 Find All Duplicate in an Array Array, Hash Table Medium Solution
189 Rotate Array Array, Math, Two Pointers Medium Solution
34 Find First and Last Position of Element in Sorted Array Array, Binary Search Medium Solution
852 Peak Index in a Mountain Array Array, Binary Search Medium Solution
162 Find Peak Element Array, Binary Search Medium Solution
33 Search in Rotated Sorted Array Array, Binary Search Medium Solution
81 Search in Rotated Sorted Array II Array, Binary Search Medium Solution
153 Find Minimum in Rotated Sorted Array Array, Binary Search Medium Solution
754 Reach a Number Math, Binary Search Medium Solution
74 Search a 2D Matrix Array, Binary Search, Matrix Medium Solution
436 Find Right Interval Array, Binary Search, Sorting Medium Solution
209 Minimum Size Subarray Sum Array, Binary Search, Prefix Sum, SW Medium Solution
2300 Successful Pairs of Spells and Potions Array, Binary Search, Sorting, Two Pointers Medium Solution
287 Find the Duplicate Number Array, Binary Search, Two Pointers, Bit Manipulation Medium Solution
707 Design Linked List Linked List, Design Medium Solution
363 Max Sum of Rectangle No Larger Than K Array, Binary Search, Matrix, Prefix Sum, Ordered Set Hard Solution
871 Minimum Number of Refueling Stops Array, DP Hard Solution
41 First Missing Number Array, Hash Table Hard Solution
1095 Find in Mountain Array Array, Binary Search Hard Solution
410 Split Array Largest Sum Array, Binary Search, Prefix Sum Hard Solution
4 Median of Two Sorted Arrays Array, Binary Search Hard Solution
295 Find Median from Data Stream Two Pointers, Sorting, Heap(PQ), Data Stream Hard Solution