leetcode

所属分类:Leetcode/题库
开发工具:GO
文件大小:4032KB
下载次数:0
上传日期:2023-01-15 19:53:03
上 传 者sh-1993
说明:  leetcode,果朗的leetcode解决方案
(leetcode,leetcode solution in Golang)

文件列表:
0001_Two_Sum (0, 2023-01-16)
0001_Two_Sum\benchmark_test.go (634, 2023-01-16)
0001_Two_Sum\hashmap.go (447, 2023-01-16)
0001_Two_Sum\naive.go (496, 2023-01-16)
0001_Two_Sum\problem.txt (637, 2023-01-16)
0001_Two_Sum\总结.txt (248, 2023-01-16)
0002_Add_Two_Numbers (0, 2023-01-16)
0002_Add_Two_Numbers\naive.go (1340, 2023-01-16)
0002_Add_Two_Numbers\problem.txt (736, 2023-01-16)
0003_Longest_Substring_Without_Repeating_Characters (0, 2023-01-16)
0003_Longest_Substring_Without_Repeating_Characters\naive_twopointer_hashmap.go (702, 2023-01-16)
0003_Longest_Substring_Without_Repeating_Characters\problem.txt (613, 2023-01-16)
0003_Longest_Substring_Without_Repeating_Characters\simplified.go (552, 2023-01-16)
0004_Median_of_Two_Sorted_Arrays (0, 2023-01-16)
0004_Median_of_Two_Sorted_Arrays\problem.txt (745, 2023-01-16)
0004_Median_of_Two_Sorted_Arrays\solution.go (2231, 2023-01-16)
0005_Longest_Palindromic_Substring (0, 2023-01-16)
0005_Longest_Palindromic_Substring\problem.txt (387, 2023-01-16)
0005_Longest_Palindromic_Substring\solution.go (798, 2023-01-16)
0007_Reverse_Integer (0, 2023-01-16)
0007_Reverse_Integer\naive.go (709, 2023-01-16)
0007_Reverse_Integer\problem.txt (465, 2023-01-16)
0008_String_to_Integer (0, 2023-01-16)
0008_String_to_Integer\naive.go (1279, 2023-01-16)
0008_String_to_Integer\problem.txt (3635, 2023-01-16)
0009_Palindrome_Number (0, 2023-01-16)
0009_Palindrome_Number\naive.go (818, 2023-01-16)
0009_Palindrome_Number\problem.txt (661, 2023-01-16)
0010_Regular_Expression_Matching (0, 2023-01-16)
0010_Regular_Expression_Matching\naive.go (1259, 2023-01-16)
0010_Regular_Expression_Matching\problem.txt (1153, 2023-01-16)
0011_Container_With_Most_Water (0, 2023-01-16)
0011_Container_With_Most_Water\naive.go (582, 2023-01-16)
0011_Container_With_Most_Water\problem.txt (805, 2023-01-16)
0011_Container_With_Most_Water\question_11.jpg (18362, 2023-01-16)
0012_Integer_to_Roman (0, 2023-01-16)
0012_Integer_to_Roman\naive.go (728, 2023-01-16)
0012_Integer_to_Roman\problem.txt (1331, 2023-01-16)
... ...

