Skip to content

foxfromworld/LeetCode-and-Algorithm

Repository files navigation

LeetCode Problems (Sorted by #)

# Title Difficulty
1 Two Sum Easy
2 Add Two Numbers Medium
3 Longest Substring Without Repeating Characters Medium
4 Median of Two Sorted Arrays Hard
5 Longest Palindromic Substring Medium
6 Zigzag Conversion Medium
7 Reverse Integer Easy
8 String to Integer (atoi) Medium
9 Palindrome Number Easy
11 Container With Most Water Medium
12 Integer to Roman Medium
13 Roman to Integer Easy
14 Longest Common Prefix Easy
15 3Sum Medium
16 3Sum Closest Medium
17 Letter Combinations of a Phone Number Medium
18 4Sum Medium
19 Remove Nth Node From End of List Medium
20 Valid Parentheses Easy
21 Merge Two Sorted Lists Easy
22 Generate Parentheses Medium
24 Swap Nodes in Pairs Medium
26 Remove Duplicates from Sorted Array Easy
27 Remove Element Easy
28 Implement strStr() Easy
29 Divide Two Integers Medium
31 Next Permutation Medium
33 Search in Rotated Sorted Array Medium
34 Find First and Last Position of Element in Sorted Array Medium
35 Search Insert Position Easy
36 Valid Sudoku Medium
38 Count and Say Medium
39 Combination Sum Medium
40 Combination Sum II Medium
43 Multiply Strings Medium
53 Maximum Subarray Easy
57 Insert Interval Medium
58 Length of Last Word Easy
59 Spiral Matrix II Medium
62 Unique Paths Medium
66 Plus One Easy
67 Add Binary Easy
69 Sqrt(x) Easy
70 Climbing Stairs Easy
71 Simplify Path Medium
73 Set Matrix Zeroes Medium
74 Search a 2D Matrix Medium
78 Subsets Medium
83 Remove Duplicates from Sorted List Easy
88 Merge Sorted Array Easy
94 Binary Tree Inorder Traversal Easy
98 Validate Binary Search Tree Medium
100 Same Tree Easy
101 Symmetric Tree Easy
104 Maximum Depth of Binary Tree Easy
108 Convert Sorted Array to Binary Search Tree Easy
110 Balanced Binary Tree Easy
111 Minimum Depth of Binary Tree Easy
112 Path Sum Easy
114 Flatten Binary Tree to Linked List Medium
118 Pascal's Triangle Easy
119 Pascal's Triangle II Easy
122 Best Time to Buy and Sell Stock II Medium
125 Valid Palindrome Easy
130 Surrounded Regions Medium
141 Linked List Cycle Easy
142 Linked List Cycle II Medium
151 Reverse Words in a String Medium
157 Read N Characters Given Read4 Easy
160 Intersection of Two Linked Lists Easy
163 Missing Ranges Easy
167 Two Sum II - Input array is sorted Easy
168 Excel Sheet Column Title Easy
169 Majority Element Easy
170 Two Sum III - Data structure design Easy
171 Excel Sheet Column Number Easy
176 Second Highest Salary Easy
190 Reverse Bits Easy
200 Number of Islands Medium
202 Happy Number Easy
205 Isomorphic Strings Easy
206 Reverse Linked List Easy
207 Course Schedule Medium
210 Course Schedule II Medium
215 Kth Largest Element in an Array Medium
217 Contains Duplicate Easy
219 Contains Duplicate II Easy
225 Implement Stack using Queues Easy
226 Invert Binary Tree Easy
228 Summary Ranges Easy
229 Majority Element II Medium
230 Kth Smallest Element in a BST Medium
231 Power of Two Easy
238 Product of Array Except Self Medium
242 Valid Anagram Easy
246 Strobogrammatic Number Easy
252 Meeting Rooms Easy
253 Meeting Rooms II Medium
257 Binary Tree Paths Easy
258 Add Digits Easy
266 Palindrome Permutation Easy
270 Closest Binary Search Tree Value Easy
285 Inorder Successor in BST Medium
299 Bulls and Cows Medium
308 Range Sum Query 2D - Mutable Hard
332 Reconstruct Itinerary Medium
340 Longest Substring with At Most K Distinct Characters Medium
343 Integer Break Medium
345 Reverse Vowels of a String Easy
346 Moving Average from Data Stream Easy
347 Top K Frequent Elements Medium
349 Intersection of Two Arrays Easy
350 Intersection of Two Arrays II Easy
353 Design Snake Game Medium
359 Logger Rate Limiter Easy
378 Kth Smallest Element in a Sorted Matrix Medium
388 Longest Absolute File Path Medium
399 Evaluate Division Medium
404 Sum of Left Leaves Easy
408 Valid Word Abbreviation Easy
412 Fizz Buzz.py Easy
415 Add Strings Easy
418 Sentence Screen Fitting Medium
450 Delete Node in a BST Medium
455 Assign Cookies Easy
482 License Key Formatting Easy
500 Keyboard Row Easy
501 Find Mode in Binary Search Tree Easy
504 Base 7 Easy
506 Relative Ranks Easy
509 Fibonacci Number Easy
520 Detect Capital Easy
531 Lonely Pixel I Medium
536 Construct Binary Tree from String Medium
547 Number of Provinces Medium
551 Student Attendance Record I Easy
560 Subarray Sum Equals K Medium
575 Distribute Candies Easy
598 Range Addition II Easy
617 Merge Two Binary Trees Easy
621 Task Scheduler Medium
634 Find the Derangement of An Array Medium
674 Longest Continuous Increasing Subsequence Easy
680 Valid Palindrome II Easy
681 Next Closest Time Medium
683 K Empty Slots Hard
686 Repeated String Match Medium
690 Employee Importance Easy
695 Max Area of Island Medium
696 Count Binary Substrings Easy
701 Insert into a Binary Search Tree Medium
703 Kth Largest Element in a Stream Easy
706 Design HashMap Easy
724 Find Pivot Index Easy
735 Asteroid Collision Medium
744 Find Smallest Letter Greater Than Target Easy
747 Largest Number At Least Twice of Others Easy
755 Pour Water Medium
784 Letter Case Permutation Medium
788 Rotated Digits Easy
792 Number of Matching Subsequences Medium
796 Rotate String Easy
804 Unique Morse Code Words Easy
821 Shortest Distance to a Character Easy
836 Rectangle Overlap Easy
843 Guess the Word Hard
848 Shifting Letters Medium
852 Peak Index in a Mountain Array Easy
853 Car Fleet Medium
860 Lemonade Change Easy
867 Transpose Matrix Easy
876 Middle of the Linked List Easy
904 Fruit Into Baskets Medium
917 Reverse Only Letters Medium
929 Unique Email Addresses Easy
937 Reorder Data in Log Files Easy
938 Range Sum of BST Easy
997 Find the Town Judge Easy
1002 Find Common Characters Easy
1005 Maximize Sum Of Array After K Negations Easy
1007 Minimum Domino Rotations For Equal Row Medium
1021 Remove Outermost Parentheses Easy
1048 Longest String Chain Medium
1057 Campus Bikes Medium
1058 Minimize Rounding Error to Meet Target Medium
1064 Fixed Point Easy
1086 High Five Easy
1110 Delete Nodes And Return Forest Medium
1114 Print in Order Easy
1118 Number of Days in a Month Easy
1119 Remove Vowels from a String Easy
1136 Parallel Courses Medium
1162 As Far from Land as Possible Medium
1170 Compare Strings by Frequency of the Smallest Character Easy
1184 Distance Between Bus Stops Easy
1189 Maximum Number of Balloons Easy
1217 Minimum Cost to Move Chips to The Same Position Easy
1237 Find Positive Integer Solution for a Given Equation Easy
1313 Decompress Run-Length Encoded List Easy
1344 Angle Between Hands of a Clock Medium
1346 Check If N and Its Double Exist Easy
1351 Count Negative Numbers in a Sorted Matrix Easy
1356 Sort Integers by The Number of 1 Bits Easy
1385 Find the Distance Value Between Two Arrays Easy
1394 Find Lucky Integer in an Array Easy
1417 Reformat The String Easy
1423 Maximum Points You Can Obtain from Cards Medium
1448 Count Good Nodes in Binary Tree Medium
1456 Maximum Number of Vowels in a Substring of Given Length Easy
1464 Maximum Product of Two Elements in an Array Easy
1469 Find All The Lonely Nodes Easy
1470 Shuffle the Array Easy
1475 Final Prices With a Special Discount in a Shop Easy
1491 Average Salary Excluding the Minimum and Maximum Salary Easy
1493 Longest Subarray of 1's After Deleting One Element Medium
1507 Reformat Date Easy
1509 Minimum Difference Between Largest and Smallest Value in Three Moves Medium
1525 Number of Good Ways to Split a String Medium
1576 Replace All ?'s to Avoid Consecutive Repeating Characters Easy
1592 Rearrange Spaces Between Words Easy
1603 Design Parking System Easy
1610 Maximum Number of Visible Points Hard
1631 Path With Minimum Effort Medium
1725 Number Of Rectangles That Can Form The Largest Square Easy
1732 Find the Highest Altitude Easy
1768 Merge Strings Alternately Easy
1773 Count Items Matching a Rule Easy
1776 Car Fleet II Hard
1791 Find Center of Star Graph Easy
1796 Second Largest Digit in a String Easy
1800 Maximum Ascending Subarray Sum Easy
1812 Determine Color of a Chessboard Square Easy
1822 Sign of the Product of an Array Easy
1844 Replace All Digits with Characters Easy
1863 Sum of All Subset XOR Totals Easy
1876 Substrings of Size Three with Distinct Characters Easy
1893 Check if All the Integers in a Range Are Covered Easy
1913 Maximum Product Difference Between Two Pairs Easy
1920 Build Array from Permutation Easy
1945 Sum of Digits of String After Convert Easy
1957 Delete Characters to Make Fancy String Easy
1961 Check If String Is a Prefix of Array Easy
2000 Reverse Prefix of Word Easy
2006 Count Number of Pairs With Absolute Difference K Easy
2011 Final Value of Variable After Performing Operations Easy
2016 Maximum Difference Between Increasing Elements Easy
2027 Minimum Moves to Convert String Easy
2042 Check if Numbers Are Ascending in a Sentence Easy
2048 Next Greater Numerically Balanced Number Medium

LeetCode Problems (Categorized by Difficulty)

Easy

# Title
1 Two Sum
7 Reverse Integer
9 Palindrome Number
13 Roman to Integer
14 Longest Common Prefix
20 Valid Parentheses
21 Merge Two Sorted Lists
26 Remove Duplicates from Sorted Array
27 Remove Element
28 Implement strStr()
35 Search Insert Position
53 Maximum Subarray
58 Length of Last Word
66 Plus One
67 Add Binary
69 Sqrt(x)
70 Climbing Stairs
83 Remove Duplicates from Sorted List
88 Merge Sorted Array
94 Binary Tree Inorder Traversal
100 Same Tree
101 Symmetric Tree
104 Maximum Depth of Binary Tree
108 Convert Sorted Array to Binary Search Tree
110 Balanced Binary Tree
111 Minimum Depth of Binary Tree
112 Path Sum
118 Pascal's Triangle
119 Pascal's Triangle II
125 Valid Palindrome
141 Linked List Cycle
157 Read N Characters Given Read4
160 Intersection of Two Linked Lists
163 Missing Ranges
167 Two Sum II - Input array is sorted
168 Excel Sheet Column Title
169 Majority Element
170 Two Sum III - Data structure design
171 Excel Sheet Column Number
176 Second Highest Salary
190 Reverse Bits
202 Happy Number
205 Isomorphic Strings
206 Reverse Linked List
217 Contains Duplicate
219 Contains Duplicate II
225 Implement Stack using Queues
226 Invert Binary Tree
228 Summary Ranges
231 Power of Two
242 Valid Anagram
246 Strobogrammatic Number
252 Meeting Rooms
257 Binary Tree Paths
258 Add Digits
266 Palindrome Permutation
270 Closest Binary Search Tree Value
343 Integer Break
345 Reverse Vowels of a String
346 Moving Average from Data Stream
349 Intersection of Two Arrays
350 Intersection of Two Arrays II
359 Logger Rate Limiter
404 Sum of Left Leaves
408 Valid Word Abbreviation
412 Fizz Buzz.py
415 Add Strings
455 Assign Cookies
482 License Key Formatting
500 Keyboard Row
501 Find Mode in Binary Search Tree
504 Base 7
506 Relative Ranks
509 Fibonacci Number
520 Detect Capital
551 Student Attendance Record I
575 Distribute Candies
598 Range Addition II
617 Merge Two Binary Trees
621 Task Scheduler
674 Longest Continuous Increasing Subsequence
680 Valid Palindrome II
690 Employee Importance
696 Count Binary Substrings
703 Kth Largest Element in a Stream
706 Design HashMap
724 Find Pivot Index
744 Find Smallest Letter Greater Than Target
747 Largest Number At Least Twice of Others
788 Rotated Digits
796 Rotate String
804 Unique Morse Code Words
821 Shortest Distance to a Character
836 Rectangle Overlap
852 Peak Index in a Mountain Array
860 Lemonade Change
867 Transpose Matrix
876 Middle of the Linked List
929 Unique Email Addresses
937 Reorder Data in Log Files
938 Range Sum of BST
997 Find the Town Judge
1002 Find Common Characters
1005 Maximize Sum Of Array After K Negations
1021 Remove Outermost Parentheses
1064 Fixed Point
1086 High Five
1114 Print in Order
1118 Number of Days in a Month
1119 Remove Vowels from a String
1170 Compare Strings by Frequency of the Smallest Character
1184 Distance Between Bus Stops
1189 Maximum Number of Balloons
1217 Minimum Cost to Move Chips to The Same Position
1237 Find Positive Integer Solution for a Given Equation
1313 Decompress Run-Length Encoded List
1346 Check If N and Its Double Exist
1351 Count Negative Numbers in a Sorted Matrix
1356 Sort Integers by The Number of 1 Bits
1385 Find the Distance Value Between Two Arrays
1394 Find Lucky Integer in an Array
1417 Reformat The String
1456 Maximum Number of Vowels in a Substring of Given Length
1464 Maximum Product of Two Elements in an Array
1469 Find All The Lonely Nodes
1470 Shuffle the Array
1475 Final Prices With a Special Discount in a Shop
1491 Average Salary Excluding the Minimum and Maximum Salary
1507 Reformat Date
1576 Replace All ?'s to Avoid Consecutive Repeating Characters
1592 Rearrange Spaces Between Words
1603 Design Parking System
1725 Number Of Rectangles That Can Form The Largest Square
1732 Find the Highest Altitude
1768 Merge Strings Alternately
1773 Count Items Matching a Rule
1791 Find Center of Star Graph
1796 Second Largest Digit in a String
1800 Maximum Ascending Subarray Sum
1812 Determine Color of a Chessboard Square
1822 Sign of the Product of an Array
1844 Replace All Digits with Characters
1863 Sum of All Subset XOR Totals
1876 Substrings of Size Three with Distinct Characters
1893 Check if All the Integers in a Range Are Covered
1913 Maximum Product Difference Between Two Pairs
1920 Build Array from Permutation
1945 Sum of Digits of String After Convert
1957 Delete Characters to Make Fancy String
1961 Check If String Is a Prefix of Array
2000 Reverse Prefix of Word
2006 Count Number of Pairs With Absolute Difference K
2011 Final Value of Variable After Performing Operations
2016 Maximum Difference Between Increasing Elements
2027 Minimum Moves to Convert String
2042 Check if Numbers Are Ascending in a Sentence

Medium

# Title
2 Add Two Numbers
3 Longest Substring Without Repeating Characters
5 Longest Palindromic Substring
6 Zigzag Conversion
8 String to Integer (atoi)
11 Container With Most Water
12 Integer to Roman
15 3Sum
16 3Sum Closest
17 Letter Combinations of a Phone Number
18 4Sum
19 Remove Nth Node From End of List
22 Generate Parentheses
24 Swap Nodes in Pairs
29 Divide Two Integers
31 Next Permutation
33 Search in Rotated Sorted Array
34 Find First and Last Position of Element in Sorted Array
36 Valid Sudoku
38 Count and Say
39 Combination Sum
40 Combination Sum II
43 Multiply Strings
57 Insert Interval
59 Spiral Matrix II
62 Unique Paths
71 Simplify Path
73 Set Matrix Zeroes
74 Search a 2D Matrix
78 Subsets
98 Validate Binary Search Tree
114 Flatten Binary Tree to Linked List
122 Best Time to Buy and Sell Stock II
130 Surrounded Regions
142 Linked List Cycle II
151 Reverse Words in a String
200 Number of Islands
207 Course Schedule
210 Course Schedule II
215 Kth Largest Element in an Array
229 Majority Element II
230 Kth Smallest Element in a BST
238 Product of Array Except Self
253 Meeting Rooms II
285 Inorder Successor in BST
299 Bulls and Cows
332 Reconstruct Itinerary
340 Longest Substring with At Most K Distinct Characters
347 Top K Frequent Elements
353 Design Snake Game
378 Kth Smallest Element in a Sorted Matrix
388 Longest Absolute File Path
399 Evaluate Division
418 Sentence Screen Fitting
450 Delete Node in a BST
531 Lonely Pixel I
536 Construct Binary Tree from String
547 Number of Provinces
560 Subarray Sum Equals K
634 Find the Derangement of An Array
681 Next Closest Time
686 Repeated String Match
695 Max Area of Island
701 Insert into a Binary Search Tree
735 Asteroid Collision
755 Pour Water
784 Letter Case Permutation
792 Number of Matching Subsequences
848 Shifting Letters
853 Car Fleet
904 Fruit Into Baskets
917 Reverse Only Letters
1007 Minimum Domino Rotations For Equal Row
1048 Longest String Chain
1057 Campus Bikes
1058 Minimize Rounding Error to Meet Target
1110 Delete Nodes And Return Forest
1136 Parallel Courses
1162 As Far from Land as Possible
1344 Angle Between Hands of a Clock
1423 Maximum Points You Can Obtain from Cards
1448 Count Good Nodes in Binary Tree
1493 Longest Subarray of 1's After Deleting One Element
1509 Minimum Difference Between Largest and Smallest Value in Three Moves
1525 Number of Good Ways to Split a String
1631 Path With Minimum Effort
2048 Next Greater Numerically Balanced Number

Hard

# Title
4 Median of Two Sorted Arrays
308 Range Sum Query 2D - Mutable
683 K Empty Slots
843 Guess the Word
1610 Maximum Number of Visible Points
1776 Car Fleet II

Releases

No releases published

Packages

No packages published

Languages