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

# Simulation in Python with Tests

> All 65 Simulation LeetCode problems with tested Python solutions.

Simulation holds 65 problems (27 Easy, 32 Medium, 6 Hard).
Generate any of them into the current directory with `lcpy gen -n <number>`.

<div className="sd-catalog-table">
  | # | Problem | Difficulty | Solution |
  | - | - | - | - |
  | 43 | [Multiply Strings](/problems/multiply-strings) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/multiply_strings/solution.py) |
  | 54 | [Spiral Matrix](/problems/spiral-matrix) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/spiral_matrix/solution.py) |
  | 59 | [Spiral Matrix II](/problems/spiral-matrix-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/spiral_matrix_ii/solution.py) |
  | 67 | [Add Binary](/problems/add-binary) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/add_binary/solution.py) |
  | 68 | [Text Justification](/problems/text-justification) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/text_justification/solution.py) |
  | 157 | [Read N Characters Given Read4](/problems/read-n-characters-given-read4) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/read_n_characters_given_read4/solution.py) |
  | 158 | [Read N Characters Given read4 II - Call Multiple Times](/problems/read-n-characters-given-read4-ii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/read_n_characters_given_read4_ii/solution.py) |
  | 258 | [Add Digits](/problems/add-digits) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/add_digits/solution.py) |
  | 289 | [Game of Life](/problems/game-of-life) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/game_of_life/solution.py) |
  | 348 | [Design Tic-Tac-Toe](/problems/design-tic-tac-toe) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/design_tic_tac_toe/solution.py) |
  | 353 | [Design Snake Game](/problems/design-snake-game) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/design_snake_game/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) |
  | 495 | [Teemo Attacking](/problems/teemo-attacking) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/teemo_attacking/solution.py) |
  | 498 | [Diagonal Traverse](/problems/diagonal-traverse) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/diagonal_traverse/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) |
  | 544 | [Output Contest Matches](/problems/output-contest-matches) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/output_contest_matches/solution.py) |
  | 566 | [Reshape the Matrix](/problems/reshape-the-matrix) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reshape_the_matrix/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) |
  | 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) |
  | 657 | [Robot Return to Origin](/problems/robot-return-to-origin) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/robot_return_to_origin/solution.py) |
  | 682 | [Baseball Game](/problems/baseball-game) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/baseball_game/solution.py) |
  | 723 | [Candy Crush](/problems/candy-crush) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/candy_crush/solution.py) |
  | 735 | [Asteroid Collision](/problems/asteroid-collision) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/asteroid_collision/solution.py) |
  | 749 | [Contain Virus](/problems/contain-virus) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/contain_virus/solution.py) |
  | 755 | [Pour Water](/problems/pour-water) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/pour_water/solution.py) |
  | 832 | [Flipping an Image](/problems/flipping-an-image) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/flipping_an_image/solution.py) |
  | 844 | [Backspace String Compare](/problems/backspace-string-compare) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/backspace_string_compare/solution.py) |
  | 867 | [Transpose Matrix](/problems/transpose-matrix) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/transpose_matrix/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) |
  | 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) |
  | 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) |
  | 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) |
  | 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) |
  | 999 | [Available Captures for Rook](/problems/available-captures-for-rook) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/available_captures_for_rook/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) |
  | 1094 | [Car Pooling](/problems/car-pooling) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/car_pooling/solution.py) |
  | 1243 | [Array Transformation](/problems/array-transformation) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/array_transformation/solution.py) |
  | 1260 | [Shift 2D Grid](/problems/shift-2d-grid) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/shift_2d_grid/solution.py) |
  | 1518 | [Water Bottles](/problems/water-bottles) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/water_bottles/solution.py) |
  | 1545 | [Find Kth Bit in Nth Binary String](/problems/find-kth-bit-in-nth-binary-string) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_kth_bit_in_nth_binary_string/solution.py) |
  | 1603 | [Design Parking System](/problems/design-parking-system) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/design_parking_system/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) |
  | 1700 | [Number of Students Unable to Eat Lunch](/problems/number-of-students-unable-to-eat-lunch) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_students_unable_to_eat_lunch/solution.py) |
  | 1701 | [Average Waiting Time](/problems/average-waiting-time) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/average_waiting_time/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) |
  | 1929 | [Concatenation of Array](/problems/concatenation-of-array) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/concatenation_of_array/solution.py) |
  | 2022 | [Convert 1D Array Into 2D Array](/problems/convert-1d-array-into-2d-array) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/convert_1d_array_into_2d_array/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) |
  | 2073 | [Time Needed to Buy Tickets](/problems/time-needed-to-buy-tickets) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/time_needed_to_buy_tickets/solution.py) |
  | 2109 | [Adding Spaces to a String](/problems/adding-spaces-to-a-string) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/adding_spaces_to_a_string/solution.py) |
  | 2149 | [Rearrange Array Elements by Sign](/problems/rearrange-array-elements-by-sign) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rearrange_array_elements_by_sign/solution.py) |
  | 2161 | [Partition Array According to Given Pivot](/problems/partition-array-according-to-given-pivot) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/partition_array_according_to_given_pivot/solution.py) |
  | 2181 | [Merge Nodes in Between Zeros](/problems/merge-nodes-in-between-zeros) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/merge_nodes_in_between_zeros/solution.py) |
  | 2257 | [Count Unguarded Cells in the Grid](/problems/count-unguarded-cells-in-the-grid) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_unguarded_cells_in_the_grid/solution.py) |
  | 2326 | [Spiral Matrix IV](/problems/spiral-matrix-iv) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/spiral_matrix_iv/solution.py) |
  | 2390 | [Removing Stars From a String](/problems/removing-stars-from-a-string) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/removing_stars_from_a_string/solution.py) |
  | 2402 | [Meeting Rooms III](/problems/meeting-rooms-iii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/meeting_rooms_iii/solution.py) |
  | 2460 | [Apply Operations to an Array](/problems/apply-operations-to-an-array) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/apply_operations_to_an_array/solution.py) |
  | 2534 | [Time Taken to Cross the Door](/problems/time-taken-to-cross-the-door) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/time_taken_to_cross_the_door/solution.py) |
  | 2558 | [Take Gifts From the Richest Pile](/problems/take-gifts-from-the-richest-pile) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/take_gifts_from_the_richest_pile/solution.py) |
  | 2696 | [Minimum String Length After Removing Substrings](/problems/minimum-string-length-after-removing-substrings) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_string_length_after_removing_substrings/solution.py) |
  | 2751 | [Robot Collisions](/problems/robot-collisions) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/robot_collisions/solution.py) |
  | 3174 | [Clear Digits](/problems/clear-digits) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/clear_digits/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>


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