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

# Number Theory in Python with Tests

> All 14 Number Theory LeetCode problems with tested Python solutions.

Number Theory holds 14 problems (2 Easy, 7 Medium, 5 Hard).
Generate any of them into the current directory with `lcpy gen -n <number>`.

<div className="sd-catalog-table">
  | # | Problem | Difficulty | Solution |
  | - | - | - | - |
  | 204 | [Count Primes](/problems/count-primes) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_primes/solution.py) |
  | 258 | [Add Digits](/problems/add-digits) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/add_digits/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) |
  | 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) |
  | 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) |
  | 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) |
  | 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) |
  | 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) |
  | 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) |
  | 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) |
  | 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) |
</div>


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