{"id":26984515,"url":"https://github.com/shawnnew/myleetcodeanswer","last_synced_at":"2026-04-30T15:32:56.032Z","repository":{"id":159599132,"uuid":"109426211","full_name":"ShawnNew/myLeetcodeAnswer","owner":"ShawnNew","description":"Share my LeetCode answer","archived":false,"fork":false,"pushed_at":"2018-04-26T18:11:04.000Z","size":5314,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-03T17:53:24.667Z","etag":null,"topics":["algorithms","java","leetcode-solutions"],"latest_commit_sha":null,"homepage":"https://shawnnew.github.io/myLeetcodeAnswer/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ShawnNew.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-03T17:49:11.000Z","updated_at":"2019-10-17T21:20:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"efb30a78-f052-41c7-943b-82e2b9e0498e","html_url":"https://github.com/ShawnNew/myLeetcodeAnswer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ShawnNew/myLeetcodeAnswer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShawnNew%2FmyLeetcodeAnswer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShawnNew%2FmyLeetcodeAnswer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShawnNew%2FmyLeetcodeAnswer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShawnNew%2FmyLeetcodeAnswer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShawnNew","download_url":"https://codeload.github.com/ShawnNew/myLeetcodeAnswer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShawnNew%2FmyLeetcodeAnswer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32469344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","java","leetcode-solutions"],"created_at":"2025-04-03T17:48:20.030Z","updated_at":"2026-04-30T15:32:56.027Z","avatar_url":"https://github.com/ShawnNew.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"## LeetCode算法归纳\r\n\r\n我将LeetCode算法题按照标签整理了一些解题思路，下面会分别给出链接方便查看。同时，还我还贴出了一些刷题过程中记录的一些[笔记](#note)。\r\n\r\n### 目录\r\n* [Array](#array)\r\n* [BackTracking](#back-tracking)\r\n* [Binary Search](#binary-search)\r\n* [Dynamic Programming](#dynamic-programming)\r\n* [Graph](#graph)\r\n* [HashMap](#hashmap)\r\n* [LinkedList](#linked-list)\r\n* [Math](#math)\r\n* [Sort](#sort)\r\n* [Stack](#stack)\r\n* [String](#string)\r\n* [Tree](#tree)\r\n* [TwoPointers](#two-pointers)\r\n* [Note](#note)\r\n\r\n\r\n\r\n### Array\r\n  * [*1. Two Sum*](docs/Two_Sum.md)\n  * [*4. Median of Two Sorted Arrays*](docs/MedianofTwoSortedArrays.md)\r\n  * [*18. 4Sum*](docs/4Sum.md)\r\n  * [*26. Remove Duplicate from Sorted Array*](docs/Remove_Duplicate_from_Sorted_Array.md)\r\n  * [*31. Next Permutation*](docs/Next_Permutation.md)\n  * [*41. First Missing Positive*](docs/FirstMissingPositive.md)\r\n  * [*48. Rotate Image*](docs/Rotate_Image.md)\r\n  * [*53. Maximum Subarray*](docs/Maximum_Subarray.md)\n  * [*53. Spiral Matrix*](docs/SpiralMatrix.md)\n  * [*59. Spiral Matrix II*](docs/SpiralMatrixII.md)\r\n  * [*88. Merge Sorted Array*](docs/Merge_Sorted_Array.md)\r\n  * [*119. Pascal's Triangle*](docs/Pascal's_Triangle.md)\r\n  * [*120. Pascal's Triangle II*](docs/Pascal's_TriangleII.md)\r\n  * [*121. Best Time to Buy and Sell Stock(DP)*](docs/Best_Time_to_Buy_and_Sell_Stock(DP).md)\r\n  * [*122. Best Time to Buy and Sell Stock II*](docs/Best_Time_to_Buy_and_Sell_StockII.md)\r\n  * [*167. Two Sum II - Input array is sorted*](docs/Two_SumII-Input_array_is_sorted.md)\r\n  * [*169. Majority Element*](docs/Majority_Element.md)\r\n  * [*189. Rotate Array*](docs/Rotate_Array.md)\r\n  * [*206. Reverse Linked List*](docs/Reverse_Linked_List.md)\r\n  * [*217. Contains Duplicate*](docs/Contains_Duplicate.md)\n  * [*238. Product of Array Except Self*](docs/ProductofArrayExceptSelf.md)\r\n  * [*268. Missing Number*](docs/Missing_Number.md)\r\n  * [*283. Move Zeros*](docs/Move_Zeroes.md)\r\n  * [*414. Third Maximum Number*](docs/Third_Maximum_Number.md)\r\n  * [*448. Find All Number Disappeared in an Array*](docs/Find_All_Numbers_Disappeared_in_an_Array.md)\r\n  * [*485. Max Consecutive Ones*](docs/Max_Consecutive_Ones.md)\r\n  * [*532. K-diff Pairs in an Array*](docs/K-diff_Pairs_in_an_Array.md)\r\n  * [*561. Array Partition I*](docs/Array_Partition_I.md)\r\n  * [*566. Reshape the Matrix*](docs/Reshape_the_Matrix.md)\r\n  * [*581. Shortest Unsorted Continuous Subarray*](docs/Shortest_Unsorted_Continuous_Subarray.md)\r\n  * [*605. Can Place Flowers*](docs/Can_Place_Flowers.md)\r\n  * [*628. Maximum Product of Three Numbers*](docs/Maximum_Product_of_Three_Numbers.md)\r\n  * [*643. Maximum Average Subarray I*](docs/Maximum_Average_SubarrayI.md)\r\n  * [*661. Image Smoother*](docs/Image_Smoother.md)\r\n  * [*665. Non-decreasing Array*](docs/Non-decreasing_Array.md)\r\n  * [*674. Longest Continuous Increasing Subsequence*](docs/Longest_Continuous_Increasing_Subsequence.md)\r\n  * [*695. Max Area of Island*](docs/Max_Area_of_Island.md)\r\n  * [*697. Degree of an Array*](docs/Degree_of_an_Array.md)\r\n  * [*717. 1-bit and 2-bit Characters*](docs/1-bit_and_2-bit_Characters.md)\r\n  * [*724. Find Pivot Index*](docs/Find_Pivot_Index.md)\r\n\r\n### Back Tracking\r\n \r\n  * [*17. Letter Combinations of a Phone Number*](docs/Letter_Combinations_of_a_Phone_Number.md)\r\n  * [*22. Generate Parentheses*](docs/Generate_Parentheses.md)\n  * [*37. Sudoku Solver*](docs/SudokuSolver.md)\r\n  * [*39. Combination Sum*](docs/Combination_Sum.md)\r\n  * [*40. Combination Sum II*](docs/Combination_SumII.md)\r\n  * [*46. Permutations*](docs/Permutations.md)\r\n  * [*47. Permutations II*](docs/PermutationsII.md)\r\n  * [*60. Permutation Sequence*](docs/Permutation_Sequence.md)\r\n  * [*77. Combinations*](docs/Combinations.md)\r\n  * [*78. Subsets*](docs/Subsets.md)\r\n  * [*401. Binary Watch*](docs/Binary_Watch.md)\r\n\r\n### Binary Search\r\n  * [*33. Search in Rotated Sorted Array*](docs/Search_in_Rotated_Sorted_Array.md)\r\n  * [*34. Search for a Range*](docs/Search_for_a_Range.md)\r\n  * [*50. Pow(x, n)*](docs/Pow.md)\r\n  * [*278. First Bad Version*](docs/First_Bad_Version.md)\r\n  * [*374. Guess Number Higher of Lower*](docs/374Guess_Number_Higher_or_Lower.md)\r\n  * [*475. Heaters*](docs/Heaters.md)\r\n\r\n### Dynamic Programming\n  * [*10. Regular Expression Matching*](docs/RegularExpressionMatching.md)\n  * [*32. Longest Valid Parentheses*](docs/LongestValidParentheses.md)\r\n  * [*62. Unique Paths*](docs/Unique_Paths.md)\r\n  * [*63. Unique Paths II*](docs/Unique_PathsII.md)\r\n  * [*64. Minimum Path Sum*](docs/Minimum_Path_Sum.md)\r\n  * [*70. Climbing Stairs*](docs/Climbing_Stairs.md)\r\n  * [*91. Decode Ways*](docs/Decode_Ways.md)\r\n  * [*198. House Robber*](docs/House_Robber.md)\r\n  * [*303. Range Sum Query - Immutable*](docs/Range_Sum_Query-Immutable.md)\r\n  * [*746. Min Cost Climbing Stairs*](docs/Min_Cost_Climbing_Stairs.md)\r\n\r\n### Graph\r\n  * [*133. Clone Graph*](docs/Clone_Graph.md)\r\n  \r\n### HashMap\n  * [*30. Substring with Concatenation of All Words*](docs/SubstringwithConcatenationofAllWords.md)\r\n  * [*36. Valid Sudoku*](docs/Valid_Sudoku.md)\r\n  * [*46. Group Anagrams*](docs/Group_Anagrams.md)\r\n  * [*136. Single Number*](docs/Single_Number.md)\r\n  * [*202. Happy Number*](docs/Happy_Number.md)\r\n  * [*204. Count Primes*](docs/Count_Primes.md)\r\n  * [*205. Isomorphic Strings*](docs/Isomorphic_Strings.md)\r\n  * [*242. Valid Anagram*](docs/Valid_Anagram.md)\r\n  * [*290. Word Pattern*](docs/Word_Pattern.md)\r\n  * [*349. Intersection of Two Arrays*](docs/Intersection_of_Two_Arrays.md)\r\n  * [*350. Intersection of Two Arrays II*](docs/Intersection_of_Two_ArraysII.md)\r\n  * [*387. First Unique Character in a String*](docs/First_Unique_Character_in_a_String.md)\r\n  * [*389. Find the Difference*](docs/Find_the_Difference.md)\r\n  * [*438. Find All Anagrams in a String*](docs/Find_All_Anagrams_in_a_String.md)\r\n  * [*447. Number of Boomerangs*](docs/Number_of_Boomerangs.md)\r\n  * [*463. Island Perimeter*](docs/Island_Perimeter.md)\r\n  * [*500. Keyboard Row*](docs/Keyboard_Row.md)\r\n  * [*575. Distribute Candies*](docs/Distribute_Candies.md)\r\n  * [*594. Longest Harmonious Subsequence*](docs/Longest_Harmonious_Subsequence.md)\r\n  * [*599. Minimum Index Sum of Two Lists*](docs/Minimum_Index_Sum_of_Two_Lists.md)\r\n  * [*645. Set Mismatch*](docs/Set_Mismatch.md)\r\n  * [*690. Employee Importance*](docs/Employee_Importance.md)\r\n  * [*720. Longest Word in Dictionary*](docs/Longest_Word_in_Dictionary.md)\r\n  * [*734. Sentence Similarity*](docs/Sentence_Similarity.md)\r\n  \r\n### Linked List\r\n  * [*19. Remove Nth Node From End of List*](docs/Remove_Nth_Node_From_End_of_List.md)\r\n  * [*21. Merge Two Sorted Lists*](docs/Merge_Two_Sorted_Lists.md)\n  * [*25. Reverse Nodes in k-Group*](docs/ReverseNodesink-Group.md)\n  * [*23. Merge k Sorted Lists*](docs/MergekSortedLists.md)\r\n  * [*83. Remove Duplicates from Sorted List*](docs/Remove_Duplicates_from_Sorted_List.md)\r\n  * [*141. Linked List Cycle*](docs/1Linked_List_Cycle.md)\r\n  * [*160. Intersection of Two Linked Lists*](docs/Intersection_of_Two_Linked_Lists.md)\r\n  * [*203. Remove Linked List Elements*](docs/Remove_Linked_List_Elements.md)\r\n  * [*234. Palindrome Linked List*](docs/Palindrome_Linked_List.md#234-palindrome-linked-list)\r\n  * [*237. Delete Node in a Linked List*](docs/Delete_Node_in_a_Linked_List.md)\r\n  * [*445. Add Two Numbers II*](docs/Add_Two_Numbers_II.md)\r\n  * [*725. Split Linked List in Parts*](docs/Split_Linked_List_in_Parts.md#725-split-linked-list-in-parts)\r\n\r\n### Math\r\n  * [*2. Add Two Numbers*](docs/Add_Two_Numbers.md)\r\n  * [*7. Reverse Integer*](docs/Reverse_Integer.md)\r\n  * [*9. Palindrome Number*](docs/Palindrome_Number.md)\r\n  * [*13. Roman to Integer*](docs/Roman_to_Integer.md)\r\n  * [*43. Multiply Strings*](docs/Multiply_Strings.md)\r\n  * [*67. Add Binary*](docs/Add_Binary.md)\r\n  * [*69. Sqrt(x)*](docs/Sqrt(x).md)\r\n  * [*168. Excel Sheet Column Title*](docs/Excel_Sheet_Column_Title.md)\r\n  * [*171. Excel Sheet Column Number*](docs/Excel_Sheet_Column_Number.md)\r\n  * [*172. Factorial Trailing Zeroes*](docs/Factorial_Trailing_Zeroes.md)\r\n  * [*231. Power of Two*](docs/Power_of_Two.md#231-power-of-two)\r\n  * [*258. Add Digits*](docs/Add_Digits.md)\r\n  * [*263. Ugly Number*](docs/Ugly_Number.md)\r\n  * [*326. Power of Three*](docs/Power_of_Three.md)\r\n  * [*367. Valid Perfect Square*](docs/Valid_Perfect_Square.md)\r\n  * [*400. Nth Digit*](docs/Nth_Digit.md)\r\n  * [*415. Add Strings*](docs/Add_Strings.md)\r\n  * [*441. Arranging Coins*](docs/Arranging_Coins.md)\r\n  * [*453. Minimum Moves to Equal Array Elements*](docs/Minimum_Moves_to_Equal_Array_Elements.md)\r\n  * [*507. Perfect Number*](docs/Perfect_Number.md)\r\n  * [*598. Range Addition II*](docs/Range_Addition_II.md)\r\n  * [*633. Sum of Square Numbers*](docs/Sum_of_Square_Numbers.md)\r\n  * [*728. Self Dividing Numbers*](docs/Self_Dividing_Numbers.md)\r\n\r\n  \r\n### Sort\r\n  * [*56. Merge Intervals*](docs/Merge_Intervals.md)\r\n  * [*75. Sort Colors*](docs/Sort_Colors.md)\r\n  * [*147. Insertion Sort List*](docs/Insertion_Sort_List.md)\r\n  * [*148. Sort List*](docs/Sort_List.md)\r\n  * [*179. Largest Number*](docs/Largest_Number.md)\r\n  * [*274. H-Index*](docs/H-Index.md)\r\n\r\n### Stack\r\n  * [*225. Implement Stack using Queues*](docs/Implement_Stack_using_Queues.md)\r\n  * [*232. Implement Queue using Stacks*](docs/Implement_Queue_using_Stacks.md)\r\n  * [*496. Next Greater Element I*](docs/Next_Greater_ElementI.md)\r\n  * [*682. Baseball Game*](docs/Baseball_Game.md)\r\n\r\n  \r\n### String\r\n  * [*5. Longest Palindromic Substring*](docs/Longest_Palindromic_Substring.md)\r\n  * [*12. Integer to Roman*](docs/Integer_to_Roman.md)\r\n  * [*14. Longest Common Prefix*](docs/Longest_Common_Prefix.md)\r\n  * [*20. Valid Parentheses*](docs/Valid_Parentheses.md)\r\n  * [*38. Count and Say*](docs/Count_and_Say.md)\r\n  * [*58. Length of Last Word*](docs/Length_of_Last_Word.md)\r\n  * [*345. Reverse Vowels of a String*](docs/Reverse_Vowels_of_a_String.md)\r\n  * [*383. Ransom Note*](docs/Ransom_Note.md)\r\n  * [*434. Number of Segments in a String*](docs/Number_of_Segments_in_a_String.md)\r\n  * [*443. String Compression*](docs/String_Compression.md)\r\n  * [*459. Repeated Substring Pattern*](docs/Repeated_Substring_Pattern.md)\r\n  * [*520. Detect Capital*](docs/Detect_Capital.md)\r\n  * [*541. Reverse String II*](docs/Reverse_StringII.md)\r\n  * [*551. Student Attendance Record I*](docs/Student_Attendance_RecordI.md)\r\n  * [*557. Reverse Words in a String III*](docs/Reverse_Words_in_a_StringIII.md)\r\n  * [*606. Construct String from Binary Tree*](docs/Construct_String_from_Binary_Tree.md)\r\n  * [*657. Judge Route Circle*](docs/Judge_Route_Circle.md)\r\n  * [*680. Valid Palindrome II*](docs/Valid_PalindromeII.md)\r\n  * [*686. Repeated String Match*](docs/Repeated_String_Match.md)\r\n  * [*696. Count Binary Substrings*](docs/Count_Binary_Substrings.md)\r\n  * [*744. Find Smallest Letter Greater Than Target*](docs/Find_Smallest_Letter_Greater_Than_Target.md)\n  * [*784. Letter Case Permutation*](docs/LetterCasePermutation.md)\n  * [*796. Rotate String*](docs/RotateString.md)\r\n  \r\n\r\n  \r\n### Tree\r\n  * [*94. Binary Tree Inorder Traversal*](docs/Binary_Tree_Inorder_Traversal.md)\r\n  * [*95. Unique Binary Search Trees II*](docs/Unique_Binary_Search_TreesII.md)\r\n  * [*96. Unique Binary Search Trees*](docs/Unique_Binary_Search_Trees.md)\r\n  * [*98. Validate Binary Search Tree*](docs/Validate_Binary_Search_Tree.md)\r\n  * [*100. Same Tree*](Tree/Same_Tree.md)\n  * [*102. Binary Tree Level Order Traversal*](docs/BinaryTreeLevelOrderTraversal)\r\n  * [*103. Binary Tree Zigzag Level Order Traversal*](docs/Binary_Tree_Zigzag_Level_Order_Traversal.md)\r\n  * [*105. Construct Binary Tree from Preorder and Inorder Traversal*](docs/Construct_Binary_Tree_from_Preorder_and_Inorder_Traversal.md)\r\n  * [*106. Construct Binary Tree from Inorder and Postorder Traversal*](docs/Construct_Binary_Tree_from_Inorder_and_Postorder_Traversal.md)\r\n  * [*108. Convert Sorted Array to Binary Search Tree*](docs/Convert_Sorted_Array_to_Binary_Search_Tree.md)\r\n  * [*110. Balanced Binary Tree*](docs/Balanced_Binary_Tree.md)\r\n  * [*111. Minimum Depth of Binary Tree*](docs/Minimum_Depth_of_Binary_Tree.md)\n  * [*637. Average of Levels in Binary Tree*](docs/AverageofLevelsinBinaryTree.md)\r\n\r\n  \r\n### Two Pointers\r\n  * [*3. Longest Substring Without Repeating Characters*](docs/Longest_Substring_Without_Repeating_Characters.md)\r\n  * [*11. Container With Most Water*](docs/Container_With_Most_Water.md)\r\n  * [*15. 3Sum*](docs/3Sum.md)\r\n  * [*16. 3Sum Closest*](docs/3Sum_Closest.md)\r\n  * [*19. Remove Nth Node From End of List*](docs/Remove_Nth_Node_From_End_of_List.md)\r\n  * [*24. Swap Nodes in Paris*](docs/Swap_Nodes_in_Pairs.md)\r\n  * [*28. Implement strStr()*](docs/Implement_strStr().md)\r\n  * [*31. Next Permutation*](docs/Next_Permutation.md)\r\n  * [*125. Valid Palindrome*](docs/Valid_Palindrome.md)\r\n  * [*344. Reverse String*](docs/Reverse_String.md)\r\n\r\n\r\n### Note\r\n  * [*一些Java使用中的技巧*](docs/一些Java使用中的技巧.md)\r\n  * [*刷LeetCode时遇到的一些知识点：*](docs/刷LeetCode时遇到的一些知识点.md)\n  * [*排序*](docs/排序.md)\r\n  * [*矩阵的转置变换、翻转行/列、旋转*](docs/矩阵变换.md)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshawnnew%2Fmyleetcodeanswer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshawnnew%2Fmyleetcodeanswer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshawnnew%2Fmyleetcodeanswer/lists"}