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

Problems

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