# LeetCode in Go ## LeetCode Algorithm/Solution in Golang 1. One folder One problem. Each folder contains a txt file which describe the problem. - The solution easy to figure out (for me) is in naive*.go, the name may contain some info about method used. For the rest *.go (eg. solution.go) is the solution i learned after research (especially thank to all who contributed to the “Discuss” section for those brillant ideas !). - For each problem, the final solution should reach the best possible time & space complexity, before move on to the next problem. - Commented in Chinese (we can explain the same idea with less words). 2. About Go, normally I only import fmt to print out the result to check quickly if the algorithm works as expected. For some problems which engage data types, i use my [homemade thread-safe go data type (DEPRECATED)](https://github.com/ZhengjunHUO/godtype) [homemade generic thread-safe go data type](https://github.com/ZhengjunHUO/goutil). Other [useful tools](https://github.com/ZhengjunHUO/gtoolkit) built during this adventure and will surely come into handy later. 3. I didn’t specifically note down the difficulty of the problems, because it’s quite subjective and depends on your experience on some type of problem: you can easily solve some “hard” problems if you’ve figured out some sort of “template” of this type in 10 minutes, but cat get stuck for hours by some “easy” problems you are not quite familiar or you've never seen before (like 初見殺し boss in game :) ?) | # | Title | Tags | 描述 | |---| ----- | -------- | -------- | |0001| [Two Sum](https://github.com/ZhengjunHUO/leetcode/tree/main/0001_Two_Sum) | Array HashTable | 找出和为目标值的两个元素 | |0002| [Add Two Numbers](https://github.com/ZhengjunHUO/leetcode/tree/main/0002_Add_Two_Numbers) | LinkedList Math Recursion | 数组形式表示的两数求和 | |0003| [Longest Substring Without Repeating Characters](https://github.com/ZhengjunHUO/leetcode/tree/main/0003_Longest_Substring_Without_Repeating_Characters) | HashTable SlidingWindow String TwoPointers | 求不含重复字母的子串的长度 | |0004| [Median of Two Sorted Arrays](https://github.com/ZhengjunHUO/leetcode/tree/main/0004_Median_of_Two_Sorted_Arrays) | Array BinarySearch DivideAndConquer | 求两个有序数列的中位数 | |0005| [Longest Palindromic Substring](https://github.com/ZhengjunHUO/leetcode/tree/main/0005_Longest_Palindromic_Substring) | String DynamicProgramming | 求最长回文子串 | |0007| [Reverse Integer](https://github.com/ZhengjunHUO/leetcode/tree/main/0007_Reverse_Integer) | Math | 整数反向 | |0008| [String to Integer (atoi)](https://github.com/ZhengjunHUO/leetcode/tree/main/0008_String_to_Integer) | Math String | 字符串转整数实现 | |0009| [Palindrome Number](https://github.com/ZhengjunHUO/leetcode/tree/main/0009_Palindrome_Number) | Math | 判断整数是否为回文 | |0010| [Regular Expression Matching](https://github.com/ZhengjunHUO/leetcode/tree/main/0010_Regular_Expression_Matching) | Backtracking DynamicProgramming String | 正则表达匹配实现 | |0011| [Container With Most Water](https://github.com/ZhengjunHUO/leetcode/tree/main/0011_Container_With_Most_Water) | Array TwoPointers | 确定容器的两个边界使其含水量最大化 | |0012| [Integer to Roman](https://github.com/ZhengjunHUO/leetcode/tree/main/0012_Integer_to_Roman) | Math String | 整型转罗马数字 | |0013| [Roman to Integer](https://github.com/ZhengjunHUO/leetcode/tree/main/0013_Roman_to_Integer) | Math String | 罗马数字转整型 | |0014| [Longest Common Prefix](https://github.com/ZhengjunHUO/leetcode/tree/main/0014_Longest_Common_Prefix) | String | 最长公共前缀 | |0015| [Three Sum](https://github.com/ZhengjunHUO/leetcode/tree/main/0015_Three_Sum) | Array TwoPointers | 求所有和为0的三元组 | |0016| [3Sum Closest](https://github.com/ZhengjunHUO/leetcode/tree/main/0016_3Sum_Closest) | Array TwoPointers | 求和最接近目标值的三元组 | |0017| [Letter Combinations of a Phone Number](https://github.com/ZhengjunHUO/leetcode/tree/main/0017_Letter_Combinations_of_a_Phone_Number) | Backtracking HashTable String | 根据电话号码找到对应的字母组合 | |0018| [Four Sum](https://github.com/ZhengjunHUO/leetcode/tree/main/0018_Four_Sum) | Array HashTable TwoPointers | 找出所有和为目标值的四元组 | |0019| [Remove Nth Node From End of List](https://github.com/ZhengjunHUO/leetcode/tree/main/0019_Remove_Nth_Node_From_End_of_List) | LinkedList TwoPointers | 从列表中移除倒数第N个元素 | |0020| [Valid Parentheses](https://github.com/ZhengjunHUO/leetcode/tree/main/0020_Valid_Parentheses) | Stack String | 检查括号是否正确闭合 | |0021| [Merge Two Sorted Lists](https://github.com/ZhengjunHUO/leetcode/tree/main/0021_Merge_Two_Sorted_Lists) | LinkedList Recursion | 融合两个排好序的链表 | |0022| [Generate Parentheses](https://github.com/ZhengjunHUO/leetcode/tree/main/0022_Generate_Parentheses) | Backtracking DynamicProgramming String | 生成括号对 | |0023| [Merge k Sorted Lists](https://github.com/ZhengjunHUO/leetcode/tree/main/0023_Merge_k_Sorted_Lists) | DivideAndConquer Heap LinkedList MergeSort | 融合k个排好序的列表 | |0024| [Swap Nodes in Pairs](https://github.com/ZhengjunHUO/leetcode/tree/main/0024_Swap_Nodes_in_Pairs) | LinkedList Recursion | 链表相邻两个结点对调 | |0025| [Reverse Nodes in k-Group](https://github.com/ZhengjunHUO/leetcode/tree/main/0025_Reverse_Nodes_in_kGroup) | LinkedList Recursion | 链表中k个元素一组反转组内元素 | |0026| [Remove Duplicates from Sorted Array](https://github.com/ZhengjunHUO/leetcode/tree/main/0026_Remove_Duplicates_from_Sorted_Array) | Array TwoPointers | 移除数组中多余的元素(in place) | |0027| [Remove Element](https://github.com/ZhengjunHUO/leetcode/tree/main/0027_Remove_Element) | Array TwoPointers | 移除数组中指定元素(in place) | |0028| [Implement strStr()](https://github.com/ZhengjunHUO/leetcode/tree/main/0028_Implement_strStr) | String TwoPointers | 找出pattern在字符串中第一次出现的位置 | |0030| [Substring with Concatenation of All Words](https://github.com/ZhengjunHUO/leetcode/tree/main/0030_Substring_with_Concatenation_of_All_Words) | HashTable String TwoPointers | 找出内容为"以任意顺序拼接的所有给定单词"的子串 | |0031| [Next Permutation](https://github.com/ZhengjunHUO/leetcode/tree/main/0031_Next_Permutation) | Array TwoPointers | 按字典顺序寻找当前数组的后一个排列 | |0032| [Longest Valid Parentheses](https://github.com/ZhengjunHUO/leetcode/tree/main/0032_Longest_Valid_Parentheses) | DynamicProgramming Stack String | 最长的合法括号子串 | |0033| [Search in Rotated Sorted Array](https://github.com/ZhengjunHUO/leetcode/tree/main/0033_Search_in_Rotated_Sorted_Array) | Array BinarySearch | 在一个循环升序数列中寻找某数 | |0034| [Find First and Last Position of Element in Sorted Array](https://github.com/ZhengjunHUO/leetcode/tree/main/0034_Find_First_and_Last_Position_of_Element_in_Sorted_Array) | Array BinarySearch | 在有序数列中找到某元素的起始和中止index | |0035| [Search Insert Position](https://github.com/ZhengjunHUO/leetcode/tree/main/0035_Search_Insert_Position) | Array BinarySearch | 为某数在一个升序数列中寻找插入位置 | |0037| [Sudoku Solver](https://github.com/ZhengjunHUO/leetcode/tree/main/0037_Sudoku_Solver) | Array Backtracking Matrix | 数独 | |0039| [Combination Sum](https://github.com/ZhengjunHUO/leetcode/tree/main/0039_Combination_Sum) | Array Backtracking | 找出所有和为目标值的元素(元素可重复使用)组成的列表 | |0040| [Combination Sum II](https://github.com/ZhengjunHUO/leetcode/tree/main/0040_Combination_Sum_II) | Array Backtracking | 找出所有和为目标值的元素(元素不可重复使用)组成的列表 | |0041| [First Missing Positive](https://github.com/ZhengjunHUO/leetcode/tree/main/0041_First_Missing_Positive) | Array HashTable | 找到数列缺失的最小正整数 | |0042| [Trapping Rain Water](https://github.com/ZhengjunHUO/leetcode/tree/main/0042_Trapping_Rain_Water) | Array Stack TwoPointers DynamicProgramming | 计算二维地形的积水量 | |0043| [Multiply Strings](https://github.com/ZhengjunHUO/leetcode/tree/main/0043_Multiply_Strings) | Math String | 计算以字符串描述的两数的乘积 | |0045| [Jump Game II](https://github.com/ZhengjunHUO/leetcode/tree/main/0045_Jump_Game_II) | Array Greedy | 最小跳数到达终点 | |0046| [Permutations](https://github.com/ZhengjunHUO/leetcode/tree/main/0046_Permutations) | Array Backtracking | 求数列中所有元素排列组合的集合 | |0047| [Permutations II](https://github.com/ZhengjunHUO/leetcode/tree/main/0047_Permutations_II) | Array Backtracking | 求含重复元素数列中所有元素排列组合的集合 | |0048| [Rotate Image](https://github.com/ZhengjunHUO/leetcode/tree/main/0048_Rotate_Image) | Array Math Matrix | 顺时针旋转矩阵 | |0049| [Group Anagrams](https://github.com/ZhengjunHUO/leetcode/tree/main/0049_Group_Anagrams) | HashTable String | 将相关联的易位词组合起来 | |0050| [Pow(x, n)](https://github.com/ZhengjunHUO/leetcode/tree/main/0050_Pow) | Math Recursion | 实现次方运算 | |0051| [N-Queens](https://github.com/ZhengjunHUO/leetcode/tree/main/0051_N-Queens) | Array Backtracking | 计算N*N的棋盘上部署N皇后的所有可能性 | |0052| [N-Queens II](https://github.com/ZhengjunHUO/leetcode/tree/main/0052_N-Queens_II) | Backtracking | 计算N*N的棋盘上部署N皇后的所有可能性的数量 | |0053| [Maximum Subarray](https://github.com/ZhengjunHUO/leetcode/tree/main/0053_Maximum_Subarray) | Array DivideAndConquer DynamicProgramming | 找到和最大的子数列 | |0054| [Spiral Matrix](https://github.com/ZhengjunHUO/leetcode/tree/main/0054_Spiral_Matrix) | Array Matrix Simulation | 按顺时针螺旋输出矩阵所有元素 | |0055| [Jump Game](https://github.com/ZhengjunHUO/leetcode/tree/main/0055_Jump_Game) | Array Greedy | 求是否可以跳到终点 | |0056| [Merge Intervals](https://github.com/ZhengjunHUO/leetcode/tree/main/0056_Merge_Intervals) | Array Sorting | 合并重叠的区间 | |0057| [Insert Interval](https://github.com/ZhengjunHUO/leetcode/tree/main/0057_Insert_Interval) | Array | 插入区间(如有重叠需融合) | |0058| [Length of Last Word](https://github.com/ZhengjunHUO/leetcode/tree/main/0058_Length_of_Last_Word) | String | 最后一个词的长度 | |0059| [Spiral Matrix II](https://github.com/ZhengjunHUO/leetcode/tree/main/0059_Spiral_Matrix_II) | Array Matrix Simulation | 按顺时针螺旋向矩阵中插入元素 | |0060| [Permutation Sequence](https://github.com/ZhengjunHUO/leetcode/tree/main/0060_Permutation_Sequence) | Math Recursion | 在数列的所有排列组合中按字典顺序找出第k个组合 | |0061| [Rotate List](https://github.com/ZhengjunHUO/leetcode/tree/main/0061_Rotate_List) | LinkedList TwoPointers | 将链表的末尾移到链首 | |0062| [Unique Paths](https://github.com/ZhengjunHUO/leetcode/tree/main/0062_Unique_Paths) | Combinatorics DynamicProgramming Math | 计算从矩阵左上角到右下角的路线数 | |0063| [Unique Paths II](https://github.com/ZhengjunHUO/leetcode/tree/main/0063_Unique_Paths_II) | Array DynamicProgramming Matrix | 计算从含障碍物的矩阵左上角到右下角的路线数 | |00***| [Minimum Path Sum](https://github.com/ZhengjunHUO/leetcode/tree/main/00***_Minimum_Path_Sum) | Array DynamicProgramming Matrix | 计算从矩阵左上角到右下角的格子值之和最小的路线 | |0065| [Valid Number](https://github.com/ZhengjunHUO/leetcode/tree/main/0065_Valid_Number) | Math String | 检查字符串是否为合法的数 | |0066| [Plus One](https://github.com/ZhengjunHUO/leetcode/tree/main/0066_Plus_One) | Array | 以数组描述的数加一 | |0067| [Add Binary](https://github.com/ZhengjunHUO/leetcode/tree/main/0067_Add_Binary) | Math String | 字符串形式的二进制数相加 | |0069| [Sqrt(x)](https://github.com/ZhengjunHUO/leetcode/tree/main/0069_Sqrt_x) | Math BinarySearch | 求平方根 | |0070| [Climbing Stairs](https://github.com/ZhengjunHUO/leetcode/tree/main/0070_Climbing_Stairs) | DynamicProgramming Math Memoization | 求共有几种方法到达n | |0071| [Simplify Path](https://github.com/ZhengjunHUO/leetcode/tree/main/0071_Simplify_Path) | Stack String | 简化文件路径 | |0072| [Edit Distance](https://github.com/ZhengjunHUO/leetcode/tree/main/0072_Edit_Distance) | String DynamicProgramming | 求两个字符串的距离(需要增删改操作的次数)| |0073| [Set Matrix Zeroes](https://github.com/ZhengjunHUO/leetcode/tree/main/0073_Set_Matrix_Zeroes) | Array HashTable Matrix | 将矩阵中值为0的格子的行和列都置0 | |0074| [Search a 2D Matrix](https://github.com/ZhengjunHUO/leetcode/tree/main/0074_Search_a_2D_Matrix) | Array BinarySearch Matrix | 在排好序的矩阵中找元素 | |0075| [Sort Colors](https://github.com/ZhengjunHUO/leetcode/tree/main/0075_Sort_Colors) | Array Sorting TwoPointers | 三种颜色分类排序 | |0076| [Minimum Window Substring](https://github.com/ZhengjunHUO/leetcode/tree/main/0076_Minimum_Window_Substring) | HashTable SlidingWindow String TwoPointers | 在A字符串中找到包含所有B字符串字母的最小子串 | |0077| [Combinations](https://github.com/ZhengjunHUO/leetcode/tree/main/0077_Combinations) | Array Backtracking | 在1到n的范围内找出所有长度为k的组合 | |0078| [Subsets](https://github.com/ZhengjunHUO/leetcode/tree/main/0078_Subsets) | Array Backtracking BitManipulation | 找出数列的所有可能子集 | |0079| [Word Search](https://github.com/ZhengjunHUO/leetcode/tree/main/0079_Word_Search) | Array Backtracking Matrix | 矩阵中寻找一个单词 | |0080| [Remove Duplicates from Sorted Array II](https://github.com/ZhengjunHUO/leetcode/tree/main/0080_Remove_Duplicates_from_Sorted_Array_II) | Array TwoPointers | 移除数组中多余的元素(in place) | |0083| [Remove Duplicates from Sorted List](https://github.com/ZhengjunHUO/leetcode/tree/main/0083_Remove_Duplicates_from_Sorted_List) | LinkedList | 有序链表中删除重复结点 | |0084| [Largest Rectangle in Histogram](https://github.com/ZhengjunHUO/leetcode/tree/main/0084_Largest_Rectangle_in_Histogram) | Array MonotonicStack Stack | 直方图找到最到矩形 | |0088| [Merge Sorted Array](https://github.com/ZhengjunHUO/leetcode/tree/main/0088_Merge_Sorted_Array) | Array Sorting TwoPointers | 将两个排好序的字符串in-place融合 | |0090| [Subsets II](https://github.com/ZhengjunHUO/leetcode/tree/main/0090_Subsets_II) | Array Backtracking BitManipulation | 找出含重复元素数列的所有可能的不重复子集 | |0092| [Reverse Linked List II](https://github.com/ZhengjunHUO/leetcode/tree/main/0092_Reverse_Linked_List_II) | LinkedList | 反转部分链表 | |0093| [Restore IP Addresses](https://github.com/ZhengjunHUO/leetcode/tree/main/0093_Restore_IP_Addresses) | Backtracking String | 从字符串还原IP地址 | |0094| [Binary Tree Inorder Traversal](https://github.com/ZhengjunHUO/leetcode/tree/main/0094_Binary_Tree_Inorder_Traversal) | BinaryTree DepthFirstSearch Stack Tree | 中序遍历输出 | |0095| [Unique Binary Search Trees II](https://github.com/ZhengjunHUO/leetcode/tree/main/0095_Unique_Binary_Search_Trees_II) | Backtracking BinarySearchTree BinaryTree DynamicProgramming Tree | 返回从n个结点能构造的所有BST | |0096| [Unique Binary Search Trees](https://github.com/ZhengjunHUO/leetcode/tree/main/0096_Unique_Binary_Search_Trees) | BinarySearchTree BinaryTree DynamicProgramming Math Tree | 计算n个结点可以构造多少个BST | |00***| [Validate Binary Search Tree](https://github.com/ZhengjunHUO/leetcode/tree/main/00***_Validate_Binary_Search_Tree) | BinaryTree BreadthFirstSearch DepthFirstSearch Tree | 判断树是否为BST | |0099| [Recover Binary Search Tree](https://github.com/ZhengjunHUO/leetcode/tree/main/0099_Recover_Binary_Search_Tree) | BinaryTree BinarySearchTree DepthFirstSearch Tree | swap一对错位的结点使树成为BST | |0100| [Same Tree](https://github.com/ZhengjunHUO/leetcode/tree/main/0100_Same_Tree) | BinaryTree BreadthFirstSearch DepthFirstSearch Tree | 判断两棵树是否相同 | |0101| [Symmetric Tree](https://github.com/ZhengjunHUO/leetcode/tree/main/0101_Symmetric_Tree) | BinaryTree BreadthFirstSearch DepthFirstSearch Tree | 判断树是否对称 | |0105| [Construct Binary Tree from Preorder and Inorder Traversal](https://github.com/ZhengjunHUO/leetcode/tree/main/0105_Construct_Binary_Tree_from_Preorder_and_Inorder_Traversal) | Array BinaryTree DivideAndConquer HashTable Tree | 从前序遍历和中序遍历列表构建树 | |0106| [Construct Binary Tree from Inorder and Postorder Traversal](https://github.com/ZhengjunHUO/leetcode/tree/main/0106_Construct_Binary_Tree_from_Inorder_and_Postorder_Traversal) | Array BinaryTree DivideAndConquer HashTable Tree | 从中序遍历和后序遍历列表构建树 | |0108| [Convert Sorted Array to Binary Search Tree](https://github.com/ZhengjunHUO/leetcode/tree/main/0108_Convert_Sorted_Array_to_Binary_Search_Tree) | Array BinaryTree BinarySearchTree DivideAndConquer Tree | 从升序数列构建BST | |0109| [Convert Sorted List to Binary Search Tree](https://github.com/ZhengjunHUO/leetcode/tree/main/0109_Convert_Sorted_List_to_Binary_Search_Tree) | BinaryTree BinarySearchTree DivideAndConquer LinkedList Tree | 从升序链表构建BST | |0111| [Minimum Depth of Binary Tree](https://github.com/ZhengjunHUO/leetcode/tree/main/0111_Minimum_Depth_of_Binary_Tree) | BinaryTree BreadthFirstSearch DepthFirstSearch Tree | 求二叉树的最短深度 | |0112| [Path Sum](https://github.com/ZhengjunHUO/leetcode/tree/main/0112_Path_Sum) | BinaryTree DepthFirstSearch Tree | 是否存在从根到叶节点值的和等于某值的路径 | |0114| [Flatten Binary Tree to Linked List](https://github.com/ZhengjunHUO/leetcode/tree/main/0114_Flatten_Binary_Tree_to_Linked_List) | BinaryTree DepthFirstSearch LinkedList Stack Tree | 把树压成链表 | |0116| [Populating Next Right Pointers in Each Node](https://github.com/ZhengjunHUO/leetcode/tree/main/0116_Populating_Next_Right_Pointers_in_Each_Node) | BinaryTree BreadthFirstSearch DepthFirstSearch Tree | 树的同一层结点横向连接起来 | |0118| [Yanghui's Triangle](https://github.com/ZhengjunHUO/leetcode/tree/main/0118_Yanghui_Triangle) | Array DynamicProgramming | 生成杨辉三角 | |0119| [Yanghui's Triangle II](https://github.com/ZhengjunHUO/leetcode/tree/main/0119_Yanghui_Triangle_II) | Array DynamicProgramming | 生成杨辉三角的某一行 | |0120| [Triangle](https://github.com/ZhengjunHUO/leetcode/tree/main/0120_Triangle) | Array DynamicProgramming | 计算三角形二维数列从上到下最小的路径和 | |0121| [Best Time to Buy and Sell Stock](https://github.com/ZhengjunHUO/leetcode/tree/main/0121_Best_Time_to_Buy_and_Sell_Stock) | Array DynamicProgramming | 一次买卖交易获得的最大值 | |0122| [Best Time to Buy and Sell Stock II](https://github.com/ZhengjunHUO/leetcode/tree/main/0122_Best_Time_to_Buy_and_Sell_Stock_II) | Array Greedy | 不限次数交易获得的最大值 | |0123| [Best Time to Buy and Sell Stock III](https://github.com/ZhengjunHUO/leetcode/tree/main/0123_Best_Time_to_Buy_and_Sell_Stock_III) | Array DynamicProgramming | 至多两次交易获得的最大值 | |0130| [Surrounded Regions](https://github.com/ZhengjunHUO/leetcode/tree/main/0130_Surrounded_Regions) | Array BreadthFirstSearch DepthFirstSearch Matrix UnionFind | 把被X包围的O换成X | |0131| [Palindrome Partitioning](https://github.com/ZhengjunHUO/leetcode/tree/main/0131_Palindrome_Partitioning) | Backtracking DynamicProgramming String | 求字符串拆分成回文字符串数组的所有可能性 | |0136| [Single Number](https://github.com/ZhengjunHUO/leetcode/tree/main/0136_Single_Number) | Array BitManipulation | 找出数列中只出现一次的元素 | |0139| [Word Break](https://github.com/ZhengjunHUO/leetcode/tree/main/0139_Word_Break) | DynamicProgramming HashTable Memoization String Trie | 单词是否能完美拆分成存在字典中的pattern | |0141| [Linked List Cycle](https://github.com/ZhengjunHUO/leetcode/tree/main/0141_Linked_List_Cycle) | HashTable LinkedList TwoPointers | 判断链表是否有环 | |0142| [Linked List Cycle II](https://github.com/ZhengjunHUO/leetcode/tree/main/0142_Linked_List_Cycle_II) | HashTable LinkedList TwoPointers | 判断链表是否有环并找出环开始的地方 | |0144| [Binary Tree Preorder Traversal](https://github.com/ZhengjunHUO/leetcode/tree/main/0144_Binary_Tree_Preorder_Traversal) | BinaryTree DepthFirstSearch Stack Tree | 前序遍历输出 | |0145| [Binary Tree Postorder Traversal](https://github.com/Zhen ... ...

近期下载者

相关文件


收藏者