forked from aylei/leetcode-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod.rs
237 lines (237 loc) · 7.45 KB
/
mod.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
mod s0001_two_sum;
mod s0002_add_two_numbers;
mod s0003_longest_substring_without_repeating_characters;
mod s0004_median_of_two_sorted_arrays;
mod s0005_longest_palindromic_substring;
mod s0006_zigzag_conversion;
mod s0007_reverse_integer;
mod s0008_string_to_integer_atoi;
mod s0009_palindrome_number;
mod s0010_regular_expression_matching;
mod s0011_container_with_most_water;
mod s0012_integer_to_roman;
mod s0013_roman_to_integer;
mod s0014_longest_common_prefix;
mod s0015_3sum;
mod s0016_3sum_closest;
mod s0017_letter_combinations_of_a_phone_number;
mod s0018_4sum;
mod s0019_remove_nth_node_from_end_of_list;
mod s0020_valid_parentheses;
mod s0021_merge_two_sorted_lists;
mod s0022_generate_parentheses;
mod s0023_merge_k_sorted_lists;
mod s0024_swap_nodes_in_pairs;
mod s0025_reverse_nodes_in_k_group;
mod s0026_remove_duplicates_from_sorted_array;
mod s0027_remove_element;
mod s0028_implement_strstr;
mod s0029_divide_two_integers;
mod s0030_substring_with_concatenation_of_all_words;
mod s0031_next_permutation;
mod s0032_longest_valid_parentheses;
mod s0033_search_in_rotated_sorted_array;
mod s0034_find_first_and_last_position_of_element_in_sorted_array;
mod s0035_search_insert_position;
mod s0036_valid_sudoku;
mod s0037_sudoku_solver;
mod s0038_count_and_say;
mod s0039_combination_sum;
mod s0040_combination_sum_ii;
mod s0041_first_missing_positive;
mod s0042_trapping_rain_water;
mod s0043_multiply_strings;
mod s0044_wildcard_matching;
mod s0045_jump_game_ii;
mod s0046_permutations;
mod s0047_permutations_ii;
mod s0048_rotate_image;
mod s0049_group_anagrams;
mod s0050_powx_n;
mod s0051_n_queens;
mod s0052_n_queens_ii;
mod s0053_maximum_subarray;
mod s0054_spiral_matrix;
mod s0055_jump_game;
mod s0056_merge_intervals;
mod s0057_insert_interval;
mod s0058_length_of_last_word;
mod s0059_spiral_matrix_ii;
mod s0060_permutation_sequence;
mod s0061_rotate_list;
mod s0062_unique_paths;
mod s0063_unique_paths_ii;
mod s0064_minimum_path_sum;
mod s0065_valid_number;
mod s0066_plus_one;
mod s0067_add_binary;
mod s0068_text_justification;
mod s0069_sqrtx;
mod s0070_climbing_stairs;
mod s0071_simplify_path;
mod s0072_edit_distance;
mod s0073_set_matrix_zeroes;
mod s0074_search_a_2d_matrix;
mod s0075_sort_colors;
mod s0076_minimum_window_substring;
mod s0077_combinations;
mod s0078_subsets;
mod s0079_word_search;
mod s0080_remove_duplicates_from_sorted_array_ii;
mod s0081_search_in_rotated_sorted_array_ii;
mod s0082_remove_duplicates_from_sorted_list_ii;
mod s0083_remove_duplicates_from_sorted_list;
mod s0084_largest_rectangle_in_histogram;
mod s0085_maximal_rectangle;
mod s0086_partition_list;
mod s0087_scramble_string;
mod s0088_merge_sorted_array;
mod s0089_gray_code;
mod s0090_subsets_ii;
mod s0091_decode_ways;
mod s0092_reverse_linked_list_ii;
mod s0093_restore_ip_addresses;
mod s0094_binary_tree_inorder_traversal;
mod s0095_unique_binary_search_trees_ii;
mod s0096_unique_binary_search_trees;
mod s0097_interleaving_string;
mod s0098_validate_binary_search_tree;
mod s0099_recover_binary_search_tree;
mod s0100_same_tree;
mod s0101_symmetric_tree;
mod s0102_binary_tree_level_order_traversal;
mod s0103_binary_tree_zigzag_level_order_traversal;
mod s0104_maximum_depth_of_binary_tree;
mod s0105_construct_binary_tree_from_preorder_and_inorder_traversal;
mod s0106_construct_binary_tree_from_inorder_and_postorder_traversal;
mod s0107_binary_tree_level_order_traversal_ii;
mod s0108_convert_sorted_array_to_binary_search_tree;
mod s0109_convert_sorted_list_to_binary_search_tree;
mod s0110_balanced_binary_tree;
mod s0111_minimum_depth_of_binary_tree;
mod s0112_path_sum;
mod s0113_path_sum_ii;
mod s0114_flatten_binary_tree_to_linked_list;
mod s0115_distinct_subsequences;
mod s0118_pascals_triangle;
mod s0119_pascals_triangle_ii;
mod s0120_triangle;
mod s0121_best_time_to_buy_and_sell_stock;
mod s0122_best_time_to_buy_and_sell_stock_ii;
mod s0123_best_time_to_buy_and_sell_stock_iii;
mod s0124_binary_tree_maximum_path_sum;
mod s0125_valid_palindrome;
mod s0126_word_ladder_ii;
mod s0127_word_ladder;
mod s0128_longest_consecutive_sequence;
mod s0129_sum_root_to_leaf_numbers;
mod s0130_surrounded_regions;
mod s0131_palindrome_partitioning;
mod s0132_palindrome_partitioning_ii;
mod s0134_gas_station;
mod s0135_candy;
mod s0136_single_number;
mod s0137_single_number_ii;
mod s0139_word_break;
mod s0140_word_break_ii;
mod s0143_reorder_list;
mod s0144_binary_tree_preorder_traversal;
mod s0145_binary_tree_postorder_traversal;
mod s0146_lru_cache;
mod s0147_insertion_sort_list;
mod s0148_sort_list;
mod s0149_max_points_on_a_line;
mod s0150_evaluate_reverse_polish_notation;
mod s0151_reverse_words_in_a_string;
mod s0152_maximum_product_subarray;
mod s0153_find_minimum_in_rotated_sorted_array;
mod s0154_find_minimum_in_rotated_sorted_array_ii;
mod s0155_min_stack;
mod s0162_find_peak_element;
mod s0164_maximum_gap;
mod s0165_compare_version_numbers;
mod s0166_fraction_to_recurring_decimal;
mod s0167_two_sum_ii_input_array_is_sorted;
mod s0168_excel_sheet_column_title;
mod s0169_majority_element;
mod s0171_excel_sheet_column_number;
mod s0172_factorial_trailing_zeroes;
mod s0173_binary_search_tree_iterator;
mod s0174_dungeon_game;
mod s0179_largest_number;
mod s0187_repeated_dna_sequences;
mod s0188_best_time_to_buy_and_sell_stock_iv;
mod s0189_rotate_array;
mod s0198_house_robber;
mod s0199_binary_tree_right_side_view;
mod s0200_number_of_islands;
mod s0201_bitwise_and_of_numbers_range;
mod s0202_happy_number;
mod s0203_remove_linked_list_elements;
mod s0204_count_primes;
mod s0205_isomorphic_strings;
mod s0206_reverse_linked_list;
mod s0207_course_schedule;
mod s0208_implement_trie_prefix_tree;
mod s0209_minimum_size_subarray_sum;
mod s0210_course_schedule_ii;
mod s0211_add_and_search_word_data_structure_design;
mod s0212_word_search_ii;
mod s0213_house_robber_ii;
mod s0214_shortest_palindrome;
mod s0215_kth_largest_element_in_an_array;
mod s0216_combination_sum_iii;
mod s0217_contains_duplicate;
mod s0218_the_skyline_problem;
mod s0219_contains_duplicate_ii;
mod s0220_contains_duplicate_iii;
mod s0221_maximal_square;
mod s0222_count_complete_tree_nodes;
mod s0223_rectangle_area;
mod s0224_basic_calculator;
mod s0225_implement_stack_using_queues;
mod s0226_invert_binary_tree;
mod s0227_basic_calculator_ii;
mod s0228_summary_ranges;
mod s0229_majority_element_ii;
mod s0230_kth_smallest_element_in_a_bst;
mod s0231_power_of_two;
mod s0232_implement_queue_using_stacks;
mod s0233_number_of_digit_one;
mod s0238_product_of_array_except_self;
mod s0239_sliding_window_maximum;
mod s0241_different_ways_to_add_parentheses;
mod s0242_valid_anagram;
mod s0257_binary_tree_paths;
mod s0258_add_digits;
mod s0260_single_number_iii;
mod s0263_ugly_number;
mod s0264_ugly_number_ii;
mod s0268_missing_number;
mod s0273_integer_to_english_words;
mod s0274_h_index;
mod s0275_h_index_ii;
mod s0279_perfect_squares;
mod s0282_expression_add_operators;
mod s0283_move_zeroes;
mod s0287_find_the_duplicate_number;
mod s0289_game_of_life;
mod s0290_word_pattern;
mod s0292_nim_game;
mod s0295_find_median_from_data_stream;
mod s0299_bulls_and_cows;
mod s0300_longest_increasing_subsequence;
mod s0301_remove_invalid_parentheses;
mod s0303_range_sum_query_immutable;
mod s0304_range_sum_query_2d_immutable;
mod s0306_additive_number;
mod s0307_range_sum_query_mutable;
mod s0309_best_time_to_buy_and_sell_stock_with_cooldown;
mod s0310_minimum_height_trees;
mod s0312_burst_balloons;
mod s0313_super_ugly_number;
mod s0509_fibonacci_number;
mod s0704_binary_search;
mod s0969_pancake_sorting;
mod s1018_binary_prefix_divisible_by_5;
mod s1046_last_stone_weight;