Skip to content

Document my LeetCode solution with chinese comments and multiple programming languages.

Notifications You must be signed in to change notification settings

yuhexiong/leetcode-solution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode Solve And Explain

Document my LeetCode solution with comprehensive chinese comments and incorporate multiple programming languages.

Shortcut To Solutions

easy Problem 1 Two Sum: C | C++ | Python | Go | TypeScript | JavaScript
medium Problem 2 Add Two Numbers: C++ | Python | Go
medium Problem 3 Longest Substring Without Repeating Characters: Python
hard Problem 4 Median of Two Sorted Arrays: Python
medium Problem 5 Longest Palindromic Substring: Python
medium Problem 6 Zigzag Conversion: Python
medium Problem 7 Reverse Integer: C++
medium Problem 8 String to Integer (atoi): C++
easy Problem 9 Palindrome Number: C++ | Go | Java
medium Problem 11 Container With Most Water: Python
medium Problem 12 Integer to Roman: C++ | Java
easy Problem 13 Roman to Integer: C++
medium Problem 17 Letter Combinations of a Phone Number: Python
easy Problem 21 Merge Two Sorted Lists: C++
easy Problem 27 Remove Element: C++ | Java
medium Problem 34 Find First and Last Position of Element in Sorted Array: C++ | Python
easy Problem 35 Search Insert Position: C | C++ | TypeScript
medium Problem 47 Permutations II: Python
medium Problem 48 Rotate Image: C++ | Java
medium Problem 50 Pow(x, n): C++ | Go | Java
easy Problem 58 Length of Last Word: C++ | Python | Go
medium Problem 62 Unique Paths: C++ | Java
easy Problem 66 Plus One: C++ | Python | Go | Java
easy Problem 69 Sqrt(x): C++ | Go | Java
medium Problem 75 Sort Colors: Python
easy Problem 100 Same Tree: TypeScript | Java
medium Problem 120 Triangle: C++ | Go | Java
hard Problem 154 Find Minimum in Rotated Sorted Array II: C++ | Go
medium Problem 164 Maximum Gap: C | C++
medium Problem 176 Second Highest Salary: MySQL
medium Problem 177 Nth Highest Salary: MySQL
medium Problem 178 Rank Scores: MySQL
medium Problem 180 Consecutive Numbers: MySQL
medium Problem 184 Department Highest Salary: MySQL
hard Problem 185 Department Top Three Salaries: MySQL | PostgreSQL
medium Problem 237 Delete Node in a Linked List: C++
easy Problem 252 Meeting Rooms: Python
hard Problem 262 Trips and Users: MySQL
easy Problem 359 Logger Rate Limiter: C++
easy Problem 404 Sum of Left Leaves: Python
medium Problem 565 Array Nesting: C | C++ | Go | Java
medium Problem 648 Replace Words: Python
easy Problem 682 Baseball Game: C++
easy Problem 771 Jewels and Stones: Python
hard Problem 899 Orderly Queue: C++ | Go | Java
easy Problem 938 Range Sum of BST: Python
medium Problem 970 Powerful Integers: Python
easy Problem 1119 Remove Vowels from a String: Python
easy Problem 1137 N-th Tribonacci Number: C++ | Go
medium Problem 1248 Count Number: C++ | Go | Java
hard Problem 1289 Minimum Falling Path Sum II: Python
medium Problem 1393 Capital Gain/Loss: MySQL
hard Problem 1402 Reducing Dishes: C++ | Go | Java
easy Problem 1422 Maximum Score After Splitting a String: C++ | Python
medium Problem 1468 Calculate Salaries: MySQL
hard Problem 1479 Sales by Day of the Week: MySQL
hard Problem 1526 Minimum Number of Increments on Subarrays to Form a Target Array: C++
medium Problem 1570 Dot Product of Two Sparse Vectors: C++
hard Problem 1575 Count All Possible Routes: Python
medium Problem 1679 Max Number of K-Sum Pairs: C | C++
medium Problem 1689 Partitioning Into Minimum Number Of Deci-Binary Numbers: C++
easy Problem 1821 Find Customers With Positive Revenue this Year: MySQL
medium Problem 1831 Maximum Transaction Each Day: MySQL
medium Problem 1874 Minimize Product Sum of Two Arrays: Python
medium Problem 2084 Drop Type 1 Orders for Customers With Type 0 Orders: MySQL
hard Problem 2276 Count Integers in Intervals: Python
medium Problem 2298 Tasks Count in the Weekend: MySQL
easy Problem 2331 Evaluate Boolean Binary Tree: Python
medium Problem 2340 Minimum Adjacent Swaps to Make a Valid Array: Python
medium Problem 2487 Remove Nodes From Linked List: Python
easy Problem 2582 Pass the Pillow: Python
easy Problem 2620 Counter: TypeScript
medium Problem 2627 Debounce: TypeScript
medium Problem 2694 Event Emitter: TypeScript
easy Problem 2703 Return Length of Arguments Passed: TypeScript
easy Problem 2715 Timeout Cancellation: TypeScript
medium Problem 2722 Join Two Arrays by ID: TypeScript | JavaScript
easy Problem 2723 Add Two Promises: TypeScript | JavaScript
easy Problem 2758 Next Day: TypeScript
medium Problem 2782 Number of Unique Categories: Python
hard Problem 2793 Status of Flight Tickets: MySQL
easy Problem 2796 Repeat String: TypeScript
easy Problem 2797 Partial Function with Placeholders: TypeScript
easy Problem 2803 Factorial Generator: TypeScript
easy Problem 2828 Check if a String Is an Acronym of Word: C++
easy Problem 2837 Total Traveled Distance: MySQL
easy Problem 2879 Display the First Three Rows: Python
easy Problem 2884 Modify Columns: Python
medium Problem 2895 Minimum Processing Time: C++
medium Problem 2988 Manager of the Largest Department: MySQL
medium Problem 2989 Class Performance: MySQL
easy Problem 3005 Count Elements With Maximum Frequency: C++
easy Problem 3024 Type of Triangle: C | C++ | Java
easy Problem 3069 Distribute Elements Into Two Arrays I: C++
medium Problem 3075 Maximize Happiness of Selected Children: C | C++ | Go
easy Problem 3110 Score of a String: C | C++ | Java
medium Problem 3115 Maximum Prime Difference: C | C++ | Go | JavaScript
easy Problem 3146 Permutation Difference between Two Strings: Go
medium Problem 3147 Taking Maximum Energy From the Mystic Dungeon: C++ | Python
easy Problem 3151 Special Array I: Go
medium Problem 3152 Special Array II: Go
medium Problem 3163 String Compression III: C++
easy Problem 3173 Bitwise OR of Adjacent Elements: C++
medium Problem 3195 Find the Minimum Area to Cover All Ones I: Python
medium Problem 3196 Maximize Total Cost of Alternating Subarrays: Python
medium Problem 3204 Bitwise User Permissions Analysis: MySQL
medium Problem 3227 Vowels Game in a String: C++ | Go
easy Problem 3248 Snake in Matrix: Python
medium Problem 3254 Find the Power of K-Size Subarrays I: Python
medium Problem 3259 Maximum Energy Boost From Two Drinks: Python | Go
easy Problem 3263 Convert Doubly Linked List to Array I: C++ | Python | Go
medium Problem 3271 Hash Divided String: C++ | Python
easy Problem 3289 The Two Sneaky Numbers of Digitville: Python
medium Problem 3293 Calculate Product Final Price: MySQL
easy Problem 3294 Convert Doubly Linked List to Array II: C++ | Python
medium Problem 3308 Find Top Performing Driver: MySQL
medium Problem 3324 Find the Sequence of Strings Appeared on the Screen: C++ | Python | Go
medium Problem 3338 Second Highest Salary II: MySQL
easy Problem 3340 Check Balanced String: Go
hard Problem 3368 First Letter Capitalization: Python
hard Problem 3369 Design an Array Statistics Tracker: Python
hard Problem 3374 First Letter Capitalization II: Python
easy Problem 3415 Find Products with Three Consecutive Digits: MySQL