From e2e9269ec2dc0a2671c2da1320718ae811bbd103 Mon Sep 17 00:00:00 2001 From: jackfiled Date: Fri, 12 Jan 2024 23:09:43 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E5=8A=A8=E5=B7=B2?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=9A=84=E9=A2=98=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/problem/mod.rs | 17 +++++++++++++++++ .../p0001_two_sum.rs} | 0 .../p0002_add_two_numbers.rs} | 0 ...t_substring_without_repeating_characters.rs} | 0 .../p0004_median_of_two_sorted_arrays.rs} | 0 .../p0006_zigzag_conversion.rs} | 0 .../p0007_reverse_integer.rs} | 0 .../p0009_palindrome_number.rs} | 0 .../p0020_valid_parentheses.rs} | 0 .../p0052_n_queens_ii.rs} | 0 .../p0162_find_peak_element.rs} | 0 .../p0447_number_of_boomerangs.rs} | 0 .../p0743_network_delay_time.rs} | 0 .../p0912_sort_an_array.rs} | 0 ..._of_burgers_with_no_waste_of_ingredients.rs} | 0 ...5_count_common_words_with_one_occurrence.rs} | 0 ...97_lexicographically_smallest_palindrome.rs} | 0 ...check_if_a_string_is_an_acronym_of_words.rs} | 0 src/solution/mod.rs | 17 ----------------- template.rs | 8 ++------ 20 files changed, 19 insertions(+), 23 deletions(-) rename src/{solution/s0001_two_sum.rs => problem/p0001_two_sum.rs} (100%) rename src/{solution/s0002_add_two_numbers.rs => problem/p0002_add_two_numbers.rs} (100%) rename src/{solution/s0003_longest_substring_without_repeating_characters.rs => problem/p0003_longest_substring_without_repeating_characters.rs} (100%) rename src/{solution/s0004_median_of_two_sorted_arrays.rs => problem/p0004_median_of_two_sorted_arrays.rs} (100%) rename src/{solution/s0006_zigzag_conversion.rs => problem/p0006_zigzag_conversion.rs} (100%) rename src/{solution/s0007_reverse_integer.rs => problem/p0007_reverse_integer.rs} (100%) rename src/{solution/s0009_palindrome_number.rs => problem/p0009_palindrome_number.rs} (100%) rename src/{solution/s0020_valid_parentheses.rs => problem/p0020_valid_parentheses.rs} (100%) rename src/{solution/s0052_n_queens_ii.rs => problem/p0052_n_queens_ii.rs} (100%) rename src/{solution/s0162_find_peak_element.rs => problem/p0162_find_peak_element.rs} (100%) rename src/{solution/s0447_number_of_boomerangs.rs => problem/p0447_number_of_boomerangs.rs} (100%) rename src/{solution/s0743_network_delay_time.rs => problem/p0743_network_delay_time.rs} (100%) rename src/{solution/s0912_sort_an_array.rs => problem/p0912_sort_an_array.rs} (100%) rename src/{solution/s1276_number_of_burgers_with_no_waste_of_ingredients.rs => problem/p1276_number_of_burgers_with_no_waste_of_ingredients.rs} (100%) rename src/{solution/s2085_count_common_words_with_one_occurrence.rs => problem/p2085_count_common_words_with_one_occurrence.rs} (100%) rename src/{solution/s2697_lexicographically_smallest_palindrome.rs => problem/p2697_lexicographically_smallest_palindrome.rs} (100%) rename src/{solution/s2828_check_if_a_string_is_an_acronym_of_words.rs => problem/p2828_check_if_a_string_is_an_acronym_of_words.rs} (100%) delete mode 100644 src/solution/mod.rs diff --git a/src/problem/mod.rs b/src/problem/mod.rs index e69de29..014dfa9 100644 --- a/src/problem/mod.rs +++ b/src/problem/mod.rs @@ -0,0 +1,17 @@ +mod p0001_two_sum; +mod p0009_palindrome_number; +mod p0020_valid_parentheses; +mod p2697_lexicographically_smallest_palindrome; +mod p0002_add_two_numbers; +mod p0003_longest_substring_without_repeating_characters; +mod p0162_find_peak_element; +mod p2828_check_if_a_string_is_an_acronym_of_words; +mod p0052_n_queens_ii; +mod p0912_sort_an_array; +mod p1276_number_of_burgers_with_no_waste_of_ingredients; +mod p0006_zigzag_conversion; +mod p0007_reverse_integer; +mod p0004_median_of_two_sorted_arrays; +mod p0743_network_delay_time; +mod p0447_number_of_boomerangs; +mod p2085_count_common_words_with_one_occurrence; diff --git a/src/solution/s0001_two_sum.rs b/src/problem/p0001_two_sum.rs similarity index 100% rename from src/solution/s0001_two_sum.rs rename to src/problem/p0001_two_sum.rs diff --git a/src/solution/s0002_add_two_numbers.rs b/src/problem/p0002_add_two_numbers.rs similarity index 100% rename from src/solution/s0002_add_two_numbers.rs rename to src/problem/p0002_add_two_numbers.rs diff --git a/src/solution/s0003_longest_substring_without_repeating_characters.rs b/src/problem/p0003_longest_substring_without_repeating_characters.rs similarity index 100% rename from src/solution/s0003_longest_substring_without_repeating_characters.rs rename to src/problem/p0003_longest_substring_without_repeating_characters.rs diff --git a/src/solution/s0004_median_of_two_sorted_arrays.rs b/src/problem/p0004_median_of_two_sorted_arrays.rs similarity index 100% rename from src/solution/s0004_median_of_two_sorted_arrays.rs rename to src/problem/p0004_median_of_two_sorted_arrays.rs diff --git a/src/solution/s0006_zigzag_conversion.rs b/src/problem/p0006_zigzag_conversion.rs similarity index 100% rename from src/solution/s0006_zigzag_conversion.rs rename to src/problem/p0006_zigzag_conversion.rs diff --git a/src/solution/s0007_reverse_integer.rs b/src/problem/p0007_reverse_integer.rs similarity index 100% rename from src/solution/s0007_reverse_integer.rs rename to src/problem/p0007_reverse_integer.rs diff --git a/src/solution/s0009_palindrome_number.rs b/src/problem/p0009_palindrome_number.rs similarity index 100% rename from src/solution/s0009_palindrome_number.rs rename to src/problem/p0009_palindrome_number.rs diff --git a/src/solution/s0020_valid_parentheses.rs b/src/problem/p0020_valid_parentheses.rs similarity index 100% rename from src/solution/s0020_valid_parentheses.rs rename to src/problem/p0020_valid_parentheses.rs diff --git a/src/solution/s0052_n_queens_ii.rs b/src/problem/p0052_n_queens_ii.rs similarity index 100% rename from src/solution/s0052_n_queens_ii.rs rename to src/problem/p0052_n_queens_ii.rs diff --git a/src/solution/s0162_find_peak_element.rs b/src/problem/p0162_find_peak_element.rs similarity index 100% rename from src/solution/s0162_find_peak_element.rs rename to src/problem/p0162_find_peak_element.rs diff --git a/src/solution/s0447_number_of_boomerangs.rs b/src/problem/p0447_number_of_boomerangs.rs similarity index 100% rename from src/solution/s0447_number_of_boomerangs.rs rename to src/problem/p0447_number_of_boomerangs.rs diff --git a/src/solution/s0743_network_delay_time.rs b/src/problem/p0743_network_delay_time.rs similarity index 100% rename from src/solution/s0743_network_delay_time.rs rename to src/problem/p0743_network_delay_time.rs diff --git a/src/solution/s0912_sort_an_array.rs b/src/problem/p0912_sort_an_array.rs similarity index 100% rename from src/solution/s0912_sort_an_array.rs rename to src/problem/p0912_sort_an_array.rs diff --git a/src/solution/s1276_number_of_burgers_with_no_waste_of_ingredients.rs b/src/problem/p1276_number_of_burgers_with_no_waste_of_ingredients.rs similarity index 100% rename from src/solution/s1276_number_of_burgers_with_no_waste_of_ingredients.rs rename to src/problem/p1276_number_of_burgers_with_no_waste_of_ingredients.rs diff --git a/src/solution/s2085_count_common_words_with_one_occurrence.rs b/src/problem/p2085_count_common_words_with_one_occurrence.rs similarity index 100% rename from src/solution/s2085_count_common_words_with_one_occurrence.rs rename to src/problem/p2085_count_common_words_with_one_occurrence.rs diff --git a/src/solution/s2697_lexicographically_smallest_palindrome.rs b/src/problem/p2697_lexicographically_smallest_palindrome.rs similarity index 100% rename from src/solution/s2697_lexicographically_smallest_palindrome.rs rename to src/problem/p2697_lexicographically_smallest_palindrome.rs diff --git a/src/solution/s2828_check_if_a_string_is_an_acronym_of_words.rs b/src/problem/p2828_check_if_a_string_is_an_acronym_of_words.rs similarity index 100% rename from src/solution/s2828_check_if_a_string_is_an_acronym_of_words.rs rename to src/problem/p2828_check_if_a_string_is_an_acronym_of_words.rs diff --git a/src/solution/mod.rs b/src/solution/mod.rs deleted file mode 100644 index e2e4d33..0000000 --- a/src/solution/mod.rs +++ /dev/null @@ -1,17 +0,0 @@ -mod s0001_two_sum; -mod s0009_palindrome_number; -mod s0020_valid_parentheses; -mod s2697_lexicographically_smallest_palindrome; -mod s0002_add_two_numbers; -mod s0003_longest_substring_without_repeating_characters; -mod s0162_find_peak_element; -mod s2828_check_if_a_string_is_an_acronym_of_words; -mod s0052_n_queens_ii; -mod s0912_sort_an_array; -mod s1276_number_of_burgers_with_no_waste_of_ingredients; -mod s0006_zigzag_conversion; -mod s0007_reverse_integer; -mod s0004_median_of_two_sorted_arrays; -mod s0743_network_delay_time; -mod s0447_number_of_boomerangs; -mod s2085_count_common_words_with_one_occurrence; diff --git a/template.rs b/template.rs index 11411f0..8b03a4e 100644 --- a/template.rs +++ b/template.rs @@ -1,12 +1,8 @@ /** * [__PROBLEM_ID__] __PROBLEM_TITLE__ - * - * __PROBLEM_DESC__ */ -pub struct Solution {}__EXTRA_USE__ - -// problem: __PROBLEM_LINK__ -// discuss: __DISCUSS_LINK__ +pub struct Solution {} +__EXTRA_USE__ // submission codes start here