Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yuhexiong/leetcode-solution
Document my LeetCode solution with chinese comments and multiple programming languages.
https://github.com/yuhexiong/leetcode-solution
c-language cpp go golang java javascript leetcode mysql python typescript
Last synced: about 1 month ago
JSON representation
Document my LeetCode solution with chinese comments and multiple programming languages.
- Host: GitHub
- URL: https://github.com/yuhexiong/leetcode-solution
- Owner: yuhexiong
- Created: 2023-12-06T14:43:20.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-17T05:25:11.000Z (3 months ago)
- Last Synced: 2024-10-19T07:44:25.991Z (3 months ago)
- Topics: c-language, cpp, go, golang, java, javascript, leetcode, mysql, python, typescript
- Language: C++
- Homepage:
- Size: 275 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LeetCode Solve And Explain
Document my LeetCode solution with comprehensive chinese comments and incorporate multiple programming languages.
## Shortcut To Solutions
![easy](./icon/easy.png) Problem 1 Two Sum: [C](./c/0001_TwoSum.c) | [C++](./c++/0001_TwoSum.cpp) | [Python](./python/0001_two_sum.py) | [Go](./go/0001_two_sum.go) | [TypeScript](./typescript/0001_TwoSum.ts) | [JavaScript](./javascript/0001_TwoSum.js)
![medium](./icon/medium.png) Problem 2 Add Two Numbers: [C++](./c++/0002_AddTwoNumbers.cpp) | [Python](./python/0002_add_two_numbers.py) | [Go](./go/0002_add_two_numbers.go)
![medium](./icon/medium.png) Problem 3 Longest Substring Without Repeating Characters: [Python](./python/0003_longest_substring_without_repeating_characters.py)
![hard](./icon/hard.png) Problem 4 Median of Two Sorted Arrays: [Python](./python/0004_median_of_two_sorted_arrays.py)
![medium](./icon/medium.png) Problem 5 Longest Palindromic Substring: [Python](./python/0005_longest_palindromic_substring.py)
![medium](./icon/medium.png) Problem 6 Zigzag Conversion: [Python](./python/0006_zigzag_conversion.py)
![medium](./icon/medium.png) Problem 7 Reverse Integer: [C++](./c++/0007_ReverseInteger.cpp)
![medium](./icon/medium.png) Problem 8 String to Integer (atoi): [C++](./c++/0008_StringToIntegerAtoi.cpp)
![easy](./icon/easy.png) Problem 9 Palindrome Number: [C++](./c++/0009_PalindromeNumber.cpp) | [Go](./go/0009_palindrome_number.go) | [Java](./java/0009_PalindromeNumber.java)
![medium](./icon/medium.png) Problem 11 Container With Most Water: [Python](./python/0011_container_with_most_water.py)
![medium](./icon/medium.png) Problem 12 Integer to Roman: [C++](./c++/0012_IntegerToRoman.cpp) | [Java](./java/0012_IntegerToRoman.java)
![easy](./icon/easy.png) Problem 13 Roman to Integer: [C++](./c++/0013_RomanToInteger.cpp)
![medium](./icon/medium.png) Problem 17 Letter Combinations of a Phone Number: [Python](./python/0017_letter_combinations_of_a_phone_number.py)
![easy](./icon/easy.png) Problem 21 Merge Two Sorted Lists: [C++](./c++/0021_MergeTwoSortedLists.cpp)
![easy](./icon/easy.png) Problem 27 Remove Element: [C++](./c++/0027_RemoveElement.cpp) | [Java](./java/0027_RemoveElement.java)
![medium](./icon/medium.png) Problem 34 Find First and Last Position of Element in Sorted Array: [C++](./c++/0034_FindFirstAndLastPositionOfElementInSortedArray.cpp) | [Python](./python/0034_find_first_and_last_position_of_elementIn_sorted_array.py)
![easy](./icon/easy.png) Problem 35 Search Insert Position: [C](./c/0035_SearchInsertPosition.c) | [C++](./c++/0035_SearchInsertPosition.cpp) | [TypeScript](./typescript/0035_SearchInsertPosition.ts)
![medium](./icon/medium.png) Problem 47 Permutations II: [Python](./python/0047_permutations_ii.py)
![medium](./icon/medium.png) Problem 48 Rotate Image: [C++](./c++/0048_RotateImage.cpp) | [Java](./java/0048_RotateImage.java)
![medium](./icon/medium.png) Problem 50 Pow(x, n): [C++](./c++/0050_PowXN.cpp) | [Go](./go/0050_pow_x_n.go) | [Java](./java/0050_PowXN.java)
![easy](./icon/easy.png) Problem 58 Length of Last Word: [C++](./c++/0058_LengthOfLastWord.cpp) | [Python](./python/0058_length_of_last_word.py) | [Go](./go/0058_length_of_last_word.go)
![medium](./icon/medium.png) Problem 62 Unique Paths: [C++](./c++/0062_UniquePaths.cpp) | [Java](./java/0062_UniquePaths.java)
![easy](./icon/easy.png) Problem 66 Plus One: [C++](./c++/0066_PlusOne.cpp) | [Python](./python/0066_plus_one.py) | [Go](./go/0066_plus_one.go) | [Java](./java/0066_PlusOne.java)
![easy](./icon/easy.png) Problem 69 Sqrt(x): [C++](./c++/0069_SqrtX.cpp) | [Go](./go/0069_sqrt_x.go) | [Java](./java/0069_SqrtX.java)
![medium](./icon/medium.png) Problem 75 Sort Colors: [Python](./python/0075_sort_colors.py)
![easy](./icon/easy.png) Problem 100 Same Tree: [TypeScript](./typescript/0100_SameTree.ts) | [Java](./java/0100_SameTree.java)
![medium](./icon/medium.png) Problem 120 Triangle: [C++](./c++/0120_Triangle.cpp) | [Go](./go/0120_triangle.go) | [Java](./java/0120_Triangle.java)
![hard](./icon/hard.png) Problem 154 Find Minimum in Rotated Sorted Array II: [C++](./c++/0154_FindMinimumInRotatedSortedArrayII.cpp) | [Go](./go/0154_find_minimum_in_rotated_sorted_array_II.go)
![medium](./icon/medium.png) Problem 164 Maximum Gap: [C](./c/0164_MaximumGap.c) | [C++](./c++/0164_MaximumGap.cpp)
![medium](./icon/medium.png) Problem 176 Second Highest Salary: [MySQL](./mysql/0176_SecondHighestSalary.sql)
![medium](./icon/medium.png) Problem 177 Nth Highest Salary: [MySQL](./mysql/0177_NthHighestSalary.sql)
![medium](./icon/medium.png) Problem 178 Rank Scores: [MySQL](./mysql/0178_RankScores.sql)
![medium](./icon/medium.png) Problem 180 Consecutive Numbers: [MySQL](./mysql/0180_ConsecutiveNumbers.sql)
![medium](./icon/medium.png) Problem 184 Department Highest Salary: [MySQL](./mysql/0184_DepartmentHighestSalary.sql)
![hard](./icon/hard.png) Problem 185 Department Top Three Salaries: [MySQL](./mysql/0185_DepartmentTopThreeSalaries.sql) | [PostgreSQL](./postgresql/0185_DepartmentTopThreeSalaries.sql)
![medium](./icon/medium.png) Problem 237 Delete Node in a Linked List: [C++](./c++/0237_DeleteNodeInALinkedList.cpp)
![easy](./icon/easy.png) Problem 252 Meeting Rooms: [Python](./python/0252_meeting_rooms.py)
![hard](./icon/hard.png) Problem 262 Trips and Users: [MySQL](./mysql/0262_TripsAndUsers.sql)
![easy](./icon/easy.png) Problem 404 Sum of Left Leaves: [Python](./python/0404_sum_of_left_leaves.py)
![medium](./icon/medium.png) Problem 565 Array Nesting: [C](./c/0565_ArrayNesting.c) | [C++](./c++/0565_ArrayNesting.cpp) | [Go](./go/0565_array_nesting.go) | [Java](./java/0565_ArrayNesting.java)
![medium](./icon/medium.png) Problem 648 Replace Words: [Python](./python/0648_replace_words.py)
![easy](./icon/easy.png) Problem 682 Baseball Game: [C++](./c++/0682_BaseballGame.cpp)
![easy](./icon/easy.png) Problem 771 Jewels and Stones: [Python](./python/0771_jewels_and_stones.py)
![hard](./icon/hard.png) Problem 899 Orderly Queue: [C++](./c++/0899_OrderlyQueue.cpp) | [Go](./go/0899_orderly_queue.go) | [Java](./java/0899_OrderlyQueue.java)
![easy](./icon/easy.png) Problem 938 Range Sum of BST: [Python](./python/0938_range_sum_of_bst.py)
![medium](./icon/medium.png) Problem 970 Powerful Integers: [Python](./python/0970_powerful_integers.py)
![easy](./icon/easy.png) Problem 1119 Remove Vowels from a String: [Python](./python/1119_remove_vowels_from_a_string.py)
![easy](./icon/easy.png) Problem 1137 N-th Tribonacci Number: [C++](./c++/1137_NthTribonacciNumber.cpp) | [Go](./go/1137_nth_tribonacci_number.go)
![medium](./icon/medium.png) Problem 1248 Count Number: [C++](./c++/1248_CountNumberOfNiceSubarrays.cpp) | [Go](./go/1248_count_number_of_nice_subarrays.go) | [Java](./java/1248_CountNumberOfNiceSubarrays.java)
![hard](./icon/hard.png) Problem 1289 Minimum Falling Path Sum II: [Python](./python/1289_minimum_falling_path_sum_ii.py)
![medium](./icon/medium.png) Problem 1393 Capital Gain/Loss: [MySQL](./mysql/1393_CapitalGainLoss.sql)
![hard](./icon/hard.png) Problem 1402 Reducing Dishes: [C++](./c++/1402_ReducingDishes.cpp) | [Go](./go/1402_reducing_dishes.go) | [Java](./java/1402_ReducingDishes.java)
![easy](./icon/easy.png) Problem 1422 Maximum Score After Splitting a String: [C++](./c++/1422_MaximumScoreAfterSplittingAString.cpp) | [Python](./python/1422_maximum_score_after_splitting_a_string.py)
![medium](./icon/medium.png) Problem 1468 Calculate Salaries: [MySQL](./mysql/1468_CalculateSalaries.sql)
![hard](./icon/hard.png) Problem 1479 Sales by Day of the Week: [MySQL](./mysql/1479_SalesByDayOfTheWeek.sql)
![medium](./icon/medium.png) Problem 1570 Dot Product of Two Sparse Vectors: [C++](./c++/1570_DotProductOfTwoSparseVectors.cpp)
![hard](./icon/hard.png) Problem 1575 Count All Possible Routes: [Python](./python/1575_count_all_possible_routes.py)
![medium](./icon/medium.png) Problem 1679 Max Number of K-Sum Pairs: [C](./c/1679_MaxNumberOfKSumPairs.c) | [C++](./c++/1679_MaxNumberOfKSumPairs.cpp)
![medium](./icon/medium.png) Problem 1689 Partitioning Into Minimum Number Of Deci-Binary Numbers: [C++](./c++/1689_PartitioningIntoMinimumNumberOfDeciBinaryNumbers.cpp)
![easy](./icon/easy.png) Problem 1821 Find Customers With Positive Revenue this Year: [MySQL](./mysql/1821_FindCustomersWithPositiveRevenueThisYear.sql)
![medium](./icon/medium.png) Problem 1831 Maximum Transaction Each Day: [MySQL](./mysql/1831_MaximumTransactionEachDay.sql)
![medium](./icon/medium.png) Problem 1874 Minimize Product Sum of Two Arrays: [Python](./python/1874_minimize_product_sum_of_two_arrays.py)
![medium](./icon/medium.png) Problem 2084 Drop Type 1 Orders for Customers With Type 0 Orders: [MySQL](./mysql/2084_DropType1OrdersForCustomersWithType0Orders.sql)
![hard](./icon/hard.png) Problem 2276 Count Integers in Intervals: [Python](./python/2276_count_integers_in_intervals.py)
![medium](./icon/medium.png) Problem 2298 Tasks Count in the Weekend: [MySQL](./mysql/2298_TasksCountInTheWeekend.sql)
![easy](./icon/easy.png) Problem 2331 Evaluate Boolean Binary Tree: [Python](./python/2331_evaluate_boolean_binary_tree.py)
![medium](./icon/medium.png) Problem 2340 Minimum Adjacent Swaps to Make a Valid Array: [Python](./python/2340_minimum_adjacent_swaps_to_make_a_valid_array.py)
![medium](./icon/medium.png) Problem 2487 Remove Nodes From Linked List: [Python](./python/2487_remove_nodes_from_linked_list.py)
![easy](./icon/easy.png) Problem 2582 Pass the Pillow: [Python](./python/2582_pass_the_pillow.py)
![easy](./icon/easy.png) Problem 2620 Counter: [TypeScript](./typescript/2620_Counter.ts)
![medium](./icon/medium.png) Problem 2627 Debounce: [TypeScript](./typescript/2627_Debounce.ts)
![medium](./icon/medium.png) Problem 2694 Event Emitter: [TypeScript](./typescript/2694_EventEmitter.ts)
![easy](./icon/easy.png) Problem 2703 Return Length of Arguments Passed: [TypeScript](./typescript/2703_ReturnLengthOfArgumentsPassed.ts)
![easy](./icon/easy.png) Problem 2715 Timeout Cancellation: [TypeScript](./typescript/2715_TimeoutCancellation.ts)
![medium](./icon/medium.png) Problem 2722 Join Two Arrays by ID: [TypeScript](./typescript/2722_JoinTwoArraysByID.ts) | [JavaScript](./javascript/2722_JoinTwoArraysByID.js)
![easy](./icon/easy.png) Problem 2723 Add Two Promises: [TypeScript](./typescript/2723_AddTwoPromises.ts) | [JavaScript](./javascript/2723_AddTwoPromises.js)
![easy](./icon/easy.png) Problem 2758 Next Day: [TypeScript](./typescript/2758_NextDay.ts)
![medium](./icon/medium.png) Problem 2782 Number of Unique Categories: [Python](./python/2782_number_of_unique_categories.py)
![hard](./icon/hard.png) Problem 2793 Status of Flight Tickets: [MySQL](./mysql/2793_StatusOfFlightTickets.sql)
![easy](./icon/easy.png) Problem 2796 Repeat String: [TypeScript](./typescript/2796_RepeatString.ts)
![easy](./icon/easy.png) Problem 2797 Partial Function with Placeholders: [TypeScript](./typescript/2797_PartialFunctionWithPlaceholders.ts)
![easy](./icon/easy.png) Problem 2803 Factorial Generator: [TypeScript](./typescript/2803_FactorialGenerator.ts)
![easy](./icon/easy.png) Problem 2828 Check if a String Is an Acronym of Word: [C++](./c++/2828_CheckIfAStringIsAnAcronymOfWords.cpp)
![easy](./icon/easy.png) Problem 2837 Total Traveled Distance: [MySQL](./mysql/2837_TotalTraveledDistance.sql)
![easy](./icon/easy.png) Problem 2879 Display the First Three Rows: [Python](./python/2879_display_the_first_three_rows.py)
![easy](./icon/easy.png) Problem 2884 Modify Columns: [Python](./python/2884_modify_columns.py)
![medium](./icon/medium.png) Problem 2895 Minimum Processing Time: [C++](./c++/2895_MinimumProcessingTime.cpp)
![medium](./icon/medium.png) Problem 2989 Class Performance: [MySQL](./mysql/2989_ClassPerformance.sql)
![easy](./icon/easy.png) Problem 3005 Count Elements With Maximum Frequency: [C++](./c++/3005_CountElementsWithMaximumFrequency.cpp)
![easy](./icon/easy.png) Problem 3024 Type of Triangle: [C](./c/3024_TypeOfTriangle.c) | [C++](./c++/3024_TypeOfTriangle.cpp) | [Java](./java/3024_TypeOfTriangle.java)
![easy](./icon/easy.png) Problem 3069 Distribute Elements Into Two Arrays I: [C++](./c++/3069_DistributeElementsIntoTwoArraysI.cpp)
![medium](./icon/medium.png) Problem 3075 Maximize Happiness of Selected Children: [C](./c/3075_MaximizeHappinessOfSelectedChildren.c) | [C++](./c++/3075_MaximizeHappinessOfSelectedChildren.cpp) | [Go](./go/3075_maximize_happiness_of_selected_children.go)
![easy](./icon/easy.png) Problem 3110 Score of a String: [C](./c/3110_ScoreOfAString.c) | [C++](./c++/3110_ScoreOfAString.cpp) | [Java](./java/3110_ScoreOfAString.java)
![medium](./icon/medium.png) Problem 3115 Maximum Prime Difference: [C](./c/3115_MaximumPrimeDifference.c) | [C++](./c++/3115_MaximumPrimeDifference.cpp) | [Go](./go/3115_maximum_prime_difference.go) | [JavaScript](./javascript/3115_MaximumPrimeDifference.js)
![easy](./icon/easy.png) Problem 3146 Permutation Difference between Two Strings: [Go](./go/3146_permutation_difference_between_two_strings.go)
![medium](./icon/medium.png) Problem 3147 Taking Maximum Energy From the Mystic Dungeon: [C++](./c++/3147_TakingMaximumEnergyFromTheMysticDungeon.cpp) | [Python](./python/3147_taking_maximum_energy_from_the_mystic_dungeon.py)
![easy](./icon/easy.png) Problem 3151 Special Array I: [Go](./go/3151_special_array_I.go)
![medium](./icon/medium.png) Problem 3152 Special Array II: [Go](./go/3152_special_array_II.go)
![medium](./icon/medium.png) Problem 3163 String Compression III: [C++](./c++/3163_StringCompressionIII.cpp)
![easy](./icon/easy.png) Problem 3173 Bitwise OR of Adjacent Elements: [C++](./c++/3173_BitwiseOrOfAdjacentElements.cpp)
![medium](./icon/medium.png) Problem 3195 Find the Minimum Area to Cover All Ones I: [Python](./python/3195_fnd_the_minimum_area_to_cover_all_ones_i.py)
![medium](./icon/medium.png) Problem 3196 Maximize Total Cost of Alternating Subarrays: [Python](./python/3196_maximize_total_cost_of_alternating_subarrays.py)
![medium](./icon/medium.png) Problem 3204 Bitwise User Permissions Analysis: [MySQL](./mysql/3204_BitwiseUserPermissionsAnalysis.sql)
![medium](./icon/medium.png) Problem 3227 Vowels Game in a String: [C++](./c++/3227_VowelsGameInAString.cpp) | [Go](./go/3227_vowels_game_in_a_string.go)
![easy](./icon/easy.png) Problem 3248 Snake in Matrix: [Python](./python/3248_snake_in_matrix.py)
![medium](./icon/medium.png) Problem 3254 Find the Power of K-Size Subarrays I: [Python](./python/3254_find_the_power_of_k-size_subarrays_i.py)
![medium](./icon/medium.png) Problem 3259 Maximum Energy Boost From Two Drinks: [Python](./python/3259_maximum_energy_boost_from_two_drinks.py) | [Go](./go/3259_maximum_energy_boost_from_two_drinks.go)
![easy](./icon/easy.png) Problem 3263 Convert Doubly Linked List to Array I: [C++](./c++/3263_ConvertDoublyLinkedListToArrayI.cpp) | [Python](./python/3263_convert_doubly_linked_list_to_array_i.py) | [Go](./go/3263_convert_doubly_linked_list_to_array_i.go)
![medium](./icon/medium.png) Problem 3271 Hash Divided String: [C++](./c++/3271_HashDividedString.cpp) | [Python](./python/3271_hash_divided_string.py)
![easy](./icon/easy.png) Problem 3289 The Two Sneaky Numbers of Digitville: [Python](./python/3289_the_two_sneaky_numbers_of_digitville.py)
![medium](./icon/medium.png) Problem 3293 Calculate Product Final Price: [MySQL](./mysql/3293_CalculateProductFinalPrice.sql)
![easy](./icon/easy.png) Problem 3294 Convert Doubly Linked List to Array II: [C++](./c++/3294_ConvertDoublyLinkedListToArrayII.cpp) | [Python](./python/3294_convert_doubly_linked_list_to_array_ii.py)
![medium](./icon/medium.png) Problem 3308 Find Top Performing Driver: [MySQL](./mysql/3308_FindTopPerformingDriver.sql)
![medium](./icon/medium.png) Problem 3324 Find the Sequence of Strings Appeared on the Screen: [C++](./c++/3324_FindTheSequenceOfStringsAppearedOnTheScreen.cpp) | [Python](./python/3324_find_the_sequence_of_strings_appeared_on_the_screen.py) | [Go](./go/3324_find_the_sequence_of_strings_appeared_on_the_screen.go)
![medium](./icon/medium.png) Problem 3338 Second Highest Salary II: [MySQL](./mysql/3338_SecondHighestSalaryII.sql)
![easy](./icon/easy.png) Problem 3340 Check Balanced String: [Go](./go/3340_check_balanced_string.go)
![hard](./icon/hard.png) Problem 3368 First Letter Capitalization: [Python](./python/3368_first_letter_capitalization.py)
![hard](./icon/hard.png) Problem 3374 First Letter Capitalization II: [Python](./python/3374_first_letter_capitalization_ii.py)