Skip to content

Suvraneel/LeetCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode

Documenting my LeetCode journey one problem at a time


Leetcode Problem Problem Statement C++ Solution
1 Two Sum Solution
2 Add Two Numbers Solution
7 Reverse Integer Solution
8 String to Integer Atoi Solution
9 Palindrome Number Solution
11 Container With most Water Solution
12 Integer to Roman Solution
13 Roman to Integer Solution
16 3sum Closest Solution
17 Letter Combinations of a Phone Number Solution
19 Remove Nth Node from End of List Solution
21 Merge Two Sorted Lists Solution
23 Merge K Sorted Lists Solution
24 Swap Nodes in Pairs Solution
26 Remove Duplicates from Sorted Array Solution
28 Find the Index of the First Occurrence in a String Solution
30 Substring With Concatenation of all Words Solution
32 Longest Valid Parentheses Solution
33 Search in Rotated Sorted Array Solution
35 Search Insert Position Solution
36 Valid Sudoku Solution
38 Count and Say Solution
42 Trapping Rain Water Solution
48 Rotate Image Solution
49 Group Anagrams Solution
56 Merge Intervals Solution
62 Unique Paths Solution
67 Add Binary Solution
68 Text Justification Solution
69 Sqrtx Solution
72 Edit Distance Solution
74 Search a 2d Matrix Solution
75 Sort Colors Solution
76 Minimum Window Substring Solution
77 Combinations Solution
78 Subsets Solution
79 Word Search Solution
80 Remove Duplicates from Sorted Array II Solution
84 Largest Rectangle in Histogram Solution
88 Merge Sorted Array Solution
91 Decode Ways Solution
94 Binary Tree Inorder Traversal Solution
95 Unique Binary Search Trees II Solution
97 Interleaving String Solution
98 Validate Binary Search Tree Solution
99 Recover Binary Search Tree Solution
100 Same Tree Solution
103 Binary Tree Zigzag Level Order Traversal Solution
104 Maximum Depth of Binary Tree Solution
108 Convert Sorted Array to Binary Search Tree Solution
109 Convert Sorted List to Binary Search Tree Solution
111 Minimum Depth of Binary Tree Solution
112 Path Sum Solution
113 Path Sum II Solution
116 Populating Next Right Pointers in each Node Solution
121 Best Time to Buy and Sell Stock Solution
125 Valid Palindrome Solution
126 Word Ladder II Solution
131 Palindrome Partitioning Solution
134 Gas Station Solution
136 Single Number Solution
137 Single Number II Solution
139 Word Break Solution
141 Linked List Cycle Solution
142 Linked List Cycle II Solution
143 Reorder List Solution
144 Binary Tree Preorder Traversal Solution
147 Insertion Sort List Solution
149 Max Points on a Line Solution
150 Evaluate Reverse Polish Notation Solution
151 Reverse Words in a String Solution
160 Intersection of Two Linked Lists Solution
173 Binary Search Tree Iterator Solution
175 Combine Two Tables Solution
188 Best Time to Buy and Sell Stock IV Solution
189 Rotate Array Solution
200 Number of Islands Solution
203 Remove Linked List Elements Solution
209 Minimum Size Subarray Sum Solution
210 Course Schedule II Solution
212 Word Search II Solution
218 The Skyline Problem Solution
219 Contains Duplicate II Solution
221 Maximal Square Solution
222 Count Complete Tree Nodes Solution
223 Rectangle Area Solution
224 Basic Calculator Solution
226 Invert Binary Tree Solution
227 Basic Calculator II Solution
230 Kth Smallest Element in a Bst Solution
234 Palindrome Linked List Solution
235 Lowest Common Ancestor of a Binary Search Tree Solution
236 Lowest Common Ancestor of a Binary Tree Solution
237 Delete Node in a Linked List Solution
239 Sliding Window Maximum Solution
242 Valid Anagram Solution
258 Add Digits Solution
263 Ugly Number Solution
278 First Bad Version Solution
279 Perfect Squares Solution
287 Find the Duplicate Number Solution
290 Word Pattern Solution
295 Find Median from Data Stream Solution
300 Longest Increasing Subsequence Solution
307 Range Sum Query Mutable Solution
309 Best Time to Buy and Sell Stock With Cooldown Solution
310 Minimum Height Trees Solution
312 Burst Balloons Solution
319 Bulb Switcher Solution
326 Power of Three Solution
334 Increasing Triplet Subsequence Solution
336 Palindrome Pairs Solution
342 Power of Four Solution
344 Reverse String Solution
345 Reverse Vowels of a String Solution
349 Intersection of Two Arrays Solution
363 Max Sum of Rectangle no Larger than K Solution
373 Find K Pairs With Smallest Sums Solution
374 Guess Number Higher or Lower Solution
377 Combination Sum IV Solution
378 Kth Smallest Element in a Sorted Matrix Solution
380 Insert Delete Getrandom O1 Solution
382 Linked List Random Node Solution
383 Ransom Note Solution
387 First Unique Character in a String Solution
389 Find the Difference Solution
392 IS Subsequence Solution
393 Utf 8 Validation Solution
394 Decode String Solution
402 Remove K Digits Solution
427 Construct Quad Tree Solution
429 N Ary Tree Level Order Traversal Solution
433 Minimum Genetic Mutation Solution
438 Find all Anagrams in a String Solution
441 Arranging Coins Solution
443 String Compression Solution
446 Arithmetic Slices II Subsequence Solution
451 Sort Characters by Frequency Solution
452 Minimum Number of Arrows to Burst Balloons Solution
458 Poor Pigs Solution
472 Concatenated Words Solution
476 Number Complement Solution
486 Predict the Winner Solution
502 IPO Solution
520 Detect Capital Solution
523 Continuous Subarray Sum Solution
525 Contiguous Array Solution
532 K Diff Pairs in an Array Solution
535 Encode and Decode Tinyurl Solution
540 Single Element in a Sorted Array Solution
557 Reverse Words in a String III Solution
560 Subarray Sum Equals K Solution
567 Permutation in String Solution
587 Erect the Fence Solution
605 Can Place Flowers Solution
606 Construct String from Binary Tree Solution
609 Find Duplicate File in System Solution
622 Design Circular Queue Solution
623 Add One Row to Tree Solution
637 Average of Levels in Binary Tree Solution
643 Maximum Average Subarray I Solution
645 Set Mismatch Solution
652 Find Duplicate Subtrees Solution
653 Two Sum IV Input IS a Bst Solution
658 Find K Closest Elements Solution
659 Split Array Into Consecutive Subsequences Solution
664 Strange Printer Solution
692 Top K Frequent Words Solution
701 Insert Into a Binary Search Tree Solution
704 Binary Search Solution
705 Design Hashset Solution
712 Minimum Ascii Delete Sum for Two Strings Solution
718 Maximum Length of Repeated Subarray Solution
732 My Calendar III Solution
739 Daily Temperatures Solution
763 Partition Labels Solution
766 Toeplitz Matrix Solution
771 Jewels and Stones Solution
783 Minimum Distance Between Bst Nodes Solution
787 Cheapest Flights Within K Stops Solution
790 Domino and Tromino Tiling Solution
797 All Paths from Source to Target Solution
802 K Th Smallest Prime Fraction Solution
804 Unique Morse Code Words Solution
814 Binary Tree Pruning Solution
834 Sum of Distances in Tree Solution
835 Image Overlap Solution
838 Push Dominoes Solution
841 Keys and Rooms Solution
858 Mirror Reflection Solution
869 Reordered Power of 2 Solution
871 Minimum Number of Refueling Stops Solution
875 Koko Eating Bananas Solution
876 Middle of the Linked List Solution
879 Profitable Schemes Solution
886 Possible Bipartition Solution
890 Find and Replace Pattern Solution
893 All Nodes Distance K in Binary Tree Solution
897 Increasing Order Search Tree Solution
899 Orderly Queue Solution
901 Online Stock Span Solution
902 Numbers at most N Given Digit Set Solution
904 Fruit Into Baskets Solution
907 Sum of Subarray Minimums Solution
908 Middle of the Linked List Solution
909 Snakes and Ladders Solution
912 Sort an Array Solution
916 Word Subsets Solution
918 Maximum Sum Circular Subarray Solution
922 Sort Array by Parity II Solution
936 Stamping the Sequence Solution
941 Valid Mountain Array Solution
944 Delete Columns to Make Sorted Solution
947 Most Stones Removed With same Row or Column Solution
948 Bag of Tokens Solution
956 Number of Music Playlists Solution
958 Sort Array by Parity II Solution
967 Numbers With same Consecutive Differences Solution
973 K Closest Points to Origin Solution
974 Subarray Sums Divisible by K Solution
976 Largest Perimeter Triangle Solution
980 Unique Paths III Solution
981 Time Based Key Value Store Solution
985 Sum of Even Numbers After Queries Solution
987 Vertical Order Traversal of a Binary Tree Solution
989 Add to Array Form of Integer Solution
990 Satisfiability of Equality Equations Solution
997 Find the Town Judge Solution
1004 Max Consecutive Ones III Solution
1009 Complement of Base 10 Integer Solution
1010 Pairs of Songs With Total Durations Divisible by 60 Solution
1011 Capacity to Ship Packages Within D Days Solution
1015 Smallest Integer Divisible by K Solution
1022 Sum of Root to Leaf Binary Numbers Solution
1026 Maximum Difference Between Node and Ancestor Solution
1041 Robot Bounded in Circle Solution
1047 Remove all Adjacent Duplicates in String Solution
1071 Greatest Common Divisor of Strings Solution
1094 Car Pooling Solution
1129 Shortest Path With Alternating Colors Solution
1137 N Th Tribonacci Number Solution
1155 Number of Dice Rolls With Target Sum Solution
1162 As Far from Land As Possible Solution
1200 Minimum Absolute Difference Solution
1207 Unique Number of Occurrences Solution
1235 Maximum Profit in Job Scheduling Solution
1239 Maximum Length of a Concatenated String With Unique Characters Solution
1291 Sequential Digits Solution
1293 Shortest Path in a Grid With Obstacles Elimination Solution
1305 All Elements in Two Binary Search Trees Solution
1312 Minimum Insertion Steps to Make a String Palindrome Solution
1323 Maximum 69 Number Solution
1328 Break a Palindrome Solution
1329 Sort the Matrix Diagonally Solution
1335 Minimum Difficulty of a Job Schedule Solution
1338 Reduce Array Size to the Half Solution
1345 Jump Game IV Solution
1365 How Many Numbers Are Smaller than the Current Number Solution
1396 Design Underground System Solution
1416 Restore the Array Solution
1418 Fair Distribution of Cookies Solution
1443 Minimum Time to Collect all Apples in a Tree Solution
1448 Count Good Nodes in Binary Tree Solution
1457 Pseudo Palindromic Paths in a Binary Tree Solution
1463 Cherry Pickup II Solution
1482 Minimum Number of Days to Make M Bouquets Solution
1510 Stone Game IV Solution
1514 Path With Maximum Probability Solution
1519 Number of Nodes in the Sub Tree With the same Label Solution
1523 Count Odd Numbers in an Interval Range Solution
1531 String Compression II Solution
1544 Make the String Great Solution
1578 Minimum Time to Make Rope Colorful Solution
1584 Min Cost to Connect all Points Solution
1586 Longest Subarray of 1s After Deleting One Element Solution
1627 Last Moment Before all Ants Fall out of a Plank Solution
1657 Determine IF Two Strings Are Close Solution
1662 Check IF Two String Arrays Are Equivalent Solution
1672 Richest Customer Wealth Solution
1680 Concatenation of Consecutive Binary Numbers Solution
1704 Determine IF String Halves Are Alike Solution
1706 Where will the Ball Fall Solution
1723 Maximum Number of Achievable Transfer Requests Solution
1770 Minimum Deletions to Make Character Frequencies Unique Solution
1776 Minimum Operations to Reduce X to Zero Solution
1832 Check IF the Sentence IS Pangram Solution
1833 Maximum ICE Cream Bars Solution
1834 Single Threaded Cpu Solution
1926 Nearest Exit from Entrance in Maze Solution
1962 Remove Stones to Minimize the Total Solution
1971 Find IF Path Exists in Graph Solution
1996 The Number of Weak Characters in the Game Solution
2000 Minimum Speed to Arrive on Time Solution
2007 Find Original Array from Doubled Array Solution
2095 Delete the Middle Node of a Linked List Solution
2101 Last Day where You can Still Cross Solution
2131 Longest Palindrome by Concatenating Two Letter Words Solution
2134 Maximize the Confusion of an Exam Solution
2136 Earliest Possible Day of Full Bloom Solution
2225 Find Players With Zero or One Losses Solution
2244 Minimum Rounds to Complete all Tasks Solution
2246 Longest Path With Different Adjacent Characters Solution
2256 Minimum Average Difference Solution
2259 Remove Digit from Number to Maximize Result Solution
2260 Minimum Consecutive Cards to Pick up Solution
2279 Maximum Bags With Full Capacity of Rocks Solution
2306 Naming a Company Solution
2336 Smallest Number in Infinite Set Solution
2347 Count Nodes Equal to Average of Subtree Solution
2348 Number of Zero Filled Subarrays Solution
2359 Find Closest Node to Given Two Nodes Solution
2360 Substring With Largest Variance Solution
2373 Largest Local Values in a Matrix Solution
2389 Longest Subsequence With Limited Sum Solution
2421 Number of Good Paths Solution
2456 Most Popular Video Creator Solution
2461 Maximum Sum of Distinct Subarrays With Length K Solution
2462 Total Cost to Hire K Workers Solution
2469 Convert the Temperature Solution
2470 Number of Subarrays With Lcm Equal to K Solution
2471 Minimum Number of Operations to Sort a Binary Tree by Level Solution
2475 Number of Unequal Triplets in Array Solution
2476 Closest Nodes Queries in a Binary Search Tree Solution
2485 Find the Pivot Integer Solution
2486 Append Characters to String to Make Subsequence Solution
2519 Find the Original Array of Prefix Xor Solution
2520 Count the Digits That Divide a Number Solution
2521 Distinct Prime Factors of Product of Array Solution
2522 Partition String Into Substrings With Values at most K Solution
2544 Alternating Digit Sum Solution
2545 Sort the Students by Their Kth Score Solution
2546 Apply Bitwise Operations to Make Strings Equal Solution
2558 Take Gifts from the Richest Pile Solution
2559 Count Vowel Strings in Ranges Solution
2681 Put Marbles in Bags Solution

About

Documenting my LeetCode journey one problem at a time

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published