Skip to content

anishLearnsToCode/leetcode-algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode Algorithms

problems-solved problems-solved-java problems-solved-python PRs Welcome cp

πŸ”’ = Subscription Content

Problems

# Name Solution Youtube
1 Two Sum Java Python java-yt python-yt
7 Reverse Integer Java Python java-yt python-yt
9 PalindromeNumber Java Python
13 Roman To Integer Java Python java-yt python-yt
14 Longest Common Prefix Java Python
20 ValidParentheses Java Python
21 Merge 2 Sorted Lists Java Python
26 Remove Duplicates From Sorted Array Java Python
27 Remove Element Java Python
28 Needle in Haystack Java Python
35 Search Inserted Position Java Python
38 Count and Say Java Python
53 Maximum SubArray Java Python
58 Length of Last Word Java Python
66 Plus One Java Python
67 Add Binary Java Python
69 Sqrt(x) Java Python
70 Climbing Stairs Java Python
83 Remove Duplicates from Sorted List Java Python
88 Merge Sorted Array Java Python
94 Binary Tree Inorder Traversal Java Python
100 Same Tree Java Python
101 Symmetric Tree Java Python
104 Maximum Depth of Binary Tree Java Python
107 Binary Tree Level Order Traversal II Java Python
108 Convert Sorted Array To Binary Search Tree Java Python
110 Balanced Binary Tree Java Python
111 Minimum Depth of Binary Tree Java Python
112 Path Sum Java Python
118 Pascal's Triangle Java Python
119 Pascal's Triangle II Java Python
121 Best Time to Buy and Sell Stocks Java Python
122 Best Time to Buy and Sell Stocks II Java Python
125 Valid Palindrome Java Python
136 Single Number Java Python
141 Linked List Cycle Java Python
144 Binary Tree Preorder Traversal Java Python
145 Binary Tree Postorder Traversal Java Python
155 Min Stack Java Python
157 Read N Characters Given Read4
160 Intersection of Two Linked Lists Java Python
167 Two Sum II - Input Array is Sorted Java Python
168 Excel Sheet Column Title Java Python
169 Majority Element Java Python
170 πŸ”’ Two Sum III - Data Structure Design
171 Excel Sheet Column Number Java Python
172 Factoring Trailing Zeroes Java Python
189 Rotate Array Java Python
190 Reverse Bits Java Python
191 Number of One Bits Java Python
198 House Robber Java Python
202 Happy Number Java Python
203 Remove Linked List Elements Java Python
204 Count Primes Java Python
205 Isomorphic Strings Java Python
206 Reverse Linked Lists Java Python
217 Contains Duplicate Java Python
219 Contains Duplicate II Java Python
225 Implement Stack using Queues Java Python
226 Invert Binary Tree Java Python
226 Summary Ranges Java Python
231 Power of Two Java Python
232 Implement Queue Using Stacks Java Python
234 Palindrome Linked Lists Java Python
235 Lowest Common Ancestor of a Binary Search Tree Java Python
237 Delete a Node In A Linked List Java Python
242 Valid Anagram Java Python
243 πŸ”’ Shortest Word Distance
246 πŸ”’ Strobogramatic Number
252 πŸ”’ Meeting Rooms
256 πŸ”’ Paint House
257 Binary Tree Paths Java Python
258 Add Digits Java Python
263 Ugly Number Java Python
266 πŸ”’ Palindrome Permutation
268 Missing Number Java Python
270 πŸ”’ Closest Binary Search Tree Value
276 πŸ”’ Paint Fence
278 First Bad Version Java Python
283 Move Zeroes Java Python
290 Word Pattern Java Python
292 Nim Game Java Python
293 πŸ”’ Flip Game
299 Bulls and Cows Java Python
303 Range Sum Query - Immutable Java Python
326 Power of Three Java Python
326 Counting Bits Java Python
339 πŸ”’ Nested List Weight Sum
342 Power of Four Java Python
344 Reverse A String Java Python
345 Reverse Vowels of A String Java Python
346 πŸ”’ Moving Average From Data Stream
349 Intersection of 2 Arrays Java Python
350 Intersection of 2 Arrays II Java Python
359 πŸ”’ Logger Rate Limiter
367 Valid Perfect Square Java Python
374 Guess Number Higher or Lower Java Python
383 Ransom Note Java Python
387 First Unique Character in String Java Python
389 Find the Difference Java Python
392 Is Subsequence Java Python
401 Binary Watch Java Python
404 Sum of Left Leaves Java Python
405 Convert a Number to Hexadecimal Java Python
408 πŸ”’ Valid Word Abbreviation
409 Longest Palindrome Java Python
412 Fizz Buzz Java Python
414 Third Maximum Number Java Python
415 Add Strings Java Python
422 πŸ”’ Valid Word Square
434 Number of Segments in a String Java Python
441 Arranging Coins Java Python
443 String Compression Java Python
447 Number of Boomerangs Java Python
448 Find All Numbers Disappeared in an Array Java Python
453 Minimum Moves to Equal Array Elements Java Python
455 Assign Cookies Java Python
459 Repeated Substring Pattern Java Python
461 Hamming Distance Java Python
463 Island Perimeter Java Python
475 Heaters Java Python
476 Number Complement Java Python
482 License Key Formatting Java Python
485 Max Consecutive Ones Java Python
492 Construct the Rectangle Java Python
495 Teemo Attacking Java Python
496 Next Greater Element I Java Python
500 Keyboard Row Java Python
501 Find Mode in Binary Search Tree Java Python
504 Base 7 Java Python
506 Relative Ranks Java Python
507 Perfect Number Java Python
509 Fibonacci Number Java Python
520 Detect Capital Java Python
521 Longest Uncommon Subsequence I Java Python
530 Minimum Absolute Difference in BST Java Python
532 K - Diff Pairs in Array Java Python
538 Convert BST to Greater Tree Java Python
541 Reverse String II Java Python
543 Diameter of Binary Tree Java Python
551 Student Attendance Record I Java Python
557 Reverse Words in a String III Java Python
559 Maximum Depth of N-Ary Tree Java Python
561 Array Partition I Java Python
563 Binary Tree Tilt Java Python
566 Reshape The Matrix Java Python
572 Subtree of Another Tree Java Python
575 Distribute Candies Java Python
581 Shortest Unsorted Continuous Subarray Java Python
589 N-Ary Tree Preorder Traversal Java Python
590 N-Ary Tree Postorder Traversal Java Python
594 Longest Harmonious Subsequence Java Python
598 Range Addition II Java Python
599 Minimum Index Sum of 2 Lists Java Python
604 πŸ”’ Design Compressed String Iterator
605 Can Place Flowers Java Python
606 Construct String from Binary Tree Java Python
617 Merge Two Binary Trees Java Python
624 πŸ”’ Maximum Distance in Arrays
628 Maximum Product of Three Numbers Java Python
633 Sum Square Numbers Java Python
637 Average of Levels in Binary Tree Java Python
643 Maximum Average SubArray I Java Python
645 Set Mismatch Java Python
653 Two Sum IV - Input is a BST Java Python
657 Robot Return to Origin Java Python
661 Image Smoother Java Python
665 Non Deceasing Array Java Python
669 Trim a Binary Search Tree Java Python
671 Second Minimum Node in Binary Tree Java Python
674 Longest Continuous Increasing Subsequence Java Python
680 Valid Palindrome II Java Python
682 Baseball Game Java Python
686 Repeated String Match
687 Longest Univalue Path
690 Employee Importance
693 Binary Number with Alternating Bits Java Python
696 Count Binary Substrings Java Python
697 Degree of an Array Java Python
700 Search in a Binary Search Tree
703 Kth Largest Element in a Stream
704 Binary Search
705 Design HashSet
706 Design HashMap
709 To Lower Case
716 Max Stack
717 1-bit and 2-bit Characters
720 Longest Word in Dictionary
724 Find Pivot Index
728 Self Dividing Numbers
733 Flood Fill
734 Sentence Similarity
744 Find Smallest Letter Greater Than Target
746 Min Cost Climbing Stairs
747 Largest Number at least twize of Others
748 Shortest Completing Word
758 Bold Words in String
760 Find Anagram Mappings
762 Prime Number of Set Bits in Primary Representation
766 Toeplitz Matrix
771 Jewels and Stones
783 Minimum Distance Between BST Nodes Java Python
788 Rotated Digits
796 Rotate String
800 Similar RGB Color
804 Unique Morse Code Words
806 Number of Lines to Write String
811 Subdomain Visit Count
812 Largest Triangle Area
819 Most Common Word
821 Shortest Distance to Character
824 Goat Latin
830 Positions of Large Groups
832 Flipping an Image
836 Rectangle Overlap
840 Magic Squares in Grid
844 Backspace String Compare
849 Maximize Distance to Closest Person
852 Peak Index in Mountain Array
859 Buddy Strings
860 Lemonade Change
867 Transpose Matrix
868 Binary Gap
872 Leaf-Similar Trees
874 Walking Robot Simulation
876 Middle of the Linked List
883 Projection Area of 3D Shapes
884 Uncommon Words from 2 Sentences
888 Fair Candy Swap
892 Surface Area of 3D Shapes
893 Groups of Special Equivalent Strings
896 Monotonic Array
897 Increasing Order Search Tree
905 Sort Array by Parity
908 Smallest Range I
914 X of a kind in a Deck of Cards
917 Reverse Only Letters
922 Sort Array by Parity II
925 Long Pressed Name
929 Unique Email Addresses
933 Number of Recent Calls
937 Reorder Data In Log Files
938 Range Sum of BST
941 Valid Mountain Array
942 DI String Match
944 Delete Columns to Make Sorted
949 Largest Time for Given Digits
953 Verifying an Alien Dictionary
961 N-Repeated Elements in Size 2N Array
965 Univalued Binary Tree
970 Powerful Integers
976 Largest Perimeter Triangle
977 Squares of a Sorted Array
985 Sum of Even Numbers after Queries
989 Add to Array Form of Integer
993 Cousins in Binary Tree
997 Find the Town Judge
999 Available Captures for Rook
1002 Find Common Characters
1005 Maximize Sum of Array After K Negations
1009 Complement of Base 10 Integer Java
1010 Pairs of Songs With Total Durations Divisible by 60
1013 Partition Array into Three Parts with equal Sum
1018 Binary Prefix Divisible by 5
1021 Remove Outermost Parenthesis
1022 Sum of Root to Leaf Binary Numbers
1025 Divisor Game
1029 Two City Scheduling
1030 Matrix Cells in Distance Order
1033 Moving Stones Until Consecutive
1037 Valid Boomerang
1042 Flower Planting with no Adjacent
1046 Last Stone Weight
1047 Remove All adjacent Duplicates in String
1051 Height Checker
1056 Confusing Number
1064 Fixed Point
1065 Index Pairs of a String
1071 Greatest Common Divisors of Strings
1078 Occurrence After Bigram
1085 Sum of Digits in Minimum Number
1086 High Five
1089 Duplicate Zeroes
1099 Two Sum Less Than K
1103 Distribute Candies to People
1108 Defanging an IP Address
1118 Number of Days in a Month
1119 Remove Vowels From String
1122 Relative Sort Array
1128 Number of Equivalent Domino Pairs
1133 Largest Unique Number
1134 Armstrong Number
1137 Nth Tribonacci Number
1150 Check if Number is Majority Element in Sorted Array
1154 Day of The Year
1160 Find Words That Can Be Formed By Characters
1165 Single Row Keyboard
1170 Compare Strings By Frequency of the Smallest Character
1175 Prime Arrangements
1176 Diet Plan Performance
1180 Count Substrings with only one Distinct Letter
1184 Distance Between Bus Stops
1185 Day of the Week
1189 Maximum Number of Balloons
1196 How Many Apples Can You Put into the Basket
1200 Minimum Absolute Difference
1207 Unique Number of Occurrences
1213 Intersection of Three Sorted Arrays
1217 Play With Chips
1221 Split A String In Balanced Strings
1228 Missing A Number In Arithmetic Progression
1232 Check If It Is A Straight Line
1237 Find Positive Integer Solutions for a Given Equation
1243 Array Transformation
1252 Cells With Odd Values In Matrix
1260 Shift 2D Grid
1266 Minimum Time Visiting All Points
1271 Hexspeak
1275 Find Winner On a Tic Tac Toe Game
1281 Subtract the Product and Sum of Digits of a Integer
1287 Element Appearing More Than 25% in Sorted Array
1290 Convert Binary Number In A Linked List to Integer
1295 Find Numbers With Even Numbers of Digits
1299 Replace Elements With Greatest Element on Right Side
1304 Find N Unique Integers Sum Up To Zero
1309 Decrypt String From Alphabet To Integer Mapping
1313 Decompress Run-Length Encoded Strings
1317 Convert Integer to Sum Of Two Non-Zero Integers
1323 Maximum 69 Number
1331 Rank Transform of An Array
1332 Remove Palindromic Subsequences
1337 The K Weakest Rows In A Matrix
1342 Number of Steps to Reduce a Number to Zero
1346 Check if N and It's Double Exist
1351 Count Negative Numbers In A Sorted Matrix
1356 Sort Integers by Number of 1 Bits
1360 Number of Days Between Two Dates
1365 How Many Numbers Are Smaller Than Current Number
1370 Increasing Decreasing String
1374 Generate A String With Characters That Have Odd Count
1380 Lucky Numbers In A Matrix
1385 Find The Distance Value Between 2 Arrays
1389 Create Target Array in Given Order
1394 Find Lucky Integer In An Array
1399 Count Largest Group
1403 Minimum Subsequence in Non-Increasing Order
1408 String Matching In An Array
1413 Minimum Value To Get Positive Step By Step Sum
1417 Reformat The String
1422 Maximum Score After Splitting A String
1426 Counting Elements
1427 Performing String Shifts
1431 Kids With The Greatest Number Of Candies
1436 Destination City
1441 Build An Array With Stack Operation
1446 Consecutive Characters
1450 Number of Students Doing Homework at Given Time
1455 Check If Word Occurs as Prefix of any Word in Sentence
1460 Make 2 Arrays Equal by Reversing Sub Arrays
1464 Maximum Product of 2 Elements in Array
1469 Find All Lonely Nodes
1470 Shuffle The Array
1474 Delete N Nodes After M Nodes In A Linked List
1475 Final Prices With Special Discount in a Shop
1480 Running Sum of 1D Array
1486 XOR Operations in An Array
1491 Average Salary Excluding the Minimum and Maximum Salary
1496 Path Crossing
1502 Can Make Arithmetic Progression From Sequence
1507 Reformat Date
1512 Number of Good Pairs
1518 Water Bottles
1523 Count Odd Numbers In Interval Range
1528 Shuffle Strings
1534 Count Good Triplets
1539 Kth Missing Positive Number
1544 Make The String Great