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

# AlgoMaster 75

> All 75 AlgoMaster 75 problems with links to each problem and solution.

AlgoMaster 75 holds 75 problems (7 Easy, 53 Medium, 15 Hard).

Generate the whole collection into the current directory:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
lcpy gen -t algo-master-75
```

| #    | Problem                                                                                                                                                                                 | Difficulty | Solution                                                                                                                                      |
| ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| 2    | [Add Two Numbers](https://github.com/wislertt/leetcode-py/blob/main/leetcode/add_two_numbers/README.md)                                                                                 | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/add_two_numbers/solution.py)                                         |
| 3    | [Longest Substring Without Repeating Characters](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_substring_without_repeating_characters/README.md)                   | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_substring_without_repeating_characters/solution.py)          |
| 4    | [Median of Two Sorted Arrays](https://github.com/wislertt/leetcode-py/blob/main/leetcode/median_of_two_sorted_arrays/README.md)                                                         | Hard       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/median_of_two_sorted_arrays/solution.py)                             |
| 7    | [Reverse Integer](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reverse_integer/README.md)                                                                                 | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reverse_integer/solution.py)                                         |
| 11   | [Container With Most Water](https://github.com/wislertt/leetcode-py/blob/main/leetcode/container_with_most_water/README.md)                                                             | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/container_with_most_water/solution.py)                               |
| 15   | [3Sum](https://github.com/wislertt/leetcode-py/blob/main/leetcode/three_sum/README.md)                                                                                                  | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/three_sum/solution.py)                                               |
| 19   | [Remove Nth Node From End of List](https://github.com/wislertt/leetcode-py/blob/main/leetcode/remove_nth_node_from_end_of_list/README.md)                                               | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/remove_nth_node_from_end_of_list/solution.py)                        |
| 20   | [Valid Parentheses](https://github.com/wislertt/leetcode-py/blob/main/leetcode/valid_parentheses/README.md)                                                                             | Easy       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/valid_parentheses/solution.py)                                       |
| 23   | [Merge k Sorted Lists](https://github.com/wislertt/leetcode-py/blob/main/leetcode/merge_k_sorted_lists/README.md)                                                                       | Hard       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/merge_k_sorted_lists/solution.py)                                    |
| 24   | [Swap Nodes in Pairs](https://github.com/wislertt/leetcode-py/blob/main/leetcode/swap_nodes_in_pairs/README.md)                                                                         | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/swap_nodes_in_pairs/solution.py)                                     |
| 25   | [Reverse Nodes in k-Group](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reverse_nodes_in_k_group/README.md)                                                               | Hard       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reverse_nodes_in_k_group/solution.py)                                |
| 33   | [Search in Rotated Sorted Array](https://github.com/wislertt/leetcode-py/blob/main/leetcode/search_in_rotated_sorted_array/README.md)                                                   | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/search_in_rotated_sorted_array/solution.py)                          |
| 34   | [Find First and Last Position of Element in Sorted Array](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_first_and_last_position_of_element_in_sorted_array/README.md) | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_first_and_last_position_of_element_in_sorted_array/solution.py) |
| 41   | [First Missing Positive](https://github.com/wislertt/leetcode-py/blob/main/leetcode/first_missing_positive/README.md)                                                                   | Hard       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/first_missing_positive/solution.py)                                  |
| 42   | [Trapping Rain Water](https://github.com/wislertt/leetcode-py/blob/main/leetcode/trapping_rain_water/README.md)                                                                         | Hard       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/trapping_rain_water/solution.py)                                     |
| 45   | [Jump Game II](https://github.com/wislertt/leetcode-py/blob/main/leetcode/jump_game_ii/README.md)                                                                                       | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/jump_game_ii/solution.py)                                            |
| 46   | [Permutations](https://github.com/wislertt/leetcode-py/blob/main/leetcode/permutations/README.md)                                                                                       | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/permutations/solution.py)                                            |
| 48   | [Rotate Image](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rotate_image/README.md)                                                                                       | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rotate_image/solution.py)                                            |
| 49   | [Group Anagrams](https://github.com/wislertt/leetcode-py/blob/main/leetcode/group_anagrams/README.md)                                                                                   | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/group_anagrams/solution.py)                                          |
| 53   | [Maximum Subarray](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_subarray/README.md)                                                                               | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_subarray/solution.py)                                        |
| 54   | [Spiral Matrix](https://github.com/wislertt/leetcode-py/blob/main/leetcode/spiral_matrix/README.md)                                                                                     | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/spiral_matrix/solution.py)                                           |
| 56   | [Merge Intervals](https://github.com/wislertt/leetcode-py/blob/main/leetcode/merge_intervals/README.md)                                                                                 | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/merge_intervals/solution.py)                                         |
| 64   | [Minimum Path Sum](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_path_sum/README.md)                                                                               | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_path_sum/solution.py)                                        |
| 75   | [Sort Colors](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sort_colors/README.md)                                                                                         | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sort_colors/solution.py)                                             |
| 76   | [Minimum Window Substring](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_window_substring/README.md)                                                               | Hard       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_window_substring/solution.py)                                |
| 78   | [Subsets](https://github.com/wislertt/leetcode-py/blob/main/leetcode/subsets/README.md)                                                                                                 | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/subsets/solution.py)                                                 |
| 84   | [Largest Rectangle in Histogram](https://github.com/wislertt/leetcode-py/blob/main/leetcode/largest_rectangle_in_histogram/README.md)                                                   | Hard       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/largest_rectangle_in_histogram/solution.py)                          |
| 94   | [Binary Tree Inorder Traversal](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_tree_inorder_traversal/README.md)                                                     | Easy       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_tree_inorder_traversal/solution.py)                           |
| 98   | [Validate Binary Search Tree](https://github.com/wislertt/leetcode-py/blob/main/leetcode/validate_binary_search_tree/README.md)                                                         | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/validate_binary_search_tree/solution.py)                             |
| 102  | [Binary Tree Level Order Traversal](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_tree_level_order_traversal/README.md)                                             | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_tree_level_order_traversal/solution.py)                       |
| 124  | [Binary Tree Maximum Path Sum](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_tree_maximum_path_sum/README.md)                                                       | Hard       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_tree_maximum_path_sum/solution.py)                            |
| 127  | [Word Ladder](https://github.com/wislertt/leetcode-py/blob/main/leetcode/word_ladder/README.md)                                                                                         | Hard       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/word_ladder/solution.py)                                             |
| 128  | [Longest Consecutive Sequence](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_consecutive_sequence/README.md)                                                       | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_consecutive_sequence/solution.py)                            |
| 133  | [Clone Graph](https://github.com/wislertt/leetcode-py/blob/main/leetcode/clone_graph/README.md)                                                                                         | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/clone_graph/solution.py)                                             |
| 139  | [Word Break](https://github.com/wislertt/leetcode-py/blob/main/leetcode/word_break/README.md)                                                                                           | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/word_break/solution.py)                                              |
| 142  | [Linked List Cycle II](https://github.com/wislertt/leetcode-py/blob/main/leetcode/linked_list_cycle_ii/README.md)                                                                       | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/linked_list_cycle_ii/solution.py)                                    |
| 144  | [Binary Tree Preorder Traversal](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_tree_preorder_traversal/README.md)                                                   | Easy       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_tree_preorder_traversal/solution.py)                          |
| 145  | [Binary Tree Postorder Traversal](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_tree_postorder_traversal/README.md)                                                 | Easy       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_tree_postorder_traversal/solution.py)                         |
| 146  | [LRU Cache](https://github.com/wislertt/leetcode-py/blob/main/leetcode/lru_cache/README.md)                                                                                             | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/lru_cache/solution.py)                                               |
| 149  | [Max Points on a Line](https://github.com/wislertt/leetcode-py/blob/main/leetcode/max_points_on_a_line/README.md)                                                                       | Hard       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/max_points_on_a_line/solution.py)                                    |
| 151  | [Reverse Words in a String](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reverse_words_in_a_string/README.md)                                                             | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reverse_words_in_a_string/solution.py)                               |
| 155  | [Min Stack](https://github.com/wislertt/leetcode-py/blob/main/leetcode/min_stack/README.md)                                                                                             | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/min_stack/solution.py)                                               |
| 169  | [Majority Element](https://github.com/wislertt/leetcode-py/blob/main/leetcode/majority_element/README.md)                                                                               | Easy       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/majority_element/solution.py)                                        |
| 199  | [Binary Tree Right Side View](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_tree_right_side_view/README.md)                                                         | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_tree_right_side_view/solution.py)                             |
| 200  | [Number of Islands](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_islands/README.md)                                                                             | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_islands/solution.py)                                       |
| 208  | [Implement Trie (Prefix Tree)](https://github.com/wislertt/leetcode-py/blob/main/leetcode/implement_trie_prefix_tree/README.md)                                                         | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/implement_trie_prefix_tree/solution.py)                              |
| 210  | [Course Schedule II](https://github.com/wislertt/leetcode-py/blob/main/leetcode/course_schedule_ii/README.md)                                                                           | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/course_schedule_ii/solution.py)                                      |
| 212  | [Word Search II](https://github.com/wislertt/leetcode-py/blob/main/leetcode/word_search_ii/README.md)                                                                                   | Hard       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/word_search_ii/solution.py)                                          |
| 213  | [House Robber II](https://github.com/wislertt/leetcode-py/blob/main/leetcode/house_robber_ii/README.md)                                                                                 | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/house_robber_ii/solution.py)                                         |
| 230  | [Kth Smallest Element in a BST](https://github.com/wislertt/leetcode-py/blob/main/leetcode/kth_smallest_element_in_a_bst/README.md)                                                     | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/kth_smallest_element_in_a_bst/solution.py)                           |
| 236  | [Lowest Common Ancestor of a Binary Tree](https://github.com/wislertt/leetcode-py/blob/main/leetcode/lowest_common_ancestor_of_a_binary_tree/README.md)                                 | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/lowest_common_ancestor_of_a_binary_tree/solution.py)                 |
| 238  | [Product of Array Except Self](https://github.com/wislertt/leetcode-py/blob/main/leetcode/product_of_array_except_self/README.md)                                                       | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/product_of_array_except_self/solution.py)                            |
| 239  | [Sliding Window Maximum](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sliding_window_maximum/README.md)                                                                   | Hard       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sliding_window_maximum/solution.py)                                  |
| 260  | [Single Number III](https://github.com/wislertt/leetcode-py/blob/main/leetcode/single_number_iii/README.md)                                                                             | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/single_number_iii/solution.py)                                       |
| 295  | [Find Median from Data Stream](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_median_from_data_stream/README.md)                                                       | Hard       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_median_from_data_stream/solution.py)                            |
| 297  | [Serialize and Deserialize Binary Tree](https://github.com/wislertt/leetcode-py/blob/main/leetcode/serialize_and_deserialize_binary_tree/README.md)                                     | Hard       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/serialize_and_deserialize_binary_tree/solution.py)                   |
| 300  | [Longest Increasing Subsequence](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_increasing_subsequence/README.md)                                                   | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_increasing_subsequence/solution.py)                          |
| 322  | [Coin Change](https://github.com/wislertt/leetcode-py/blob/main/leetcode/coin_change/README.md)                                                                                         | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/coin_change/solution.py)                                             |
| 329  | [Longest Increasing Path in a Matrix](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_increasing_path_in_a_matrix/README.md)                                         | Hard       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_increasing_path_in_a_matrix/solution.py)                     |
| 338  | [Counting Bits](https://github.com/wislertt/leetcode-py/blob/main/leetcode/counting_bits/README.md)                                                                                     | Easy       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/counting_bits/solution.py)                                           |
| 347  | [Top K Frequent Elements](https://github.com/wislertt/leetcode-py/blob/main/leetcode/top_k_frequent_elements/README.md)                                                                 | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/top_k_frequent_elements/solution.py)                                 |
| 392  | [Is Subsequence](https://github.com/wislertt/leetcode-py/blob/main/leetcode/is_subsequence/README.md)                                                                                   | Easy       | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/is_subsequence/solution.py)                                          |
| 416  | [Partition Equal Subset Sum](https://github.com/wislertt/leetcode-py/blob/main/leetcode/partition_equal_subset_sum/README.md)                                                           | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/partition_equal_subset_sum/solution.py)                              |
| 435  | [Non-overlapping Intervals](https://github.com/wislertt/leetcode-py/blob/main/leetcode/non_overlapping_intervals/README.md)                                                             | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/non_overlapping_intervals/solution.py)                               |
| 437  | [Path Sum III](https://github.com/wislertt/leetcode-py/blob/main/leetcode/path_sum_iii/README.md)                                                                                       | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/path_sum_iii/solution.py)                                            |
| 438  | [Find All Anagrams in a String](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_all_anagrams_in_a_string/README.md)                                                     | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_all_anagrams_in_a_string/solution.py)                           |
| 547  | [Number of Provinces](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_provinces/README.md)                                                                         | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_provinces/solution.py)                                     |
| 560  | [Subarray Sum Equals K](https://github.com/wislertt/leetcode-py/blob/main/leetcode/subarray_sum_equals_k/README.md)                                                                     | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/subarray_sum_equals_k/solution.py)                                   |
| 567  | [Permutation in String](https://github.com/wislertt/leetcode-py/blob/main/leetcode/permutation_in_string/README.md)                                                                     | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/permutation_in_string/solution.py)                                   |
| 729  | [My Calendar I](https://github.com/wislertt/leetcode-py/blob/main/leetcode/my_calendar_i/README.md)                                                                                     | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/my_calendar_i/solution.py)                                           |
| 785  | [Is Graph Bipartite?](https://github.com/wislertt/leetcode-py/blob/main/leetcode/is_graph_bipartite/README.md)                                                                          | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/is_graph_bipartite/solution.py)                                      |
| 787  | [Cheapest Flights Within K Stops](https://github.com/wislertt/leetcode-py/blob/main/leetcode/cheapest_flights_within_k_stops/README.md)                                                 | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/cheapest_flights_within_k_stops/solution.py)                         |
| 994  | [Rotting Oranges](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rotting_oranges/README.md)                                                                                 | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rotting_oranges/solution.py)                                         |
| 1143 | [Longest Common Subsequence](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_common_subsequence/README.md)                                                           | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_common_subsequence/solution.py)                              |
| 1584 | [Min Cost to Connect All Points](https://github.com/wislertt/leetcode-py/blob/main/leetcode/min_cost_to_connect_all_points/README.md)                                                   | Medium     | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/min_cost_to_connect_all_points/solution.py)                          |
