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

# Graph in Python with Tests

> All 26 Graph LeetCode problems with tested Python solutions.

Graph holds 26 problems (17 Medium, 9 Hard).
Generate any of them into the current directory with `lcpy gen -n <number>`.

<div className="sd-catalog-table">
  | # | Problem | Difficulty | Solution |
  | - | - | - | - |
  | 133 | [Clone Graph](/problems/clone-graph) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/clone_graph/solution.py) |
  | 207 | [Course Schedule](/problems/course-schedule) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/course_schedule/solution.py) |
  | 210 | [Course Schedule II](/problems/course-schedule-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/course_schedule_ii/solution.py) |
  | 261 | [Graph Valid Tree](/problems/graph-valid-tree) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/graph_valid_tree/solution.py) |
  | 269 | [Alien Dictionary](/problems/alien-dictionary) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/alien_dictionary/solution.py) |
  | 277 | [Find the Celebrity](/problems/find-the-celebrity) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_the_celebrity/solution.py) |
  | 310 | [Minimum Height Trees](/problems/minimum-height-trees) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_height_trees/solution.py) |
  | 323 | [Number of Connected Components in an Undirected Graph](/problems/number-of-connected-components-in-an-undirected-graph) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_connected_components_in_an_undirected_graph/solution.py) |
  | 444 | [Sequence Reconstruction](/problems/sequence-reconstruction) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sequence_reconstruction/solution.py) |
  | 499 | [The Maze III](/problems/the-maze-iii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/the_maze_iii/solution.py) |
  | 505 | [The Maze II](/problems/the-maze-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/the_maze_ii/solution.py) |
  | 631 | [Design Excel Sum Formula](/problems/design-excel-sum-formula) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/design_excel_sum_formula/solution.py) |
  | 924 | [Minimize Malware Spread](/problems/minimize-malware-spread) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimize_malware_spread/solution.py) |
  | 928 | [Minimize Malware Spread II](/problems/minimize-malware-spread-ii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimize_malware_spread_ii/solution.py) |
  | 1059 | [All Paths from Source Lead to Destination](/problems/all-paths-from-source-lead-to-destination) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/all_paths_from_source_lead_to_destination/solution.py) |
  | 1129 | [Shortest Path with Alternating Colors](/problems/shortest-path-with-alternating-colors) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/shortest_path_with_alternating_colors/solution.py) |
  | 1135 | [Connecting Cities With Minimum Cost](/problems/connecting-cities-with-minimum-cost) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/connecting_cities_with_minimum_cost/solution.py) |
  | 1136 | [Parallel Courses](/problems/parallel-courses) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/parallel_courses/solution.py) |
  | 1168 | [Optimize Water Distribution in a Village](/problems/optimize-water-distribution-in-a-village) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/optimize_water_distribution_in_a_village/solution.py) |
  | 1245 | [Tree Diameter](/problems/tree-diameter) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/tree_diameter/solution.py) |
  | 1361 | [Validate Binary Tree Nodes](/problems/validate-binary-tree-nodes) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/validate_binary_tree_nodes/solution.py) |
  | 1368 | [Minimum Cost to Make at Least One Valid Path in a Grid](/problems/minimum-cost-to-make-at-least-one-valid-path-in-a-grid) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_cost_to_make_at_least_one_valid_path_in_a_grid/solution.py) |
  | 2127 | [Maximum Employees to Be Invited to a Meeting](/problems/maximum-employees-to-be-invited-to-a-meeting) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_employees_to_be_invited_to_a_meeting/solution.py) |
  | 2493 | [Divide Nodes Into the Maximum Number of Groups](/problems/divide-nodes-into-the-maximum-number-of-groups) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/divide_nodes_into_the_maximum_number_of_groups/solution.py) |
  | 3108 | [Minimum Cost Walk in Weighted Graph](/problems/minimum-cost-walk-in-weighted-graph) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_cost_walk_in_weighted_graph/solution.py) |
  | 3481 | [Apply Substitutions](/problems/apply-substitutions) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/apply_substitutions/solution.py) |
</div>


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