> ## Documentation Index
> Fetch the complete documentation index at: https://leetcode-py.wisl.dev/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> leetcode-py is a Python LeetCode practice environment generator with one CLI: lcpy. It is not a service or platform.
> Each problem is a directory under leetcode/ with README.md, solution.py, test_solution.py, helpers.py, and playground.ipynb. lcpy gen creates them from JSON templates bundled with the package.
> Examples are backed by tests; copy them verbatim.

# Medium LeetCode Problems in Python, Part 3

> All 819 Medium LeetCode problems with tested Python solutions. Part 3 of 5: problems 401-600.

Medium holds 819 problems.

<div className="sd-catalog-table">
  | # | Problem | Difficulty | Solution |
  | - | - | - | - |
  | 750 | [Number Of Corner Rectangles](/problems/number-of-corner-rectangles) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_corner_rectangles/solution.py) |
  | 751 | [IP to CIDR](/problems/ip-to-cidr) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/ip_to_cidr/solution.py) |
  | 752 | [Open the Lock](/problems/open-the-lock) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/open_the_lock/solution.py) |
  | 754 | [Reach a Number](/problems/reach-a-number) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reach_a_number/solution.py) |
  | 755 | [Pour Water](/problems/pour-water) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/pour_water/solution.py) |
  | 756 | [Pyramid Transition Matrix](/problems/pyramid-transition) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/pyramid_transition/solution.py) |
  | 758 | [Bold Words in String](/problems/bold-words-in-string) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/bold_words_in_string/solution.py) |
  | 763 | [Partition Labels](/problems/partition-labels) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/partition_labels/solution.py) |
  | 764 | [Largest Plus Sign](/problems/largest-plus-sign) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/largest_plus_sign/solution.py) |
  | 767 | [Reorganize String](/problems/reorganize-string) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reorganize_string/solution.py) |
  | 769 | [Max Chunks To Make Sorted](/problems/max-chunks-to-make-sorted) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/max_chunks_to_make_sorted/solution.py) |
  | 775 | [Global and Local Inversions](/problems/global-and-local-inversions) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/global_and_local_inversions/solution.py) |
  | 776 | [Split BST](/problems/split-bst) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/split_bst/solution.py) |
  | 777 | [Swap Adjacent in LR String](/problems/swap-adjacent-in-lr-string) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/swap_adjacent_in_lr_string/solution.py) |
  | 779 | [K-th Symbol in Grammar](/problems/kth-symbol-in-grammar) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/kth_symbol_in_grammar/solution.py) |
  | 781 | [Rabbits in Forest](/problems/rabbits-in-forest) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rabbits_in_forest/solution.py) |
  | 784 | [Letter Case Permutation](/problems/letter-case-permutation) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/letter_case_permutation/solution.py) |
  | 785 | [Is Graph Bipartite?](/problems/is-graph-bipartite) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/is_graph_bipartite/solution.py) |
  | 786 | [K-th Smallest Prime Fraction](/problems/k-th-smallest-prime-fraction) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/k_th_smallest_prime_fraction/solution.py) |
  | 787 | [Cheapest Flights Within K Stops](/problems/cheapest-flights-within-k-stops) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/cheapest_flights_within_k_stops/solution.py) |
  | 788 | [Rotated Digits](/problems/rotated-digits) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rotated_digits/solution.py) |
  | 789 | [Escape The Ghosts](/problems/escape-the-ghosts) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/escape_the_ghosts/solution.py) |
  | 790 | [Domino and Tromino Tiling](/problems/domino-and-tromino-tiling) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/domino_and_tromino_tiling/solution.py) |
  | 791 | [Custom Sort String](/problems/custom-sort-string) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/custom_sort_string/solution.py) |
  | 792 | [Number of Matching Subsequences](/problems/number-of-matching-subsequences) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_matching_subsequences/solution.py) |
  | 794 | [Valid Tic-Tac-Toe State](/problems/valid-tic-tac-toe-state) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/valid_tic_tac_toe_state/solution.py) |
  | 795 | [Number of Subarrays with Bounded Maximum](/problems/number-of-subarrays-with-bounded-maximum) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_subarrays_with_bounded_maximum/solution.py) |
  | 797 | [All Paths From Source to Target](/problems/all-paths-source-target) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/all_paths_source_target/solution.py) |
  | 799 | [Champagne Tower](/problems/champagne-tower) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/champagne_tower/solution.py) |
  | 802 | [Find Eventual Safe States](/problems/find-eventual-safe-states) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_eventual_safe_states/solution.py) |
  | 807 | [Max Increase to Keep City Skyline](/problems/max-increase-to-keep-city-skyline) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/max_increase_to_keep_city_skyline/solution.py) |
  | 808 | [Soup Servings](/problems/soup-servings) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/soup_servings/solution.py) |
  | 809 | [Expressive Words](/problems/expressive-words) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/expressive_words/solution.py) |
  | 811 | [Subdomain Visit Count](/problems/subdomain-visit-count) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/subdomain_visit_count/solution.py) |
  | 813 | [Largest Sum of Averages](/problems/largest-sum-of-averages) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/largest_sum_of_averages/solution.py) |
  | 814 | [Binary Tree Pruning](/problems/binary-tree-pruning) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_tree_pruning/solution.py) |
  | 816 | [Ambiguous Coordinates](/problems/ambiguous-coordinates) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/ambiguous_coordinates/solution.py) |
  | 817 | [Linked List Components](/problems/linked-list-components) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/linked_list_components/solution.py) |
  | 820 | [Short Encoding of Words](/problems/short-encoding-of-words) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/short_encoding_of_words/solution.py) |
  | 822 | [Card Flipping Game](/problems/card-flipping-game) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/card_flipping_game/solution.py) |
  | 823 | [Binary Trees With Factors](/problems/binary-trees-with-factors) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_trees_with_factors/solution.py) |
  | 825 | [Friends Of Appropriate Ages](/problems/friends-of-appropriate-ages) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/friends_of_appropriate_ages/solution.py) |
  | 826 | [Most Profit Assigning Work](/problems/most-profit-assigning-work) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/most_profit_assigning_work/solution.py) |
  | 831 | [Masking Personal Information](/problems/masking-personal-information) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/masking_personal_information/solution.py) |
  | 833 | [Find And Replace in String](/problems/find-and-replace-in-string) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_and_replace_in_string/solution.py) |
  | 835 | [Image Overlap](/problems/image-overlap) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/image_overlap/solution.py) |
  | 837 | [New 21 Game](/problems/new-21-game) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/new_21_game/solution.py) |
  | 838 | [Push Dominoes](/problems/push-dominoes) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/push_dominoes/solution.py) |
  | 840 | [Magic Squares In Grid](/problems/magic-squares-in-grid) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/magic_squares_in_grid/solution.py) |
  | 841 | [Keys and Rooms](/problems/keys-and-rooms) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/keys_and_rooms/solution.py) |
  | 842 | [Split Array into Fibonacci Sequence](/problems/split-into-fibonacci-sequence) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/split_into_fibonacci_sequence/solution.py) |
  | 845 | [Longest Mountain in Array](/problems/longest-mountain-in-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_mountain_in_array/solution.py) |
  | 846 | [Hand of Straights](/problems/hand-of-straights) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/hand_of_straights/solution.py) |
  | 848 | [Shifting Letters](/problems/shifting-letters) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/shifting_letters/solution.py) |
  | 849 | [Maximize Distance to Closest Person](/problems/maximize-distance-to-closest-person) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximize_distance_to_closest_person/solution.py) |
  | 851 | [Loud and Rich](/problems/loud-and-rich) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/loud_and_rich/solution.py) |
  | 852 | [Peak Index in a Mountain Array](/problems/peak-index-in-a-mountain-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/peak_index_in_a_mountain_array/solution.py) |
  | 853 | [Car Fleet](/problems/car-fleet) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/car_fleet/solution.py) |
  | 855 | [Exam Room](/problems/exam-room) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/exam_room/solution.py) |
  | 856 | [Score of Parentheses](/problems/score-of-parentheses) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/score_of_parentheses/solution.py) |
  | 858 | [Mirror Reflection](/problems/mirror-reflection) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/mirror_reflection/solution.py) |
  | 861 | [Score After Flipping Matrix](/problems/score-after-flipping-matrix) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/score_after_flipping_matrix/solution.py) |
  | 863 | [All Nodes Distance K in Binary Tree](/problems/all-nodes-distance-k-in-binary-tree) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/all_nodes_distance_k_in_binary_tree/solution.py) |
  | 865 | [Smallest Subtree with all the Deepest Nodes](/problems/smallest-subtree-with-all-the-deepest-nodes) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/smallest_subtree_with_all_the_deepest_nodes/solution.py) |
  | 866 | [Prime Palindrome](/problems/prime-palindrome) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/prime_palindrome/solution.py) |
  | 869 | [Reordered Power of 2](/problems/reordered-power-of-2) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reordered_power_of_2/solution.py) |
  | 870 | [Advantage Shuffle](/problems/advantage-shuffle) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/advantage_shuffle/solution.py) |
  | 873 | [Length of Longest Fibonacci Subsequence](/problems/length-of-longest-fibonacci-subsequence) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/length_of_longest_fibonacci_subsequence/solution.py) |
  | 874 | [Walking Robot Simulation](/problems/walking-robot-simulation) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/walking_robot_simulation/solution.py) |
  | 875 | [Koko Eating Bananas](/problems/koko-eating-bananas) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/koko_eating_bananas/solution.py) |
  | 877 | [Stone Game](/problems/stone-game) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/stone_game/solution.py) |
  | 880 | [Decoded String at Index](/problems/decoded-string-at-index) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/decoded_string_at_index/solution.py) |
  | 881 | [Boats to Save People](/problems/boats-to-save-people) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/boats_to_save_people/solution.py) |
  | 885 | [Spiral Matrix III](/problems/spiral-matrix-iii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/spiral_matrix_iii/solution.py) |
  | 886 | [Possible Bipartition](/problems/possible-bipartition) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/possible_bipartition/solution.py) |
  | 889 | [Construct Binary Tree from Preorder and Postorder Traversal](/problems/construct-binary-tree-from-preorder-and-postorder-traversal) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/construct_binary_tree_from_preorder_and_postorder_traversal/solution.py) |
  | 890 | [Find and Replace Pattern](/problems/find-and-replace-pattern) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_and_replace_pattern/solution.py) |
  | 893 | [Groups of Special-Equivalent Strings](/problems/groups-of-special-equivalent-strings) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/groups_of_special_equivalent_strings/solution.py) |
  | 894 | [All Possible Full Binary Trees](/problems/all-possible-full-binary-trees) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/all_possible_full_binary_trees/solution.py) |
  | 898 | [Bitwise ORs of Subarrays](/problems/bitwise-ors-of-subarrays) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/bitwise_ors_of_subarrays/solution.py) |
  | 900 | [RLE Iterator](/problems/rle-iterator) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rle_iterator/solution.py) |
  | 901 | [Online Stock Span](/problems/online-stock-span) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/online_stock_span/solution.py) |
  | 904 | [Fruit Into Baskets](/problems/fruit-into-basket) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/fruit_into_basket/solution.py) |
  | 907 | [Sum of Subarray Minimums](/problems/sum-of-subarray-minimums) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sum_of_subarray_minimums/solution.py) |
  | 909 | [Snakes and Ladders](/problems/snakes-and-ladders) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/snakes_and_ladders/solution.py) |
  | 910 | [Smallest Range II](/problems/smallest-range-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/smallest_range_ii/solution.py) |
  | 911 | [Online Election](/problems/online-election) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/online_election/solution.py) |
  | 912 | [Sort an Array](/problems/sort-an-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sort_an_array/solution.py) |
  | 915 | [Partition Array into Disjoint Intervals](/problems/partition-array-into-disjoint-intervals) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/partition_array_into_disjoint_intervals/solution.py) |
  | 916 | [Word Subsets](/problems/word-subsets) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/word_subsets/solution.py) |
  | 918 | [Maximum Sum Circular Subarray](/problems/maximum-sum-circular-subarray) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_sum_circular_subarray/solution.py) |
  | 919 | [Complete Binary Tree Inserter](/problems/complete-binary-tree-inserter) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/complete_binary_tree_inserter/solution.py) |
  | 921 | [Minimum Add to Make Parentheses Valid](/problems/minimum-add-to-make-parentheses-valid) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_add_to_make_parentheses_valid/solution.py) |
  | 923 | [3Sum With Multiplicity](/problems/three-sum-multiplicity) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/three_sum_multiplicity/solution.py) |
  | 926 | [Flip String to Monotone Increasing](/problems/flip-string-to-monotone-increasing) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/flip_string_to_monotone_increasing/solution.py) |
  | 930 | [Binary Subarrays With Sum](/problems/binary-subarrays-with-sum) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_subarrays_with_sum/solution.py) |
  | 931 | [Minimum Falling Path Sum](/problems/minimum-falling-path-sum) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_falling_path_sum/solution.py) |
  | 932 | [Beautiful Array](/problems/beautiful-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/beautiful_array/solution.py) |
  | 934 | [Shortest Bridge](/problems/shortest-bridge) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/shortest_bridge/solution.py) |
  | 935 | [Knight Dialer](/problems/knight-dialer) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/knight_dialer/solution.py) |
  | 937 | [Reorder Data in Log Files](/problems/reorder-log-files) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reorder_log_files/solution.py) |
  | 939 | [Minimum Area Rectangle](/problems/minimum-area-rectangle) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_area_rectangle/solution.py) |
  | 945 | [Minimum Increment to Make Array Unique](/problems/minimum-increment-to-make-array-unique) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_increment_to_make_array_unique/solution.py) |
  | 946 | [Validate Stack Sequences](/problems/validate-stack-sequences) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/validate_stack_sequences/solution.py) |
  | 947 | [Most Stones Removed with Same Row or Column](/problems/most-stones-removed-with-same-row-or-column) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/most_stones_removed_with_same_row_or_column/solution.py) |
  | 948 | [Bag of Tokens](/problems/bag-of-tokens) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/bag_of_tokens/solution.py) |
  | 949 | [Largest Time for Given Digits](/problems/largest-time-for-given-digits) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/largest_time_for_given_digits/solution.py) |
  | 950 | [Reveal Cards In Increasing Order](/problems/reveal-cards-in-increasing-order) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reveal_cards_in_increasing_order/solution.py) |
  | 951 | [Flip Equivalent Binary Trees](/problems/flip-equivalent-binary-trees) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/flip_equivalent_binary_trees/solution.py) |
  | 954 | [Array of Doubled Pairs](/problems/array-of-doubled-pairs) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/array_of_doubled_pairs/solution.py) |
  | 955 | [Delete Columns to Make Sorted II](/problems/delete-columns-to-make-sorted-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/delete_columns_to_make_sorted_ii/solution.py) |
  | 957 | [Prison Cells After N Days](/problems/prison-cells-after-n-days) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/prison_cells_after_n_days/solution.py) |
  | 958 | [Check Completeness of a Binary Tree](/problems/check-completeness-of-a-binary-tree) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/check_completeness_of_a_binary_tree/solution.py) |
  | 959 | [Regions Cut By Slashes](/problems/regions-cut-by-slashes) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/regions_cut_by_slashes/solution.py) |
  | 962 | [Maximum Width Ramp](/problems/maximum-width-ramp) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_width_ramp/solution.py) |
  | 963 | [Minimum Area Rectangle II](/problems/minimum-area-rectangle-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_area_rectangle_ii/solution.py) |
  | 966 | [Vowel Spellchecker](/problems/vowel-spellchecker) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/vowel_spellchecker/solution.py) |
  | 967 | [Numbers With Same Consecutive Differences](/problems/numbers-with-same-consecutive-differences) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/numbers_with_same_consecutive_differences/solution.py) |
  | 969 | [Pancake Sorting](/problems/pancake-sorting) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/pancake_sorting/solution.py) |
  | 970 | [Powerful Integers](/problems/powerful-integers) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/powerful_integers/solution.py) |
  | 971 | [Flip Binary Tree To Match Preorder Traversal](/problems/flip-binary-tree-to-match-preorder-traversal) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/flip_binary_tree_to_match_preorder_traversal/solution.py) |
  | 973 | [K Closest Points to Origin](/problems/k-closest-points-to-origin) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/k_closest_points_to_origin/solution.py) |
  | 974 | [Subarray Sums Divisible by K](/problems/subarray-sums-divisible-by-k) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/subarray_sums_divisible_by_k/solution.py) |
  | 978 | [Longest Turbulent Subarray](/problems/longest-turbulent-subarray) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_turbulent_subarray/solution.py) |
  | 979 | [Distribute Coins in Binary Tree](/problems/distribute-coins-in-binary-tree) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/distribute_coins_in_binary_tree/solution.py) |
  | 981 | [Time Based Key-Value Store](/problems/time-based-key-value-store) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/time_based_key_value_store/solution.py) |
  | 983 | [Minimum Cost For Tickets](/problems/minimum-cost-for-tickets) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_cost_for_tickets/solution.py) |
  | 984 | [String Without AAA or BBB](/problems/string-without-aaa-or-bbb) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/string_without_aaa_or_bbb/solution.py) |
  | 985 | [Sum of Even Numbers After Queries](/problems/sum-even-after-queries) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sum_even_after_queries/solution.py) |
  | 986 | [Interval List Intersections](/problems/interval-list-intersections) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/interval_list_intersections/solution.py) |
  | 988 | [Smallest String Starting From Leaf](/problems/smallest-string-starting-from-leaf) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/smallest_string_starting_from_leaf/solution.py) |
  | 990 | [Satisfiability of Equality Equations](/problems/satisfiability-of-equality-equations) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/satisfiability_of_equality_equations/solution.py) |
  | 991 | [Broken Calculator](/problems/broken-calculator) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/broken_calculator/solution.py) |
  | 994 | [Rotting Oranges](/problems/rotting-oranges) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rotting_oranges/solution.py) |
  | 998 | [Maximum Binary Tree II](/problems/maximum-binary-tree-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_binary_tree_ii/solution.py) |
  | 1004 | [Max Consecutive Ones III](/problems/max-consecutive-ones-iii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/max_consecutive_ones_iii/solution.py) |
  | 1011 | [Capacity To Ship Packages Within D Days](/problems/capacity-to-ship-packages-within-d-days) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/capacity_to_ship_packages_within_d_days/solution.py) |
  | 1014 | [Best Sightseeing Pair](/problems/best-sightseeing-pair) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/best_sightseeing_pair/solution.py) |
  | 1020 | [Number of Enclaves](/problems/number-of-enclaves) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_enclaves/solution.py) |
  | 1029 | [Two City Scheduling](/problems/two-city-scheduling) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/two_city_scheduling/solution.py) |
  | 1035 | [Uncrossed Lines](/problems/uncrossed-lines) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/uncrossed_lines/solution.py) |
  | 1041 | [Robot Bounded In Circle](/problems/robot-bounded-in-circle) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/robot_bounded_in_circle/solution.py) |
  | 1043 | [Partition Array for Maximum Sum](/problems/partition-array-for-maximum-sum) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/partition_array_for_maximum_sum/solution.py) |
  | 1048 | [Longest String Chain](/problems/longest-string-chain) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_string_chain/solution.py) |
  | 1049 | [Last Stone Weight II](/problems/last-stone-weight-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/last_stone_weight_ii/solution.py) |
  | 1052 | [Grumpy Bookstore Owner](/problems/grumpy-bookstore-owner) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/grumpy_bookstore_owner/solution.py) |
  | 1055 | [Shortest Way to Form String](/problems/shortest-way-to-form-string) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/shortest_way_to_form_string/solution.py) |
  | 1057 | [Campus Bikes](/problems/campus-bikes) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/campus_bikes/solution.py) |
  | 1058 | [Minimize Rounding Error to Meet Target](/problems/minimize-rounding-error-to-meet-target) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimize_rounding_error_to_meet_target/solution.py) |
  | 1059 | [All Paths from Source Lead to Destination](/problems/all-paths-from-source-lead-to-destination) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/all_paths_from_source_lead_to_destination/solution.py) |
  | 1060 | [Missing Element in Sorted Array](/problems/missing-element-in-sorted-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/missing_element_in_sorted_array/solution.py) |
  | 1072 | [Flip Columns For Maximum Number of Equal Rows](/problems/flip-columns-for-maximum-number-of-equal-rows) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/flip_columns_for_maximum_number_of_equal_rows/solution.py) |
  | 1079 | [Letter Tile Possibilities](/problems/letter-tile-possibilities) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/letter_tile_possibilities/solution.py) |
  | 1087 | [Brace Expansion](/problems/brace-expansion) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/brace_expansion/solution.py) |
  | 1091 | [Shortest Path in Binary Matrix](/problems/shortest-path-in-binary-matrix) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/shortest_path_in_binary_matrix/solution.py) |
  | 1094 | [Car Pooling](/problems/car-pooling) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/car_pooling/solution.py) |
  | 1100 | [Find K-Length Substrings With No Repeated Characters](/problems/find-k-length-substrings-with-no-repeated-characters) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_k_length_substrings_with_no_repeated_characters/solution.py) |
  | 1101 | [The Earliest Moment When Everyone Become Friends](/problems/the-earliest-moment-when-everyone-become-friends) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/the_earliest_moment_when_everyone_become_friends/solution.py) |
  | 1102 | [Path With Maximum Minimum Value](/problems/path-with-maximum-minimum-value) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/path_with_maximum_minimum_value/solution.py) |
  | 1105 | [Filling Bookcase Shelves](/problems/filling-bookcase-shelves) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/filling_bookcase_shelves/solution.py) |
  | 1110 | [Delete Nodes And Return Forest](/problems/delete-nodes-and-return-forest) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/delete_nodes_and_return_forest/solution.py) |
  | 1120 | [Maximum Average Subtree](/problems/maximum-average-subtree) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_average_subtree/solution.py) |
  | 1129 | [Shortest Path with Alternating Colors](/problems/shortest-path-with-alternating-colors) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/shortest_path_with_alternating_colors/solution.py) |
  | 1135 | [Connecting Cities With Minimum Cost](/problems/connecting-cities-with-minimum-cost) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/connecting_cities_with_minimum_cost/solution.py) |
  | 1136 | [Parallel Courses](/problems/parallel-courses) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/parallel_courses/solution.py) |
  | 1140 | [Stone Game II](/problems/stone-game-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/stone_game_ii/solution.py) |
  | 1143 | [Longest Common Subsequence](/problems/longest-common-subsequence) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_common_subsequence/solution.py) |
  | 1152 | [Analyze User Website Visit Pattern](/problems/analyze-user-website-visit-pattern) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/analyze_user_website_visit_pattern/solution.py) |
  | 1155 | [Number of Dice Rolls With Target Sum](/problems/number-of-dice-rolls-with-target-sum) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_dice_rolls_with_target_sum/solution.py) |
  | 1162 | [As Far from Land as Possible](/problems/as-far-from-land-as-possible) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/as_far_from_land_as_possible/solution.py) |
  | 1166 | [Design File System](/problems/design-file-system) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/design_file_system/solution.py) |
  | 1190 | [Reverse Substrings Between Each Pair of Parentheses](/problems/reverse-substrings-between-each-pair-of-parentheses) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reverse_substrings_between_each_pair_of_parentheses/solution.py) |
  | 1197 | [Minimum Knight Moves](/problems/minimum-knight-moves) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_knight_moves/solution.py) |
  | 1198 | [Find Smallest Common Element in All Rows](/problems/find-smallest-common-element-in-all-rows) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_smallest_common_element_in_all_rows/solution.py) |
  | 1208 | [Get Equal Substrings Within Budget](/problems/get-equal-substrings-within-budget) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/get_equal_substrings_within_budget/solution.py) |
  | 1209 | [Remove All Adjacent Duplicates in String II](/problems/remove-all-adjacent-duplicates-in-string-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/remove_all_adjacent_duplicates_in_string_ii/solution.py) |
  | 1214 | [Two Sum BSTs](/problems/two-sum-bsts) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/two_sum_bsts/solution.py) |
  | 1215 | [Stepping Numbers](/problems/stepping-numbers) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/stepping_numbers/solution.py) |
  | 1219 | [Path with Maximum Gold](/problems/path-with-maximum-gold) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/path_with_maximum_gold/solution.py) |
  | 1229 | [Meeting Scheduler](/problems/meeting-scheduler) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/meeting_scheduler/solution.py) |
  | 1230 | [Toss Strange Coins](/problems/toss-strange-coins) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/toss_strange_coins/solution.py) |
  | 1233 | [Remove Sub-Folders from the Filesystem](/problems/remove-sub-folders-from-the-filesystem) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/remove_sub_folders_from_the_filesystem/solution.py) |
  | 1236 | [Web Crawler](/problems/web-crawler) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/web_crawler/solution.py) |
  | 1239 | [Maximum Length of a Concatenated String with Unique Characters](/problems/maximum-length-of-a-concatenated-string-with-unique-characters) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_length_of_a_concatenated_string_with_unique_characters/solution.py) |
  | 1244 | [Design A Leaderboard](/problems/design-a-leaderboard) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/design_a_leaderboard/solution.py) |
  | 1245 | [Tree Diameter](/problems/tree-diameter) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/tree_diameter/solution.py) |
  | 1248 | [Count Number of Nice Subarrays](/problems/count-number-of-nice-subarrays) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_number_of_nice_subarrays/solution.py) |
  | 1249 | [Minimum Remove to Make Valid Parentheses](/problems/minimum-remove-to-make-valid-parentheses) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_remove_to_make_valid_parentheses/solution.py) |
  | 1254 | [Number of Closed Islands](/problems/number-of-closed-islands) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_closed_islands/solution.py) |
  | 1258 | [Synonymous Sentences](/problems/synonymous-sentences) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/synonymous_sentences/solution.py) |
  | 1265 | [Print Immutable Linked List in Reverse](/problems/print-immutable-linked-list-in-reverse) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/print_immutable_linked_list_in_reverse/solution.py) |
  | 1267 | [Count Servers that Communicate](/problems/count-servers-that-communicate) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_servers_that_communicate/solution.py) |
  | 1268 | [Search Suggestions System](/problems/search-suggestions-system) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/search_suggestions_system/solution.py) |
  | 1272 | [Remove Interval](/problems/remove-interval) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/remove_interval/solution.py) |
  | 1273 | [Delete Tree Nodes](/problems/delete-tree-nodes) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/delete_tree_nodes/solution.py) |
  | 1277 | [Count Square Submatrices with All Ones](/problems/count-square-submatrices-with-all-ones) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_square_submatrices_with_all_ones/solution.py) |
  | 1288 | [Remove Covered Intervals](/problems/remove-covered-intervals) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/remove_covered_intervals/solution.py) |
  | 1291 | [Sequential Digits](/problems/sequential-digits) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sequential_digits/solution.py) |
  | 1310 | [XOR Queries of a Subarray](/problems/xor-queries-of-a-subarray) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/xor_queries_of_a_subarray/solution.py) |
  | 1325 | [Delete Leaves With a Given Value](/problems/delete-leaves-with-a-given-value) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/delete_leaves_with_a_given_value/solution.py) |
</div>

Pages: [1](/catalog/medium), [2](/catalog/medium-2), 3, [4](/catalog/medium-4), [5](/catalog/medium-5)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.