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

| # | Problem | Difficulty | Solution |
| - | - | - | - |
| 43 | [Multiply Strings](https://leetcode-py.wisl.dev/problems/multiply-strings) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/multiply_strings/solution.py) |
| 54 | [Spiral Matrix](https://leetcode-py.wisl.dev/problems/spiral-matrix) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/spiral_matrix/solution.py) |
| 59 | [Spiral Matrix II](https://leetcode-py.wisl.dev/problems/spiral-matrix-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/spiral_matrix_ii/solution.py) |
| 67 | [Add Binary](https://leetcode-py.wisl.dev/problems/add-binary) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/add_binary/solution.py) |
| 68 | [Text Justification](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/problems/add-digits) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/add_digits/solution.py) |
| 289 | [Game of Life](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/problems/design-snake-game) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/design_snake_game/solution.py) |
| 412 | [Fizz Buzz](https://leetcode-py.wisl.dev/problems/fizz-buzz) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/fizz_buzz/solution.py) |
| 415 | [Add Strings](https://leetcode-py.wisl.dev/problems/add-strings) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/add_strings/solution.py) |
| 495 | [Teemo Attacking](https://leetcode-py.wisl.dev/problems/teemo-attacking) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/teemo_attacking/solution.py) |
| 498 | [Diagonal Traverse](https://leetcode-py.wisl.dev/problems/diagonal-traverse) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/diagonal_traverse/solution.py) |
| 537 | [Complex Number Multiplication](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/problems/baseball-game) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/baseball_game/solution.py) |
| 723 | [Candy Crush](https://leetcode-py.wisl.dev/problems/candy-crush) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/candy_crush/solution.py) |
| 735 | [Asteroid Collision](https://leetcode-py.wisl.dev/problems/asteroid-collision) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/asteroid_collision/solution.py) |
| 749 | [Contain Virus](https://leetcode-py.wisl.dev/problems/contain-virus) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/contain_virus/solution.py) |
| 755 | [Pour Water](https://leetcode-py.wisl.dev/problems/pour-water) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/pour_water/solution.py) |
| 832 | [Flipping an Image](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/problems/backspace-string-compare) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/backspace_string_compare/solution.py) |
| 867 | [Transpose Matrix](https://leetcode-py.wisl.dev/problems/transpose-matrix) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/transpose_matrix/solution.py) |
| 874 | [Walking Robot Simulation](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/problems/car-pooling) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/car_pooling/solution.py) |
| 1243 | [Array Transformation](https://leetcode-py.wisl.dev/problems/array-transformation) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/array_transformation/solution.py) |
| 1260 | [Shift 2D Grid](https://leetcode-py.wisl.dev/problems/shift-2d-grid) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/shift_2d_grid/solution.py) |
| 1518 | [Water Bottles](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/problems/robot-collisions) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/robot_collisions/solution.py) |
| 3174 | [Clear Digits](https://leetcode-py.wisl.dev/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](https://leetcode-py.wisl.dev/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) |


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