Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3c218fc

Browse files
committed
clean code
1 parent f6d0ae3 commit 3c218fc

File tree

1 file changed

+54
-54
lines changed

1 file changed

+54
-54
lines changed

‎README.md

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Go Solution for LeetCode algorithm problems
1+
# Go Solution for Leetcode algorithm problems
22

33
[![Build Status](https://travis-ci.org/zwfang/leetcode.svg?branch=master)](https://travis-ci.org/zwfang/leetcode)
44
[![codecov](https://codecov.io/gh/zwfang/leetcode/branch/master/graph/badge.svg)](https://codecov.io/gh/zwfang/leetcode)
@@ -10,66 +10,66 @@ continually updating 😃.
1010
### [view by sorted](./src/README.md)
1111

1212
### Array
13-
* [1. Two Sum](./src/0001_two_sum/twosum.go)   *`lookup table;`*  *`hash table`*
13+
* [1. Two Sum](src/0001_two_sum/twosum.go)   *`lookup table;`*  *`hash table`*
1414
* [4. Median of Two Sorted Arrays](src/0004_median_of_two_sorted_arrays/motsa.go)   *`binary search;`*  *`divide and conquer`*
15-
* [11. Container With Most Water](./src/0011_container_with_most_water/container_with_most_water.go)   *`double index;`*  *`array`*
16-
* [26. Remove Duplicates from Sorted Array](./src/0026_remove_duplicates_from_sorted_array/rdfsa.go)   *`double index;`*  *`array`*
15+
* [11. Container With Most Water](src/0011_container_with_most_water/container_with_most_water.go)   *`double index;`*  *`array`*
16+
* [26. Remove Duplicates from Sorted Array](src/0026_remove_duplicates_from_sorted_array/rdfsa.go)   *`double index;`*  *`array`*
1717
* [27. Remove Element](src/0027_remove_element/remove_element.go)   *`double index;`*  *`array`*
1818
* [48. Rotate Image](src/0048_rotate_image/rotate_image.go)
1919
* [53. Maximum Subarray](src/0053_maximum_subarray/maximum_subarray.go)   *`dynamic programming`*
20-
* [75. Sort Colors](./src/0075_sort_colors/sort_colors.go)   *`sort;`*  *`array`*
21-
* [80. Remove Duplicates from Sorted Array II](./src/0080_remove_duplicates_from_sorted_array2/rdfsa2.go)   *`double index;`*  *`array`*
22-
* [88. Merge Sorted Array](./src/0088_merge_sorted_array/msa.go)   *`sort;`*  *`array`*
20+
* [75. Sort Colors](src/0075_sort_colors/sort_colors.go)   *`sort;`*  *`array`*
21+
* [80. Remove Duplicates from Sorted Array II](src/0080_remove_duplicates_from_sorted_array2/rdfsa2.go)   *`double index;`*  *`array`*
22+
* [88. Merge Sorted Array](src/0088_merge_sorted_array/msa.go)   *`sort;`*  *`array`*
2323
* [121. Best Time to Buy and Sell Stock](src/0121_best_time_to_buy_and_sell_stock/maxprofit.go)   *`dynamic programming;`*  *`array`*
2424
* [122. Best Time to Buy and Sell Stock II](src/0122_best_time_to_buy_and_sell_stock_2/maxprofit.go)   *`greedy;`*  *`array`*
25-
* [167. Two Sum II - Input array is sorted](./src/0167_two_sum2/two_sum2.go)   *`double index;`*  *`binary search`*
25+
* [167. Two Sum II - Input array is sorted](src/0167_two_sum2/two_sum2.go)   *`double index;`*  *`binary search`*
2626
* [179. Largest Number](src/0179_largest_number/ln.go)   *`sort`*
2727
* [200. Number of Islands](src/0200_number_of_island/number_of_island.go)   *`dfs;`*  *`bfs`*
28-
* [209. Minimum Size Subarray Sum](./src/0209_minimum_size_subarray_sum/minimum_size_subarray_sum.go)   *`sliding window`*
29-
* [215. Kth Largest Element in an Array](./src/0215_kth_largest_element_in_an_array/kthleiaa.go)   *`sort`*
28+
* [209. Minimum Size Subarray Sum](src/0209_minimum_size_subarray_sum/minimum_size_subarray_sum.go)   *`sliding window`*
29+
* [215. Kth Largest Element in an Array](src/0215_kth_largest_element_in_an_array/kthleiaa.go)   *`sort`*
3030
* [217. Contains Duplicate](src/0217_contains_duplicate/contains_duplicate.go)   *`map`*
3131
* [219. Contains Duplicate II](src/0219_contains_duplicate_2/contains_duplicate_2.go)   *`map`*
32-
* [283. Move Zeroes(solution1)](./src/0283_move_zeroes/move_zeroes.go)   *`sliding window`*
33-
* [283. Move Zeroes(solution2)](./src/0283_move_zeroes/move_zeroes2.go)   *`sliding window`*
32+
* [283. Move Zeroes(solution1)](src/0283_move_zeroes/move_zeroes.go)   *`sliding window`*
33+
* [283. Move Zeroes(solution2)](src/0283_move_zeroes/move_zeroes2.go)   *`sliding window`*
3434
* [303. Range Sum Query - Immutable](src/0303_range_sum_query/rsqim.go)
3535
* [347. Top K Frequent Elements](src/0347_top_k_frequent_elements/topkfe.go)   *`hash table;`*  *`heap`*
36-
* [349. Intersection of Two Arrays](./src/0349_intersection_of_2_arrays/intersection_of_two_arrays.go)   *`set`*
37-
* [350. Intersection of Two Arrays II](./src/0350_intersection_of_two_arrays2/intersection_of_two_arrays2.go)   *`hash table`*
38-
* [447. Number of Boomerangs](./src/0447_number_of_boomerangs/number_of_boomerangs.go)   *`hash table`*
39-
* [454. 4Sum II](./src/0454_4sum2/4sum2.go)   *`hash table`*
36+
* [349. Intersection of Two Arrays](src/0349_intersection_of_2_arrays/intersection_of_two_arrays.go)   *`set`*
37+
* [350. Intersection of Two Arrays II](src/0350_intersection_of_two_arrays2/intersection_of_two_arrays2.go)   *`hash table`*
38+
* [447. Number of Boomerangs](src/0447_number_of_boomerangs/number_of_boomerangs.go)   *`hash table`*
39+
* [454. 4Sum II](src/0454_4sum2/4sum2.go)   *`hash table`*
4040
* [674. Longest Continuous Increasing Subsequence](src/0674_longest_continuous_increasing_subsequence/lcis.go)
4141
* [713. Subarray Product Less Than K](src/0713_subarray_product_less_than_k/spltk.go)   *`sliding window`*  *`array`*
4242
* [717. 1-bit and 2-bit Characters](src/0717_1_bit_and_2_bit_characters/1bitand2bitc.go)
43-
* [747. Largest Number At Least Twice of Others](./src/0747_largest_number_at_least_twice_of_others/largest_number_at_least_twice_of_others.go)
43+
* [747. Largest Number At Least Twice of Others](src/0747_largest_number_at_least_twice_of_others/largest_number_at_least_twice_of_others.go)
4444

4545
### Stack
4646
* [155. Min Stack](src/0155_min_stack/min_stack.go)
4747
* [735. Asteroid Collision](src/0735_asteroid_collision/ac.go)
4848

4949
### String
50-
* [3. Longest Substring Without Repeating Characters](./src/0003_longest_substring_without_repeating_characters/longest_substring_without_repeating_characters.go)   *`sliding window;`*  *`hash table`*
50+
* [3. Longest Substring Without Repeating Characters](src/0003_longest_substring_without_repeating_characters/longest_substring_without_repeating_characters.go)   *`sliding window;`*  *`hash table`*
5151
* [14. Longest Common Prefix](src/0014_longest_common_prefix/lcp.go)
52-
* [17. Letter Combinations of a Phone Number](./src/0017_letter_combination_of_a_phone_number/letter_combination_of_phone_number.go)   *`tree`*
53-
* [20. Valid Parentheses](./src/0020_valid_parentheses/valid_parentheses.go)   *`stack`*
52+
* [17. Letter Combinations of a Phone Number](src/0017_letter_combination_of_a_phone_number/letter_combination_of_phone_number.go)   *`tree`*
53+
* [20. Valid Parentheses](src/0020_valid_parentheses/valid_parentheses.go)   *`stack`*
5454
* [28. Implement strStr()](src/0028_implement_strstr/implement_strstr.go)   *`double index`*
5555
* [58. Length of Last Word](src/0058_length_of_last_word/len_of_last_word.go)
56-
* [67. Add Binary](./src/0067_add_binary/add_binary.go)   *`brute force`*
57-
* [76. Minimum Window Substring](./src/0076_minimum_window_substring/minimum_window_substring.go)    *`sliding window`*
58-
* [125. Valid Palindrome](./src/0125_valid_palindrome/valid_palindrome.go)   *`string;`*  *`double index`*
56+
* [67. Add Binary](src/0067_add_binary/add_binary.go)   *`brute force`*
57+
* [76. Minimum Window Substring](src/0076_minimum_window_substring/minimum_window_substring.go)    *`sliding window`*
58+
* [125. Valid Palindrome](src/0125_valid_palindrome/valid_palindrome.go)   *`string;`*  *`double index`*
5959
* [165. Compare Version Numbers](src/0165_compare_version_numbers/compare_version_numbers.go)
60-
* [344. Reverse String](./src/0344_reverse_string/reverse_string.go)   *`string;`*  *`double index`*
61-
* [345. Reverse Vowels of a String](./src/0345_reverse_vowels_of_a_string/reverse_vowels.go)   *`string;`*  *`double index`*
62-
* [438. Find All Anagrams in a String](./src/0438_all_anagrams_in_a_string/all_anagrams_in_a_string.go)   *`sliding window`*
60+
* [344. Reverse String](src/0344_reverse_string/reverse_string.go)   *`string;`*  *`double index`*
61+
* [345. Reverse Vowels of a String](src/0345_reverse_vowels_of_a_string/reverse_vowels.go)   *`string;`*  *`double index`*
62+
* [438. Find All Anagrams in a String](src/0438_all_anagrams_in_a_string/all_anagrams_in_a_string.go)   *`sliding window`*
6363
* [557. Reverse Words in a String III](src/0557_reverse_words_in_a_string_3/reverse_words_in_a_string_3.go)
6464

6565
### Linked List
66-
* [2. Add Two Numbers](./src/0002_add_two_numbers/add_two_numbers.go)   *`recursion;`*  *`math`*
66+
* [2. Add Two Numbers](src/0002_add_two_numbers/add_two_numbers.go)   *`recursion;`*  *`math`*
6767
* [19. Remove Nth Node From End of List](src/0019_remove_nth_node_from_end_of_list/remove_nth_node_from_end_of_list.go)   *`two pointers`*
68-
* [21. Merge Two Sorted Lists](./src/0021_merge_two_sorted_lists/mergeTwoLists.go)
68+
* [21. Merge Two Sorted Lists](src/0021_merge_two_sorted_lists/mergeTwoLists.go)
6969
* [23. Merge k Sorted Lists](src/0023_merge_k_sorted_lists/mksl.go)   *`heap`*
7070
* [24. Swap Nodes in Pairs](src/0024_swap_nodes_in_pairs/swap_nodes_in_pairs.go)
71-
* [25. Reverse Nodes in k-Group](./src/0025_reverse_nodes_in_k_group/reverse_node_k_group.go)
72-
* [61. Rotate List](./src/0061_rotate_list/rotate_list.go)
71+
* [25. Reverse Nodes in k-Group](src/0025_reverse_nodes_in_k_group/reverse_node_k_group.go)
72+
* [61. Rotate List](src/0061_rotate_list/rotate_list.go)
7373
* [82. Remove Duplicates from Sorted List II](src/0082_remove_duplicates_from_sorted_list_2/rdfsl.go)
7474
* [83. Remove Duplicates from Sorted List](src/0083_remove_duplicates_from_sorted_list/rdfsl.go)
7575
* [86. Partition List](src/0086_partition_list/partition_list.go)   *`two pointers`*
@@ -80,36 +80,36 @@ continually updating 😃.
8080
* [328. Odd Even Linked List](src/0328_odd_even_linked_list/odd_even_linked_list.go)
8181

8282
### Dynamic Programming
83-
* [62. Unique Paths](./src/0062_unique_paths/unique_paths.go)   *`array`*
84-
* [63. Unique Paths 2](./src/0063_unique_paths_2/unique_paths2.go)   *`array`*
85-
* [64. Minimum Path Sum](./src/0064_minimum_path_sum/minimum_path_sum.go)   *`array`*
86-
* [70. Climbing Stairs](./src/0070_climbing_stairs/climbing_stairs.go)
87-
* [120. Triangle](./src/0120_triangle/triangle.go)   *`array`*
88-
* [198. House Robber](./src/0198_house_robber/house_robber.go)
89-
* [300. Longest Increasing Subsequence](./src/0300_longest_increasing_subsequence/lis.go)
90-
* [343. Integer Break](./src/0343_integer_break/integer_break.go)   *`math`*
91-
* [376. Wiggle Subsequence](./src/0376_wiggle_subsequence/wiggle_subsequence.go)   *`greedy;`*  *`dynamic programming`*
92-
* [416. Partition Equal Subset Sum](./src/0416_partition_equal_subset_sum/partition_equal_subset_sum.go)  *`0-1 knapsack problem`*
93-
* [435. Non-overlapping Intervals](./src/0435_non_overlapping_intervals/dp_solution.go)   *`greedy;`*  *`dynamic programming`*  *`0-1 knapsack problem`*
83+
* [62. Unique Paths](src/0062_unique_paths/unique_paths.go)   *`array`*
84+
* [63. Unique Paths 2](src/0063_unique_paths_2/unique_paths2.go)   *`array`*
85+
* [64. Minimum Path Sum](src/0064_minimum_path_sum/minimum_path_sum.go)   *`array`*
86+
* [70. Climbing Stairs](src/0070_climbing_stairs/climbing_stairs.go)
87+
* [120. Triangle](src/0120_triangle/triangle.go)   *`array`*
88+
* [198. House Robber](src/0198_house_robber/house_robber.go)
89+
* [300. Longest Increasing Subsequence](src/0300_longest_increasing_subsequence/lis.go)
90+
* [343. Integer Break](src/0343_integer_break/integer_break.go)   *`math`*
91+
* [376. Wiggle Subsequence](src/0376_wiggle_subsequence/wiggle_subsequence.go)   *`greedy;`*  *`dynamic programming`*
92+
* [416. Partition Equal Subset Sum](src/0416_partition_equal_subset_sum/partition_equal_subset_sum.go)  *`0-1 knapsack problem`*
93+
* [435. Non-overlapping Intervals](src/0435_non_overlapping_intervals/dp_solution.go)   *`greedy;`*  *`dynamic programming`*  *`0-1 knapsack problem`*
9494

9595
### Greedy
96-
* [392. Is Subsequence](./src/0392_is_subsequence/is_subsequence.go)
97-
* [435. Non-overlapping Intervals](./src/0435_non_overlapping_intervals/greedy_solution.go)   *`greedy;`*  *`dynamic programming`*
98-
* [455. Assign Cookies](./src/0455_assign_cookies/assign_cookies.go)
96+
* [392. Is Subsequence](src/0392_is_subsequence/is_subsequence.go)
97+
* [435. Non-overlapping Intervals](src/0435_non_overlapping_intervals/greedy_solution.go)   *`greedy;`*  *`dynamic programming`*
98+
* [455. Assign Cookies](src/0455_assign_cookies/assign_cookies.go)
9999

100100
### Backtracking
101101
* [77. Combinations](src/0077_combinations/combinations.go)   *`combine`*
102102
* [79. Word Search](src/0079_word_search/word_search.go)   *`array`*
103103

104104
### Tree
105-
* [94. Binary Tree Inorder Traversal](./src/0094_binary_tree_inorder_traversal/binary_tree_inorder_traversal.go)   *`binary tree;`*   *`stack`*
106-
* [100. Same Tree](./src/0100_same_tree/same_tree.go)   *`binary tree;`*   *`dfs`*
107-
* [101. Symmetric Tree](./src/0101_symmetric_tree/symmetric_tree.go)   *`binary tree;`*   *`dfs;`*  *`bfs;`*
105+
* [94. Binary Tree Inorder Traversal](src/0094_binary_tree_inorder_traversal/binary_tree_inorder_traversal.go)   *`binary tree;`*   *`stack`*
106+
* [100. Same Tree](src/0100_same_tree/same_tree.go)   *`binary tree;`*   *`dfs`*
107+
* [101. Symmetric Tree](src/0101_symmetric_tree/symmetric_tree.go)   *`binary tree;`*   *`dfs;`*  *`bfs;`*
108108
* [102. Binary Tree Level Order Traversal](src/0102_binary_tree_level_order_traversal/binary_tree_level_order_traversal.go)   *`binary tree;`*   *`dfs`*
109109
* [104. Maximum Depth of Binary Tree](src/0104_maximun_depth_of_binary_tree/maxdobt.go)   *`binary tree depth`*
110-
* [107. Binary Tree Level Order Traversal II](./src/0107_binary_tree_level_order_traversal_2/binary_tree_level_order_traversal2.go)   *`binary tree;`*   *`bfs`*
111-
* [111. Minimum Depth of Binary Tree](./src/0111_minimum_depth_of_binary_tree/minimum_depth_of_binary_tree.go)   *`binary tree;`*   *`dfs`*
112-
* [112. Path Sum](./src/0112_path_sum/path_sum.go)   *`binary tree;`*   *`dfs`*
110+
* [107. Binary Tree Level Order Traversal II](src/0107_binary_tree_level_order_traversal_2/binary_tree_level_order_traversal2.go)   *`binary tree;`*   *`bfs`*
111+
* [111. Minimum Depth of Binary Tree](src/0111_minimum_depth_of_binary_tree/minimum_depth_of_binary_tree.go)   *`binary tree;`*   *`dfs`*
112+
* [112. Path Sum](src/0112_path_sum/path_sum.go)   *`binary tree;`*   *`dfs`*
113113
* [144. Binary Tree Preorder Traversal](src/0144_binary_tree_preorder_traversal/binary_tree_preorder_traversal.go)   *`binary tree;`*   *`pre-order traversal`*
114114
* [226. Invert Binary Tree](src/0226_invert_binary_tree/invert_binary_tree.go)   *`binary tree;`*
115115
* [235. Lowest Common Ancestor of a Binary Search Tree](src/0235_lowest_common_ancestor_of_a_binary_search_tree/lcaoabst.go)   *`binary tree;`*
@@ -119,12 +119,12 @@ continually updating 😃.
119119
* [872. Leaf-Similar Trees](src/0872_leaf_similar_trees/leaf_similar_trees.go)   *`binary tree`*
120120

121121
### Binary Search
122-
* [33. Search in Rotated Sorted Array](./src/0033_search_in_rotated_sorted_array/search_in_rotated_sorted_array.go)   *`array;`*  *`binary search`*
123-
* [34. Find First and Last Position of Element in Sorted Array](./src/0034_find_first_and_last_position_of_element_in_sorted_array/find_first_and_last_position_of_element_in_sorted_array.go)   *`array;`*  *`binary search`*
122+
* [33. Search in Rotated Sorted Array](src/0033_search_in_rotated_sorted_array/search_in_rotated_sorted_array.go)   *`array;`*  *`binary search`*
123+
* [34. Find First and Last Position of Element in Sorted Array](src/0034_find_first_and_last_position_of_element_in_sorted_array/find_first_and_last_position_of_element_in_sorted_array.go)   *`array;`*  *`binary search`*
124124
* [35. Search Insert Position](src/0035_search_insert_position/search_insert_position.go)   *`array;`*  *`binary search`*
125-
* [69. Sqrt(x)](./src/0069_sqrtx/sqrtx.go)   *`math;`*  *`binary search`*
125+
* [69. Sqrt(x)](src/0069_sqrtx/sqrtx.go)   *`math;`*  *`binary search`*
126126
* [153. Find Minimum in Rotated Sorted Array](src/0153_find_minimum_in_rotated_sorted_array/fmirsa.go)
127-
* [704. Binary Search](./src/0704_binary_search/binary_search.go)
127+
* [704. Binary Search](src/0704_binary_search/binary_search.go)
128128

129129
### Math
130130
* [7. Reverse Integer](src/0007_reverse_integer/reverse_integer.go)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /