leetcode/src/problem/mod.rs
2024-10-10 11:50:02 +08:00

262 lines
9.6 KiB
Rust

mod p1_two_sum;
mod p9_palindrome_number;
mod p20_valid_parentheses;
mod p2697_lexicographically_smallest_palindrome;
mod p2_add_two_numbers;
mod p3_longest_substring_without_repeating_characters;
mod p162_find_peak_element;
mod p2828_check_if_a_string_is_an_acronym_of_words;
mod p52_n_queens_ii;
mod p912_sort_an_array;
mod p1276_number_of_burgers_with_no_waste_of_ingredients;
mod p6_zigzag_conversion;
mod p7_reverse_integer;
mod p4_median_of_two_sorted_arrays;
mod p743_network_delay_time;
mod p447_number_of_boomerangs;
mod p2085_count_common_words_with_one_occurrence;
mod p2182_construct_string_with_repeat_limit;
mod p83_remove_duplicates_from_sorted_list;
mod p82_remove_duplicates_from_sorted_list_ii;
mod p2719_count_of_integers;
mod p2744_find_maximum_number_of_string_pairs;
mod p2171_removing_minimum_number_of_magic_beans;
mod p2809_minimum_time_to_make_array_sum_at_most_x;
mod p2788_split_strings_by_separator;
mod p410_split_array_largest_sum;
mod p670_maximum_swap;
mod p2765_longest_alternating_subarray;
mod p2865_beautiful_towers_i;
mod p2859_sum_of_values_at_indices_with_k_set_bits;
mod p2846_minimum_edge_weight_equilibrium_queries_in_a_tree;
mod p2861_maximum_number_of_alloys;
mod p365_water_and_jug_problem;
mod p514_freedom_trail;
mod p2808_minimum_seconds_to_equalize_a_circular_array;
mod p2670_find_the_distinct_difference_array;
mod lcp24_nums_game;
mod p1686_stone_game_vi;
mod p1690_stone_game_vii;
mod p292_nim_game;
mod p1696_jump_game_vi;
mod lcp30_magic_tower;
mod p2641_cousins_in_binary_tree_ii;
mod p993_cousins_in_binary_tree;
mod p236_lowest_common_ancestor_of_a_binary_tree;
mod p94_binary_tree_inorder_traversal;
mod p144_binary_tree_preorder_traversal;
mod p145_binary_tree_postorder_traversal;
mod p987_vertical_order_traversal_of_a_binary_tree;
mod p102_binary_tree_level_order_traversal;
mod p107_binary_tree_level_order_traversal_ii;
mod p103_binary_tree_zigzag_level_order_traversal;
mod p105_construct_binary_tree_from_preorder_and_inorder_traversal;
mod p106_construct_binary_tree_from_inorder_and_postorder_traversal;
mod p235_lowest_common_ancestor_of_a_binary_search_tree;
mod p2583_kth_largest_sum_in_a_binary_tree;
mod p2476_closest_nodes_queries_in_a_binary_search_tree;
mod p938_range_sum_of_bst;
mod p889_construct_binary_tree_from_preorder_and_postorder_traversal;
mod p2867_count_valid_paths_in_a_tree;
mod p2673_make_costs_of_paths_equal_in_a_binary_tree;
mod p2581_count_number_of_possible_root_nodes;
mod p2369_check_if_there_is_a_valid_partition_for_the_array;
mod p2368_reachable_nodes_with_restrictions;
mod p225_implement_stack_using_queues;
mod p232_implement_queue_using_stacks;
mod p1976_number_of_ways_to_arrive_at_destination;
mod p2917_find_the_k_or_of_an_array;
mod p2575_find_the_divisibility_array_of_a_string;
mod p2834_find_the_minimum_possible_sum_of_a_beautiful_array;
mod p2386_find_the_k_sum_of_an_array;
mod p299_bulls_and_cows;
mod p2129_capitalize_the_title;
mod p1261_find_elements_in_a_contaminated_binary_tree;
mod p2864_maximum_odd_binary_number;
mod p2789_largest_element_in_an_array_after_merge_operations;
mod p2312_selling_pieces_of_wood;
mod p2684_maximum_number_of_moves_in_a_grid;
mod p310_minimum_height_trees;
mod p303_range_sum_query_immutable;
mod p1793_maximum_score_of_a_good_subarray;
mod p1969_minimum_non_zero_product_of_the_array_elements;
mod p2671_frequency_tracker;
mod p2617_minimum_number_of_visited_cells_in_a_grid;
mod p2549_count_distinct_numbers_on_board;
mod p322_coin_change;
mod p518_coin_change_ii;
mod p2642_design_graph_with_shortest_path_calculator;
mod p2580_count_ways_to_group_overlapping_ranges;
mod p1997_first_day_where_you_have_been_in_all_the_rooms;
mod p2908_minimum_sum_of_mountain_triplets_i;
mod p2952_minimum_number_of_coins_to_be_added;
mod p331_verify_preorder_serialization_of_a_binary_tree;
mod p88_merge_sorted_array;
mod p26_remove_duplicates_from_sorted_array;
mod p27_remove_element;
mod p80_remove_duplicates_from_sorted_array_ii;
mod p169_majority_element;
mod p189_rotate_array;
mod p121_best_time_to_buy_and_sell_stock;
mod p122_best_time_to_buy_and_sell_stock_ii;
mod p55_jump_game;
mod p45_jump_game_ii;
mod p274_h_index;
mod p380_insert_delete_getrandom_o1;
mod p238_product_of_array_except_self;
mod p134_gas_station;
mod p135_candy;
mod p42_trapping_rain_water;
mod p58_length_of_last_word;
mod p151_reverse_words_in_a_string;
mod p28_find_the_index_of_the_first_occurrence_in_a_string;
mod p68_text_justification;
mod p125_valid_palindrome;
mod p392_is_subsequence;
mod p167_two_sum_ii_input_array_is_sorted;
mod p209_minimum_size_subarray_sum;
mod p30_substring_with_concatenation_of_all_words;
mod p76_minimum_window_substring;
mod p36_valid_sudoku;
mod p54_spiral_matrix;
mod p48_rotate_image;
mod p73_set_matrix_zeroes;
mod p289_game_of_life;
mod p383_ransom_note;
mod p290_word_pattern;
mod p205_isomorphic_strings;
mod p242_valid_anagram;
mod p49_group_anagrams;
mod p202_happy_number;
mod p219_contains_duplicate_ii;
mod p128_longest_consecutive_sequence;
mod p228_summary_ranges;
mod p56_merge_intervals;
mod p57_insert_interval;
mod p452_minimum_number_of_arrows_to_burst_balloons;
mod p71_simplify_path;
mod p155_min_stack;
mod p150_evaluate_reverse_polish_notation;
mod p224_basic_calculator;
mod p21_merge_two_sorted_lists;
mod p104_maximum_depth_of_binary_tree;
mod p100_same_tree;
mod p226_invert_binary_tree;
mod p101_symmetric_tree;
mod p114_flatten_binary_tree_to_linked_list;
mod p112_path_sum;
mod p129_sum_root_to_leaf_numbers;
mod p124_binary_tree_maximum_path_sum;
mod p173_binary_search_tree_iterator;
mod p222_count_complete_tree_nodes;
mod p199_binary_tree_right_side_view;
mod p637_average_of_levels_in_binary_tree;
mod p530_minimum_absolute_difference_in_bst;
mod p230_kth_smallest_element_in_a_bst;
mod p98_validate_binary_search_tree;
mod p200_number_of_islands;
mod p130_surrounded_regions;
mod p399_evaluate_division;
mod p207_course_schedule;
mod p210_course_schedule_ii;
mod p909_snakes_and_ladders;
mod p433_minimum_genetic_mutation;
mod p127_word_ladder;
mod p208_implement_trie_prefix_tree;
mod p211_design_add_and_search_words_data_structure;
mod p212_word_search_ii;
mod p17_letter_combinations_of_a_phone_number;
mod p77_combinations;
mod p46_permutations;
mod p39_combination_sum;
mod p22_generate_parentheses;
mod p79_word_search;
mod p108_convert_sorted_array_to_binary_search_tree;
mod p53_maximum_subarray;
mod p918_maximum_sum_circular_subarray;
mod p35_search_insert_position;
mod p74_search_a_2d_matrix;
mod p33_search_in_rotated_sorted_array;
mod p34_find_first_and_last_position_of_element_in_sorted_array;
mod p153_find_minimum_in_rotated_sorted_array;
mod p215_kth_largest_element_in_an_array;
mod p502_ipo;
mod p373_find_k_pairs_with_smallest_sums;
mod p295_find_median_from_data_stream;
mod p67_add_binary;
mod p190_reverse_bits;
mod p191_number_of_1_bits;
mod p136_single_number;
mod p137_single_number_ii;
mod p201_bitwise_and_of_numbers_range;
mod p66_plus_one;
mod p172_factorial_trailing_zeroes;
mod p69_sqrtx;
mod p50_powx_n;
mod p149_max_points_on_a_line;
mod p70_climbing_stairs;
mod p198_house_robber;
mod p139_word_break;
mod p300_longest_increasing_subsequence;
mod p120_triangle;
mod p64_minimum_path_sum;
mod p63_unique_paths_ii;
mod p97_interleaving_string;
mod p72_edit_distance;
mod p123_best_time_to_buy_and_sell_stock_iii;
mod p188_best_time_to_buy_and_sell_stock_iv;
mod p221_maximal_square;
mod p3117_minimum_sum_of_values_by_dividing_array;
mod p3137_minimum_number_of_operations_to_make_word_k_periodic;
mod p551_student_attendance_record_i;
mod p552_student_attendance_record_ii;
mod p3154_find_number_of_ways_to_reach_the_k_th_stair;
mod p3007_maximum_number_that_sum_of_the_prices_is_less_than_or_equal_to_k;
mod p3133_minimum_array_end;
mod p3145_find_products_of_elements_of_big_array;
mod p3146_permutation_difference_between_two_strings;
mod p698_partition_to_k_equal_sum_subsets;
mod p3134_find_the_median_of_the_uniqueness_array;
mod p3144_minimum_substring_partition_of_equal_character_frequency;
mod p3142_check_if_grid_satisfies_conditions;
mod p3153_sum_of_digit_differences_of_all_pairs;
mod p3127_make_a_square_with_the_same_color;
mod p1450_number_of_students_doing_homework_at_a_given_time;
mod p2024_maximize_the_confusion_of_an_exam;
mod p2708_maximum_strength_of_a_group;
mod p2860_happy_students;
mod p3174_clear_digits;
mod p3176_find_the_maximum_length_of_a_good_subsequence_i;
mod p3177_find_the_maximum_length_of_a_good_subsequence_ii;
mod p977_squares_of_a_sorted_array;
mod p2181_merge_nodes_in_between_zeros;
mod p2552_count_increasing_quadruplets;
mod p2555_maximize_win_from_two_segments;
mod p2576_find_the_maximum_number_of_marked_indices;
mod p2398_maximum_number_of_robots_within_budget;
mod p2390_removing_stars_from_a_string;
mod p2848_points_that_intersect_with_cars;
mod p1184_distance_between_bus_stops;
mod p815_bus_routes;
mod p2332_the_latest_time_to_catch_a_bus;
mod p2414_length_of_the_longest_alphabetical_continuous_substring;
mod p2376_count_special_integers;
mod p2374_node_with_highest_edge_score;
mod p997_find_the_town_judge;
mod p2207_maximize_number_of_subsequences_in_a_string;
mod p2306_naming_a_company;
mod p2535_difference_between_element_sum_and_digit_sum_of_an_array;
mod p2516_take_k_of_each_character_from_left_and_right;
mod p2286_booking_concert_tickets_in_groups;
mod p2073_time_needed_to_buy_tickets;
mod p1845_seat_reservation_manager;
mod p983_minimum_cost_for_tickets;
mod p1870_minimum_speed_to_arrive_on_time;
mod p1928_minimum_cost_to_reach_destination_in_time;
mod p1227_airplane_seat_assignment_probability;
mod p2187_minimum_time_to_complete_trips;
mod p871_minimum_number_of_refueling_stops;
mod p1436_destination_city;
mod p3171_find_subarray_with_bitwise_or_closest_to_k;
mod p3162_find_the_number_of_good_pairs_i;