> ## 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.

# Math in Python, Part 2

> All 229 Math LeetCode problems with tested Python solutions. Part 2 of 2: problems 201-229.

Math holds 229 problems (56 Easy, 123 Medium, 50 Hard).
Generate any of them into the current directory with `lcpy gen -n <number>`.

<div className="sd-catalog-table">
  | # | Problem | Difficulty | Solution |
  | - | - | - | - |
  | 1799 | [Maximize Score After N Operations](/problems/maximize-score-after-n-operations) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximize_score_after_n_operations/solution.py) |
  | 1822 | [Sign of the Product of an Array](/problems/sign-of-the-product-of-an-array) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sign_of_the_product_of_an_array/solution.py) |
  | 1823 | [Find the Winner of the Circular Game](/problems/find-the-winner-of-the-circular-game) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_the_winner_of_the_circular_game/solution.py) |
  | 1863 | [Sum of All Subset XOR Totals](/problems/sum-of-all-subset-xor-totals) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sum_of_all_subset_xor_totals/solution.py) |
  | 1866 | [Number of Ways to Rearrange Sticks With K Sticks Visible](/problems/rearrange-sticks) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rearrange_sticks/solution.py) |
  | 1903 | [Largest Odd Number in String](/problems/largest-odd-number-in-string) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/largest_odd_number_in_string/solution.py) |
  | 2001 | [Number of Pairs of Interchangeable Rectangles](/problems/number-of-pairs-of-interchangeable-rectangles) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_pairs_of_interchangeable_rectangles/solution.py) |
  | 2028 | [Find Missing Observations](/problems/find-missing-observations) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_missing_observations/solution.py) |
  | 2033 | [Minimum Operations to Make a Uni-Value Grid](/problems/minimum-operations-to-make-a-uni-value-grid) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_operations_to_make_a_uni_value_grid/solution.py) |
  | 2038 | [Remove Colored Pieces if Both Neighbors are the Same Color](/problems/remove-colored-pieces-if-both-neighbors-are-the-same-color) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/remove_colored_pieces_if_both_neighbors_are_the_same_color/solution.py) |
  | 2101 | [Detonate the Maximum Bombs](/problems/detonate-the-maximum-bombs) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/detonate_the_maximum_bombs/solution.py) |
  | 2125 | [Number of Laser Beams in a Bank](/problems/number-of-laser-beams-in-a-bank) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_laser_beams_in_a_bank/solution.py) |
  | 2147 | [Number of Ways to Divide a Long Corridor](/problems/number-of-ways-to-divide-a-long-corridor) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_ways_to_divide_a_long_corridor/solution.py) |
  | 2348 | [Number of Zero-Filled Subarrays](/problems/number-of-zero-filled-subarrays) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_zero_filled_subarrays/solution.py) |
  | 2364 | [Count Number of Bad Pairs](/problems/count-number-of-bad-pairs) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_number_of_bad_pairs/solution.py) |
  | 2393 | [Count Strictly Increasing Subarrays](/problems/count-strictly-increasing-subarrays) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_strictly_increasing_subarrays/solution.py) |
  | 2523 | [Closest Prime Numbers in Range](/problems/closest-prime-numbers-in-range) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/closest_prime_numbers_in_range/solution.py) |
  | 2579 | [Count Total Number of Colored Cells](/problems/count-total-number-of-colored-cells) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_total_number_of_colored_cells/solution.py) |
  | 2597 | [The Number of Beautiful Subsets](/problems/the-number-of-beautiful-subsets) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/the_number_of_beautiful_subsets/solution.py) |
  | 2601 | [Prime Subtraction Operation](/problems/prime-subtraction-operation) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/prime_subtraction_operation/solution.py) |
  | 2698 | [Find the Punishment Number of an Integer](/problems/find-the-punishment-number-of-an-integer) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_the_punishment_number_of_an_integer/solution.py) |
  | 2709 | [Greatest Common Divisor Traversal](/problems/greatest-common-divisor-traversal) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/greatest_common_divisor_traversal/solution.py) |
  | 2807 | [Insert Greatest Common Divisors in Linked List](/problems/insert-greatest-common-divisors-in-linked-list) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/insert_greatest_common_divisors_in_linked_list/solution.py) |
  | 2818 | [Apply Operations to Maximize Score](/problems/apply-operations-to-maximize-score) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/apply_operations_to_maximize_score/solution.py) |
  | 2864 | [Maximum Odd Binary Number](/problems/maximum-odd-binary-number) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_odd_binary_number/solution.py) |
  | 2929 | [Distribute Candies Among Children II](/problems/distribute-candies-among-children-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/distribute_candies_among_children_ii/solution.py) |
  | 2965 | [Find Missing and Repeated Values](/problems/find-missing-and-repeated-values) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_missing_and_repeated_values/solution.py) |
  | 2971 | [Find Polygon With the Largest Perimeter](/problems/find-polygon-with-the-largest-perimeter) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_polygon_with_the_largest_perimeter/solution.py) |
  | 3264 | [Final Array State After K Multiplication Operations I](/problems/final-array-state-after-k-multiplication-operations-i) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/final_array_state_after_k_multiplication_operations_i/solution.py) |
</div>

Pages: [1](/catalog/topics/math), 2


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