> ## 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 with Tests

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

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 |
  | - | - | - | - |
  | 2 | [Add Two Numbers](/problems/add-two-numbers) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/add_two_numbers/solution.py) |
  | 7 | [Reverse Integer](/problems/reverse-integer) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reverse_integer/solution.py) |
  | 9 | [Palindrome Number](/problems/palindrome-number) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/palindrome_number/solution.py) |
  | 12 | [Integer to Roman](/problems/integer-to-roman) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/integer_to_roman/solution.py) |
  | 13 | [Roman to Integer](/problems/roman-to-integer) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/roman_to_integer/solution.py) |
  | 29 | [Divide Two Integers](/problems/divide-two-integers) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/divide_two_integers/solution.py) |
  | 43 | [Multiply Strings](/problems/multiply-strings) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/multiply_strings/solution.py) |
  | 48 | [Rotate Image](/problems/rotate-image) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rotate_image/solution.py) |
  | 50 | [Pow(x, n)](/problems/powx-n) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/powx_n/solution.py) |
  | 60 | [Permutation Sequence](/problems/permutation-sequence) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/permutation_sequence/solution.py) |
  | 62 | [Unique Paths](/problems/unique-paths) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/unique_paths/solution.py) |
  | 66 | [Plus One](/problems/plus-one) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/plus_one/solution.py) |
  | 67 | [Add Binary](/problems/add-binary) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/add_binary/solution.py) |
  | 69 | [Sqrt(x)](/problems/sqrtx) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sqrtx/solution.py) |
  | 70 | [Climbing Stairs](/problems/climbing-stairs) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/climbing_stairs/solution.py) |
  | 89 | [Gray Code](/problems/gray-code) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/gray_code/solution.py) |
  | 96 | [Unique Binary Search Trees](/problems/unique-binary-search-trees) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/unique_binary_search_trees/solution.py) |
  | 149 | [Max Points on a Line](/problems/max-points-on-a-line) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/max_points_on_a_line/solution.py) |
  | 150 | [Evaluate Reverse Polish Notation](/problems/evaluate-reverse-polish-notation) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/evaluate_reverse_polish_notation/solution.py) |
  | 166 | [Fraction to Recurring Decimal](/problems/fraction-to-recurring-decimal) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/fraction_to_recurring_decimal/solution.py) |
  | 168 | [Excel Sheet Column Title](/problems/excel-sheet-column-title) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/excel_sheet_column_title/solution.py) |
  | 171 | [Excel Sheet Column Number](/problems/excel-sheet-column-number) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/excel_sheet_column_number/solution.py) |
  | 172 | [Factorial Trailing Zeroes](/problems/factorial-trailing-zeroes) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/factorial_trailing_zeroes/solution.py) |
  | 189 | [Rotate Array](/problems/rotate-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rotate_array/solution.py) |
  | 202 | [Happy Number](/problems/happy-number) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/happy_number/solution.py) |
  | 204 | [Count Primes](/problems/count-primes) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_primes/solution.py) |
  | 223 | [Rectangle Area](/problems/rectangle-area) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rectangle_area/solution.py) |
  | 224 | [Basic Calculator](/problems/basic-calculator) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/basic_calculator/solution.py) |
  | 227 | [Basic Calculator II](/problems/basic-calculator-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/basic_calculator_ii/solution.py) |
  | 231 | [Power of Two](/problems/power-of-two) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/power_of_two/solution.py) |
  | 233 | [Number of Digit One](/problems/number-of-digit-one) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_digit_one/solution.py) |
  | 241 | [Different Ways to Add Parentheses](/problems/different-ways-to-add-parentheses) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/different_ways_to_add_parentheses/solution.py) |
  | 258 | [Add Digits](/problems/add-digits) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/add_digits/solution.py) |
  | 263 | [Ugly Number](/problems/ugly-number) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/ugly_number/solution.py) |
  | 264 | [Ugly Number II](/problems/ugly-number-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/ugly_number_ii/solution.py) |
  | 268 | [Missing Number](/problems/missing-number) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/missing_number/solution.py) |
  | 273 | [Integer to English Words](/problems/integer-to-english-words) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/integer_to_english_words/solution.py) |
  | 279 | [Perfect Squares](/problems/perfect-squares) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/perfect_squares/solution.py) |
  | 282 | [Expression Add Operators](/problems/expression-add-operators) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/expression_add_operators/solution.py) |
  | 292 | [Nim Game](/problems/nim-game) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/nim_game/solution.py) |
  | 294 | [Flip Game II](/problems/flip-game-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/flip_game_ii/solution.py) |
  | 296 | [Best Meeting Point](/problems/best-meeting-point) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/best_meeting_point/solution.py) |
  | 313 | [Super Ugly Number](/problems/super-ugly-number) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/super_ugly_number/solution.py) |
  | 319 | [Bulb Switcher](/problems/bulb-switcher) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/bulb_switcher/solution.py) |
  | 326 | [Power of Three](/problems/power-of-three) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/power_of_three/solution.py) |
  | 335 | [Self Crossing](/problems/self-crossing) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/self_crossing/solution.py) |
  | 342 | [Power of Four](/problems/power-of-four) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/power_of_four/solution.py) |
  | 343 | [Integer Break](/problems/integer-break) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/integer_break/solution.py) |
  | 356 | [Line Reflection](/problems/line-reflection) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/line_reflection/solution.py) |
  | 357 | [Count Numbers with Unique Digits](/problems/count-numbers-with-unique-digits) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_numbers_with_unique_digits/solution.py) |
  | 360 | [Sort Transformed Array](/problems/sort-transformed-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sort_transformed_array/solution.py) |
  | 365 | [Water and Jug Problem](/problems/water-and-jug-problem) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/water_and_jug_problem/solution.py) |
  | 367 | [Valid Perfect Square](/problems/valid-perfect-square) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/valid_perfect_square/solution.py) |
  | 368 | [Largest Divisible Subset](/problems/largest-divisible-subset) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/largest_divisible_subset/solution.py) |
  | 369 | [Plus One Linked List](/problems/plus-one-linked-list) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/plus_one_linked_list/solution.py) |
  | 371 | [Sum of Two Integers](/problems/sum-of-two-integers) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sum_of_two_integers/solution.py) |
  | 372 | [Super Pow](/problems/super-pow) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/super_pow/solution.py) |
  | 375 | [Guess Number Higher or Lower II](/problems/guess-number-higher-or-lower-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/guess_number_higher_or_lower_ii/solution.py) |
  | 380 | [Insert Delete GetRandom O(1)](/problems/insert-delete-getrandom-o1) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/insert_delete_getrandom_o1/solution.py) |
  | 381 | [Insert Delete GetRandom O(1) - Duplicates allowed](/problems/insert-delete-getrandom-o1-duplicates-allowed) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/insert_delete_getrandom_o1_duplicates_allowed/solution.py) |
  | 382 | [Linked List Random Node](/problems/linked-list-random-node) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/linked_list_random_node/solution.py) |
  | 384 | [Shuffle an Array](/problems/shuffle-an-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/shuffle_an_array/solution.py) |
  | 390 | [Elimination Game](/problems/elimination-game) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/elimination_game/solution.py) |
  | 391 | [Perfect Rectangle](/problems/perfect-rectangle) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/perfect_rectangle/solution.py) |
  | 396 | [Rotate Function](/problems/rotate-function) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rotate_function/solution.py) |
  | 398 | [Random Pick Index](/problems/random-pick-index) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/random_pick_index/solution.py) |
  | 400 | [Nth Digit](/problems/nth-digit) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/nth_digit/solution.py) |
  | 405 | [Convert a Number to Hexadecimal](/problems/convert-a-number-to-hexadecimal) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/convert_a_number_to_hexadecimal/solution.py) |
  | 412 | [Fizz Buzz](/problems/fizz-buzz) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/fizz_buzz/solution.py) |
  | 415 | [Add Strings](/problems/add-strings) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/add_strings/solution.py) |
  | 423 | [Reconstruct Original Digits from English](/problems/reconstruct-original-digits-from-english) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reconstruct_original_digits_from_english/solution.py) |
  | 441 | [Arranging Coins](/problems/arranging-coins) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/arranging_coins/solution.py) |
  | 445 | [Add Two Numbers II](/problems/add-two-numbers-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/add_two_numbers_ii/solution.py) |
  | 447 | [Number of Boomerangs](/problems/number-of-boomerangs) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_boomerangs/solution.py) |
  | 453 | [Minimum Moves to Equal Array Elements](/problems/minimum-moves-to-equal-array-elements) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_moves_to_equal_array_elements/solution.py) |
  | 458 | [Poor Pigs](/problems/poor-pigs) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/poor_pigs/solution.py) |
  | 462 | [Minimum Moves to Equal Array Elements II](/problems/minimum-moves-to-equal-array-elements-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_moves_to_equal_array_elements_ii/solution.py) |
  | 464 | [Can I Win](/problems/can-i-win) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/can_i_win/solution.py) |
  | 469 | [Convex Polygon](/problems/convex-polygon) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/convex_polygon/solution.py) |
  | 470 | [Implement Rand10() Using Rand7()](/problems/implement-rand10-using-rand7) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/implement_rand10_using_rand7/solution.py) |
  | 477 | [Total Hamming Distance](/problems/total-hamming-distance) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/total_hamming_distance/solution.py) |
  | 478 | [Generate Random Point in a Circle](/problems/generate-random-point-in-a-circle) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/generate_random_point_in_a_circle/solution.py) |
  | 479 | [Largest Palindrome Product](/problems/largest-palindrome-product) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/largest_palindrome_product/solution.py) |
  | 483 | [Smallest Good Base](/problems/smallest-good-base) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/smallest_good_base/solution.py) |
  | 486 | [Predict the Winner](/problems/predict-the-winner) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/predict_the_winner/solution.py) |
  | 492 | [Construct the Rectangle](/problems/construct-the-rectangle) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/construct_the_rectangle/solution.py) |
  | 497 | [Random Point in Non-overlapping Rectangles](/problems/random-point-in-non-overlapping-rectangles) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/random_point_in_non_overlapping_rectangles/solution.py) |
  | 504 | [Base 7](/problems/base-7) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/base_7/solution.py) |
  | 507 | [Perfect Number](/problems/perfect-number) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/perfect_number/solution.py) |
  | 509 | [Fibonacci Number](/problems/fibonacci-number) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/fibonacci_number/solution.py) |
  | 519 | [Random Flip Matrix](/problems/random-flip-matrix) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/random_flip_matrix/solution.py) |
  | 523 | [Continuous Subarray Sum](/problems/continuous-subarray-sum) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/continuous_subarray_sum/solution.py) |
  | 528 | [Random Pick with Weight](/problems/random-pick-with-weight) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/random_pick_with_weight/solution.py) |
  | 537 | [Complex Number Multiplication](/problems/complex-number-multiply) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/complex_number_multiply/solution.py) |
  | 539 | [Minimum Time Difference](/problems/minimum-time-difference) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_time_difference/solution.py) |
  | 553 | [Optimal Division](/problems/optimal-division) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/optimal_division/solution.py) |
  | 556 | [Next Greater Element III](/problems/next-greater-element-iii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/next_greater_element_iii/solution.py) |
  | 564 | [Find the Closest Palindrome](/problems/find-the-closest-palindrome) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_the_closest_palindrome/solution.py) |
  | 573 | [Squirrel Simulation](/problems/squirrel-simulation) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/squirrel_simulation/solution.py) |
  | 587 | [Erect the Fence](/problems/erect-the-fence) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/erect_the_fence/solution.py) |
  | 592 | [Fraction Addition and Subtraction](/problems/fraction-addition-and-subtraction) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/fraction_addition_and_subtraction/solution.py) |
  | 593 | [Valid Square](/problems/valid-square) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/valid_square/solution.py) |
  | 598 | [Range Addition II](/problems/range-addition-ii) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/range_addition_ii/solution.py) |
  | 625 | [Minimum Factorization](/problems/minimum-factorization) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_factorization/solution.py) |
  | 628 | [Maximum Product of Three Numbers](/problems/maximum-product-of-three-numbers) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_product_of_three_numbers/solution.py) |
  | 633 | [Sum of Square Numbers](/problems/sum-of-square-numbers) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sum_of_square_numbers/solution.py) |
  | 634 | [Find the Derangement of An Array](/problems/find-the-derangement-of-an-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_the_derangement_of_an_array/solution.py) |
  | 640 | [Solve the Equation](/problems/solve-the-equation) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/solve_the_equation/solution.py) |
  | 650 | [2 Keys Keyboard](/problems/two-keys-keyboard) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/two_keys_keyboard/solution.py) |
  | 651 | [4 Keys Keyboard](/problems/four-keys-keyboard) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/four_keys_keyboard/solution.py) |
  | 660 | [Remove 9](/problems/remove-9) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/remove_9/solution.py) |
  | 667 | [Beautiful Arrangement II](/problems/beautiful-arrangement-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/beautiful_arrangement_ii/solution.py) |
  | 668 | [Kth Smallest Number in Multiplication Table](/problems/kth-smallest-number-in-multiplication-table) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/kth_smallest_number_in_multiplication_table/solution.py) |
  | 670 | [Maximum Swap](/problems/maximum-swap) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_swap/solution.py) |
  | 672 | [Bulb Switcher II](/problems/bulb-switcher-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/bulb_switcher_ii/solution.py) |
  | 679 | [24 Game](/problems/game-24) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/game_24/solution.py) |
  | 710 | [Random Pick with Blacklist](/problems/random-pick-with-blacklist) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/random_pick_with_blacklist/solution.py) |
  | 728 | [Self Dividing Numbers](/problems/self-dividing-numbers) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/self_dividing_numbers/solution.py) |
  | 738 | [Monotone Increasing Digits](/problems/monotone-increasing-digits) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/monotone_increasing_digits/solution.py) |
  | 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) |
  | 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) |
  | 762 | [Prime Number of Set Bits in Binary Representation](/problems/prime-number-of-set-bits-in-binary-representation) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/prime_number_of_set_bits_in_binary_representation/solution.py) |
  | 770 | [Basic Calculator IV](/problems/basic-calculator-iv) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/basic_calculator_iv/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) |
  | 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) |
  | 780 | [Reaching Points](/problems/reaching-points) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reaching_points/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) |
  | 782 | [Transform to Chessboard](/problems/transform-to-chessboard) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/transform_to_chessboard/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) |
  | 793 | [Preimage Size of Factorial Zeroes Function](/problems/preimage-size-of-factorial-zeroes-function) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/preimage_size_of_factorial_zeroes_function/solution.py) |
  | 800 | [Similar RGB Color](/problems/similar-rgb-color) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/similar_rgb_color/solution.py) |
  | 808 | [Soup Servings](/problems/soup-servings) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/soup_servings/solution.py) |
  | 810 | [Chalkboard XOR Game](/problems/chalkboard-xor-game) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/chalkboard_xor_game/solution.py) |
  | 812 | [Largest Triangle Area](/problems/largest-triangle-area) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/largest_triangle_area/solution.py) |
  | 829 | [Consecutive Numbers Sum](/problems/consecutive-numbers-sum) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/consecutive_numbers_sum/solution.py) |
  | 836 | [Rectangle Overlap](/problems/rectangle-overlap) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rectangle_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) |
  | 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) |
  | 843 | [Guess the Word](/problems/guess-the-word) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/guess_the_word/solution.py) |
  | 858 | [Mirror Reflection](/problems/mirror-reflection) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/mirror_reflection/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) |
  | 877 | [Stone Game](/problems/stone-game) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/stone_game/solution.py) |
  | 878 | [Nth Magical Number](/problems/nth-magical-number) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/nth_magical_number/solution.py) |
  | 883 | [Projection Area of 3D Shapes](/problems/projection-area-of-3d-shapes) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/projection_area_of_3d_shapes/solution.py) |
  | 887 | [Super Egg Drop](/problems/super-egg-drop) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/super_egg_drop/solution.py) |
  | 891 | [Sum of Subsequence Widths](/problems/sum-of-subseq-widths) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sum_of_subseq_widths/solution.py) |
  | 892 | [Surface Area of 3D Shapes](/problems/surface-area-of-3d-shapes) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/surface_area_of_3d_shapes/solution.py) |
  | 899 | [Orderly Queue](/problems/orderly-queue) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/orderly_queue/solution.py) |
  | 902 | [Numbers At Most N Given Digit Set](/problems/numbers-at-most-n-given-digit-set) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/numbers_at_most_n_given_digit_set/solution.py) |
  | 906 | [Super Palindromes](/problems/super-palindromes) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/super_palindromes/solution.py) |
  | 908 | [Smallest Range I](/problems/smallest-range-i) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/smallest_range_i/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) |
  | 913 | [Cat and Mouse](/problems/cat-and-mouse) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/cat_and_mouse/solution.py) |
  | 914 | [X of a Kind in a Deck of Cards](/problems/x-of-a-kind-in-a-deck-of-cards) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/x_of_a_kind_in_a_deck_of_cards/solution.py) |
  | 920 | [Number of Music Playlists](/problems/number-of-music-playlists) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_music_playlists/solution.py) |
  | 927 | [Three Equal Parts](/problems/three-equal-parts) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/three_equal_parts/solution.py) |
  | 932 | [Beautiful Array](/problems/beautiful-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/beautiful_array/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) |
  | 952 | [Largest Component Size by Common Factor](/problems/largest-component-size-by-common-factor) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/largest_component_size_by_common_factor/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) |
  | 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) |
  | 964 | [Least Operators to Express Number](/problems/least-operators-to-express-number) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/least_operators_to_express_number/solution.py) |
  | 970 | [Powerful Integers](/problems/powerful-integers) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/powerful_integers/solution.py) |
  | 972 | [Equal Rational Numbers](/problems/equal-rational-numbers) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/equal_rational_numbers/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) |
  | 976 | [Largest Perimeter Triangle](/problems/largest-perimeter-triangle) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/largest_perimeter_triangle/solution.py) |
  | 989 | [Add to Array-Form of Integer](/problems/add-to-array-form-of-integer) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/add_to_array_form_of_integer/solution.py) |
  | 991 | [Broken Calculator](/problems/broken-calculator) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/broken_calculator/solution.py) |
  | 996 | [Number of Squareful Arrays](/problems/number-of-squareful-arrays) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_squareful_arrays/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) |
  | 1056 | [Confusing Number](/problems/confusing-number) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/confusing_number/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) |
  | 1071 | [Greatest Common Divisor of Strings](/problems/gcd-of-strings) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/gcd_of_strings/solution.py) |
  | 1088 | [Confusing Number II](/problems/confusing-number-ii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/confusing_number_ii/solution.py) |
  | 1134 | [Armstrong Number](/problems/armstrong-number) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/armstrong_number/solution.py) |
  | 1137 | [N-th Tribonacci Number](/problems/n-th-tribonacci-number) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/n_th_tribonacci_number/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) |
  | 1180 | [Count Substrings with Only One Distinct Letter](/problems/count-substrings-with-only-one-distinct-letter) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_substrings_with_only_one_distinct_letter/solution.py) |
  | 1183 | [Maximum Number of Ones](/problems/maximum-number-of-ones) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_number_of_ones/solution.py) |
  | 1215 | [Stepping Numbers](/problems/stepping-numbers) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/stepping_numbers/solution.py) |
  | 1228 | [Missing Number In Arithmetic Progression](/problems/missing-number-in-arithmetic-progression) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/missing_number_in_arithmetic_progression/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) |
  | 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) |
  | 1259 | [Handshakes That Don't Cross](/problems/handshakes-that-dont-cross) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/handshakes_that_dont_cross/solution.py) |
  | 1359 | [Count All Valid Pickup and Delivery Options](/problems/count-all-valid-pickup-and-delivery-options) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_all_valid_pickup_and_delivery_options/solution.py) |
  | 1406 | [Stone Game III](/problems/stone-game-iii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/stone_game_iii/solution.py) |
  | 1427 | [Perform String Shifts](/problems/perform-string-shifts) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/perform_string_shifts/solution.py) |
  | 1442 | [Count Triplets That Can Form Two Arrays of Equal XOR](/problems/count-triplets-that-can-form-two-arrays-of-equal-xor) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_triplets_that_can_form_two_arrays_of_equal_xor/solution.py) |
  | 1512 | [Number of Good Pairs](/problems/number-of-good-pairs) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_good_pairs/solution.py) |
  | 1518 | [Water Bottles](/problems/water-bottles) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/water_bottles/solution.py) |
  | 1523 | [Count Odd Numbers in an Interval Range](/problems/count-odd-numbers-in-an-interval-range) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_odd_numbers_in_an_interval_range/solution.py) |
  | 1524 | [Number of Sub-arrays With Odd Sum](/problems/number-of-subarrays-with-odd-sum) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_subarrays_with_odd_sum/solution.py) |
  | 1538 | [Guess the Majority in a Hidden Array](/problems/guess-the-majority-in-a-hidden-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/guess_the_majority_in_a_hidden_array/solution.py) |
  | 1611 | [Minimum One Bit Operations to Make Integers Zero](/problems/minimum-one-bit-operations-to-make-integers-zero) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_one_bit_operations_to_make_integers_zero/solution.py) |
  | 1685 | [Sum of Absolute Differences in a Sorted Array](/problems/sum-of-absolute-differences-in-a-sorted-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sum_of_absolute_differences_in_a_sorted_array/solution.py) |
  | 1688 | [Count of Matches in Tournament](/problems/count-of-matches-in-tournament) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_of_matches_in_tournament/solution.py) |
  | 1716 | [Calculate Money in Leetcode Bank](/problems/calculate-money-in-leetcode-bank) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/calculate_money_in_leetcode_bank/solution.py) |
  | 1780 | [Check if Number is a Sum of Powers of Three](/problems/check-if-number-is-a-sum-of-powers-of-three) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/check_if_number_is_a_sum_of_powers_of_three/solution.py) |
</div>

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


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