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

# Array in Python with Tests

> All 781 Array LeetCode problems with tested Python solutions. Part 1 of 4: problems 1-200.

Array holds 781 problems (154 Easy, 465 Medium, 162 Hard).
Generate any of them into the current directory with `lcpy gen -n <number>`.

<div className="sd-catalog-table">
  | # | Problem | Difficulty | Solution |
  | - | - | - | - |
  | 1 | [Two Sum](/problems/two-sum) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/two_sum/solution.py) |
  | 4 | [Median of Two Sorted Arrays](/problems/median-of-two-sorted-arrays) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/median_of_two_sorted_arrays/solution.py) |
  | 11 | [Container With Most Water](/problems/container-with-most-water) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/container_with_most_water/solution.py) |
  | 14 | [Longest Common Prefix](/problems/longest-common-prefix) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_common_prefix/solution.py) |
  | 15 | [3Sum](/problems/three-sum) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/three_sum/solution.py) |
  | 16 | [3Sum Closest](/problems/three-sum-closest) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/three_sum_closest/solution.py) |
  | 18 | [4Sum](/problems/four-sum) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/four_sum/solution.py) |
  | 26 | [Remove Duplicates From Sorted Array](/problems/remove-duplicates-from-sorted-array) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/remove_duplicates_from_sorted_array/solution.py) |
  | 27 | [Remove Element](/problems/remove-element) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/remove_element/solution.py) |
  | 31 | [Next Permutation](/problems/next-permutation) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/next_permutation/solution.py) |
  | 33 | [Search in Rotated Sorted Array](/problems/search-in-rotated-sorted-array) | 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](/problems/find-first-and-last-position-of-element-in-sorted-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_first_and_last_position_of_element_in_sorted_array/solution.py) |
  | 35 | [Search Insert Position](/problems/search-insert-position) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/search_insert_position/solution.py) |
  | 36 | [Valid Sudoku](/problems/valid-sudoku) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/valid_sudoku/solution.py) |
  | 37 | [Sudoku Solver](/problems/sudoku-solver) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sudoku_solver/solution.py) |
  | 39 | [Combination Sum](/problems/combination-sum) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/combination_sum/solution.py) |
  | 40 | [Combination Sum II](/problems/combination-sum-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/combination_sum_ii/solution.py) |
  | 41 | [First Missing Positive](/problems/first-missing-positive) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/first_missing_positive/solution.py) |
  | 42 | [Trapping Rain Water](/problems/trapping-rain-water) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/trapping_rain_water/solution.py) |
  | 45 | [Jump Game II](/problems/jump-game-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/jump_game_ii/solution.py) |
  | 46 | [Permutations](/problems/permutations) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/permutations/solution.py) |
  | 47 | [Permutations II](/problems/permutations-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/permutations_ii/solution.py) |
  | 48 | [Rotate Image](/problems/rotate-image) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rotate_image/solution.py) |
  | 49 | [Group Anagrams](/problems/group-anagrams) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/group_anagrams/solution.py) |
  | 51 | [N-Queens](/problems/n-queens) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/n_queens/solution.py) |
  | 53 | [Maximum Subarray](/problems/maximum-subarray) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_subarray/solution.py) |
  | 54 | [Spiral Matrix](/problems/spiral-matrix) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/spiral_matrix/solution.py) |
  | 55 | [Jump Game](/problems/jump-game) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/jump_game/solution.py) |
  | 56 | [Merge Intervals](/problems/merge-intervals) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/merge_intervals/solution.py) |
  | 57 | [Insert Interval](/problems/insert-interval) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/insert_interval/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) |
  | 63 | [Unique Paths II](/problems/unique-paths-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/unique_paths_ii/solution.py) |
  | 64 | [Minimum Path Sum](/problems/minimum-path-sum) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_path_sum/solution.py) |
  | 66 | [Plus One](/problems/plus-one) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/plus_one/solution.py) |
  | 68 | [Text Justification](/problems/text-justification) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/text_justification/solution.py) |
  | 73 | [Set Matrix Zeroes](/problems/set-matrix-zeroes) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/set_matrix_zeroes/solution.py) |
  | 74 | [Search a 2D Matrix](/problems/search-a-2d-matrix) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/search_a_2d_matrix/solution.py) |
  | 75 | [Sort Colors](/problems/sort-colors) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sort_colors/solution.py) |
  | 78 | [Subsets](/problems/subsets) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/subsets/solution.py) |
  | 79 | [Word Search](/problems/word-search) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/word_search/solution.py) |
  | 80 | [Remove Duplicates from Sorted Array II](/problems/remove-duplicates-from-sorted-array-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/remove_duplicates_from_sorted_array_ii/solution.py) |
  | 81 | [Search in Rotated Sorted Array II](/problems/search-in-rotated-sorted-array-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/search_in_rotated_sorted_array_ii/solution.py) |
  | 84 | [Largest Rectangle in Histogram](/problems/largest-rectangle-in-histogram) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/largest_rectangle_in_histogram/solution.py) |
  | 85 | [Maximal Rectangle](/problems/maximal-rectangle) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximal_rectangle/solution.py) |
  | 88 | [Merge Sorted Array](/problems/merge-sorted-array) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/merge_sorted_array/solution.py) |
  | 90 | [Subsets II](/problems/subsets-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/subsets_ii/solution.py) |
  | 105 | [Construct Binary Tree from Preorder and Inorder Traversal](/problems/construct-binary-tree-from-preorder-and-inorder-traversal) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/construct_binary_tree_from_preorder_and_inorder_traversal/solution.py) |
  | 106 | [Construct Binary Tree from Inorder and Postorder Traversal](/problems/construct-binary-tree-from-inorder-and-postorder-traversal) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/construct_binary_tree_from_inorder_and_postorder_traversal/solution.py) |
  | 108 | [Convert Sorted Array to Binary Search Tree](/problems/convert-sorted-array-to-binary-search-tree) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/convert_sorted_array_to_binary_search_tree/solution.py) |
  | 118 | [Pascal's Triangle](/problems/pascals-triangle) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/pascals_triangle/solution.py) |
  | 119 | [Pascal's Triangle II](/problems/pascals-triangle-ii) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/pascals_triangle_ii/solution.py) |
  | 120 | [Triangle](/problems/triangle) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/triangle/solution.py) |
  | 121 | [Best Time to Buy and Sell Stock](/problems/best-time-to-buy-and-sell-stock) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/best_time_to_buy_and_sell_stock/solution.py) |
  | 122 | [Best Time to Buy and Sell Stock II](/problems/best-time-to-buy-and-sell-stock-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/best_time_to_buy_and_sell_stock_ii/solution.py) |
  | 123 | [Best Time to Buy and Sell Stock III](/problems/best-time-to-buy-and-sell-stock-iii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/best_time_to_buy_and_sell_stock_iii/solution.py) |
  | 128 | [Longest Consecutive Sequence](/problems/longest-consecutive-sequence) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_consecutive_sequence/solution.py) |
  | 130 | [Surrounded Regions](/problems/surrounded-regions) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/surrounded_regions/solution.py) |
  | 134 | [Gas Station](/problems/gas-station) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/gas_station/solution.py) |
  | 135 | [Candy](/problems/candy) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/candy/solution.py) |
  | 136 | [Single Number](/problems/single-number) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/single_number/solution.py) |
  | 137 | [Single Number II](/problems/single-number-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/single_number_ii/solution.py) |
  | 139 | [Word Break](/problems/word-break) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/word_break/solution.py) |
  | 140 | [Word Break II](/problems/word-break-ii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/word_break_ii/solution.py) |
  | 149 | [Max Points on a Line](/problems/max-points-on-a-line) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/max_points_on_a_line/solution.py) |
  | 150 | [Evaluate Reverse Polish Notation](/problems/evaluate-reverse-polish-notation) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/evaluate_reverse_polish_notation/solution.py) |
  | 152 | [Maximum Product Subarray](/problems/maximum-product-subarray) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_product_subarray/solution.py) |
  | 153 | [Find Minimum in Rotated Sorted Array](/problems/find-minimum-in-rotated-sorted-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_minimum_in_rotated_sorted_array/solution.py) |
  | 154 | [Find Minimum in Rotated Sorted Array II](/problems/find-minimum-in-rotated-sorted-array-ii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_minimum_in_rotated_sorted_array_ii/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) |
  | 162 | [Find Peak Element](/problems/find-peak-element) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_peak_element/solution.py) |
  | 163 | [Missing Ranges](/problems/missing-ranges) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/missing_ranges/solution.py) |
  | 164 | [Maximum Gap](/problems/maximum-gap) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_gap/solution.py) |
  | 167 | [Two Sum II - Input Array Is Sorted](/problems/two-sum-ii-input-array-is-sorted) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/two_sum_ii_input_array_is_sorted/solution.py) |
  | 169 | [Majority Element](/problems/majority-element) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/majority_element/solution.py) |
  | 170 | [Two Sum III - Data structure design](/problems/two-sum-iii-data-structure-design) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/two_sum_iii_data_structure_design/solution.py) |
  | 174 | [Dungeon Game](/problems/dungeon-game) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/dungeon_game/solution.py) |
  | 179 | [Largest Number](/problems/largest-number) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/largest_number/solution.py) |
  | 188 | [Best Time to Buy and Sell Stock IV](/problems/best-time-to-buy-and-sell-stock-iv) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/best_time_to_buy_and_sell_stock_iv/solution.py) |
  | 189 | [Rotate Array](/problems/rotate-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rotate_array/solution.py) |
  | 198 | [House Robber](/problems/house-robber) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/house_robber/solution.py) |
  | 200 | [Number of Islands](/problems/number-of-islands) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_islands/solution.py) |
  | 204 | [Count Primes](/problems/count-primes) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_primes/solution.py) |
  | 209 | [Minimum Size Subarray Sum](/problems/minimum-size-subarray-sum) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_size_subarray_sum/solution.py) |
  | 212 | [Word Search II](/problems/word-search-ii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/word_search_ii/solution.py) |
  | 213 | [House Robber II](/problems/house-robber-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/house_robber_ii/solution.py) |
  | 215 | [Kth Largest Element in an Array](/problems/kth-largest-element-in-an-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/kth_largest_element_in_an_array/solution.py) |
  | 216 | [Combination Sum III](/problems/combination-sum-iii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/combination_sum_iii/solution.py) |
  | 217 | [Contains Duplicate](/problems/contains-duplicate) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/contains_duplicate/solution.py) |
  | 218 | [The Skyline Problem](/problems/the-skyline-problem) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/the_skyline_problem/solution.py) |
  | 219 | [Contains Duplicate II](/problems/contains-duplicate-ii) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/contains_duplicate_ii/solution.py) |
  | 220 | [Contains Duplicate III](/problems/contains-duplicate-iii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/contains_duplicate_iii/solution.py) |
  | 221 | [Maximal Square](/problems/maximal-square) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximal_square/solution.py) |
  | 228 | [Summary Ranges](/problems/summary-ranges) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/summary_ranges/solution.py) |
  | 229 | [Majority Element II](/problems/majority-element-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/majority_element_ii/solution.py) |
  | 238 | [Product of Array Except Self](/problems/product-of-array-except-self) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/product_of_array_except_self/solution.py) |
  | 239 | [Sliding Window Maximum](/problems/sliding-window-maximum) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sliding_window_maximum/solution.py) |
  | 240 | [Search a 2D Matrix II](/problems/search-a-2d-matrix-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/search_a_2d_matrix_ii/solution.py) |
  | 243 | [Shortest Word Distance](/problems/shortest-word-distance) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/shortest_word_distance/solution.py) |
  | 244 | [Shortest Word Distance II](/problems/shortest-word-distance-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/shortest_word_distance_ii/solution.py) |
  | 245 | [Shortest Word Distance III](/problems/shortest-word-distance-iii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/shortest_word_distance_iii/solution.py) |
  | 247 | [Strobogrammatic Number II](/problems/strobogrammatic-number-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/strobogrammatic_number_ii/solution.py) |
  | 248 | [Strobogrammatic Number III](/problems/strobogrammatic-number-iii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/strobogrammatic_number_iii/solution.py) |
  | 249 | [Group Shifted Strings](/problems/group-shifted-strings) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/group_shifted_strings/solution.py) |
  | 251 | [Flatten 2D Vector](/problems/flatten-2d-vector) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/flatten_2d_vector/solution.py) |
  | 252 | [Meeting Rooms](/problems/meeting-rooms) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/meeting_rooms/solution.py) |
  | 253 | [Meeting Rooms II](/problems/meeting-rooms-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/meeting_rooms_ii/solution.py) |
  | 255 | [Verify Preorder Sequence in Binary Search Tree](/problems/verify-preorder-sequence-in-binary-search-tree) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/verify_preorder_sequence_in_binary_search_tree/solution.py) |
  | 256 | [Paint House](/problems/paint-house) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/paint_house/solution.py) |
  | 259 | [3Sum Smaller](/problems/three-sum-smaller) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/three_sum_smaller/solution.py) |
  | 260 | [Single Number III](/problems/single-number-iii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/single_number_iii/solution.py) |
  | 265 | [Paint House II](/problems/paint-house-ii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/paint_house_ii/solution.py) |
  | 268 | [Missing Number](/problems/missing-number) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/missing_number/solution.py) |
  | 269 | [Alien Dictionary](/problems/alien-dictionary) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/alien_dictionary/solution.py) |
  | 271 | [Encode and Decode Strings](/problems/encode-and-decode-strings) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/encode_and_decode_strings/solution.py) |
  | 274 | [H-Index](/problems/h-index) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/h_index/solution.py) |
  | 275 | [H-Index II](/problems/h-index-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/h_index_ii/solution.py) |
  | 280 | [Wiggle Sort](/problems/wiggle-sort) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/wiggle_sort/solution.py) |
  | 281 | [Zigzag Iterator](/problems/zigzag-iterator) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/zigzag_iterator/solution.py) |
  | 283 | [Move Zeroes](/problems/move-zeroes) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/move_zeroes/solution.py) |
  | 284 | [Peeking Iterator](/problems/peeking-iterator) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/peeking_iterator/solution.py) |
  | 286 | [Walls And Gates](/problems/walls-and-gates) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/walls_and_gates/solution.py) |
  | 287 | [Find the Duplicate Number](/problems/find-the-duplicate-number) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_the_duplicate_number/solution.py) |
  | 288 | [Unique Word Abbreviation](/problems/unique-word-abbreviation) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/unique_word_abbreviation/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) |
  | 296 | [Best Meeting Point](/problems/best-meeting-point) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/best_meeting_point/solution.py) |
  | 300 | [Longest Increasing Subsequence](/problems/longest-increasing-subsequence) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_increasing_subsequence/solution.py) |
  | 302 | [Smallest Rectangle Enclosing Black Pixels](/problems/smallest-rectangle-enclosing-black-pixels) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/smallest_rectangle_enclosing_black_pixels/solution.py) |
  | 303 | [Range Sum Query - Immutable](/problems/range-sum-query-immutable) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/range_sum_query_immutable/solution.py) |
  | 304 | [Range Sum Query 2D - Immutable](/problems/range-sum-query-2d-immutable) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/range_sum_query_2d_immutable/solution.py) |
  | 305 | [Number of Islands II](/problems/number-of-islands-ii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_islands_ii/solution.py) |
  | 307 | [Range Sum Query - Mutable](/problems/range-sum-query-mutable) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/range_sum_query_mutable/solution.py) |
  | 308 | [Range Sum Query 2D - Mutable](/problems/range-sum-query-2d-mutable) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/range_sum_query_2d_mutable/solution.py) |
  | 309 | [Best Time to Buy and Sell Stock with Cooldown](/problems/best-time-to-buy-and-sell-stock-with-cooldown) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/best_time_to_buy_and_sell_stock_with_cooldown/solution.py) |
  | 311 | [Sparse Matrix Multiplication](/problems/sparse-matrix-multiplication) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sparse_matrix_multiplication/solution.py) |
  | 312 | [Burst Balloons](/problems/burst-balloons) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/burst_balloons/solution.py) |
  | 313 | [Super Ugly Number](/problems/super-ugly-number) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/super_ugly_number/solution.py) |
  | 315 | [Count of Smaller Numbers After Self](/problems/count-smaller-numbers-after-self) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_smaller_numbers_after_self/solution.py) |
  | 317 | [Shortest Distance from All Buildings](/problems/shortest-distance-from-all-buildings) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/shortest_distance_from_all_buildings/solution.py) |
  | 318 | [Maximum Product of Word Lengths](/problems/maximum-product-of-word-lengths) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_product_of_word_lengths/solution.py) |
  | 321 | [Create Maximum Number](/problems/create-maximum-number) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/create_maximum_number/solution.py) |
  | 322 | [Coin Change](/problems/coin-change) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/coin_change/solution.py) |
  | 324 | [Wiggle Sort II](/problems/wiggle-sort-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/wiggle_sort_ii/solution.py) |
  | 325 | [Maximum Size Subarray Sum Equals k](/problems/maximum-size-subarray-sum-equals-k) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_size_subarray_sum_equals_k/solution.py) |
  | 327 | [Count of Range Sum](/problems/count-of-range-sum) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_of_range_sum/solution.py) |
  | 329 | [Longest Increasing Path in a Matrix](/problems/longest-increasing-path-in-a-matrix) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_increasing_path_in_a_matrix/solution.py) |
  | 330 | [Patching Array](/problems/patching-array) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/patching_array/solution.py) |
  | 332 | [Reconstruct Itinerary](/problems/reconstruct-itinerary) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reconstruct_itinerary/solution.py) |
  | 334 | [Increasing Triplet Subsequence](/problems/increasing-triplet-subsequence) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/increasing_triplet_subsequence/solution.py) |
  | 335 | [Self Crossing](/problems/self-crossing) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/self_crossing/solution.py) |
  | 336 | [Palindrome Pairs](/problems/palindrome-pairs) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/palindrome_pairs/solution.py) |
  | 346 | [Moving Average from Data Stream](/problems/moving-average-from-data-stream) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/moving_average_from_data_stream/solution.py) |
  | 347 | [Top K Frequent Elements](/problems/top-k-frequent-elements) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/top_k_frequent_elements/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) |
  | 349 | [Intersection of Two Arrays](/problems/intersection-of-two-arrays) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/intersection_of_two_arrays/solution.py) |
  | 350 | [Intersection of Two Arrays II](/problems/intersection-of-two-arrays-ii) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/intersection_of_two_arrays_ii/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) |
  | 354 | [Russian Doll Envelopes](/problems/russian-doll-envelopes) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/russian_doll_envelopes/solution.py) |
  | 356 | [Line Reflection](/problems/line-reflection) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/line_reflection/solution.py) |
  | 360 | [Sort Transformed Array](/problems/sort-transformed-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sort_transformed_array/solution.py) |
  | 361 | [Bomb Enemy](/problems/bomb-enemy) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/bomb_enemy/solution.py) |
  | 362 | [Design Hit Counter](/problems/design-hit-counter) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/design_hit_counter/solution.py) |
  | 363 | [Max Sum of Rectangle No Larger Than K](/problems/max-sum-of-rectangle-no-larger-than-k) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/max_sum_of_rectangle_no_larger_than_k/solution.py) |
  | 368 | [Largest Divisible Subset](/problems/largest-divisible-subset) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/largest_divisible_subset/solution.py) |
  | 370 | [Range Addition](/problems/range-addition) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/range_addition/solution.py) |
  | 373 | [Find K Pairs with Smallest Sums](/problems/find-k-pairs-with-smallest-sums) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_k_pairs_with_smallest_sums/solution.py) |
  | 376 | [Wiggle Subsequence](/problems/wiggle-subsequence) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/wiggle_subsequence/solution.py) |
  | 377 | [Combination Sum IV](/problems/combination-sum-iv) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/combination_sum_iv/solution.py) |
  | 378 | [Kth Smallest Element in a Sorted Matrix](/problems/kth-smallest-element-in-a-sorted-matrix) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/kth_smallest_element_in_a_sorted_matrix/solution.py) |
  | 379 | [Design Phone Directory](/problems/design-phone-directory) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/design_phone_directory/solution.py) |
  | 380 | [Insert Delete GetRandom O(1)](/problems/insert-delete-getrandom-o1) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/insert_delete_getrandom_o1/solution.py) |
  | 381 | [Insert Delete GetRandom O(1) - Duplicates allowed](/problems/insert-delete-getrandom-o1-duplicates-allowed) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/insert_delete_getrandom_o1_duplicates_allowed/solution.py) |
  | 384 | [Shuffle an Array](/problems/shuffle-an-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/shuffle_an_array/solution.py) |
  | 391 | [Perfect Rectangle](/problems/perfect-rectangle) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/perfect_rectangle/solution.py) |
  | 393 | [UTF-8 Validation](/problems/utf-8-validation) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/utf_8_validation/solution.py) |
  | 396 | [Rotate Function](/problems/rotate-function) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rotate_function/solution.py) |
  | 399 | [Evaluate Division](/problems/evaluate-division) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/evaluate_division/solution.py) |
  | 403 | [Frog Jump](/problems/frog-jump) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/frog_jump/solution.py) |
  | 406 | [Queue Reconstruction by Height](/problems/queue-reconstruction-by-height) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/queue_reconstruction_by_height/solution.py) |
  | 407 | [Trapping Rain Water II](/problems/trapping-rain-water-ii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/trapping_rain_water_ii/solution.py) |
  | 410 | [Split Array Largest Sum](/problems/split-array-largest-sum) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/split_array_largest_sum/solution.py) |
  | 411 | [Minimum Unique Word Abbreviation](/problems/minimum-unique-word-abbreviation) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_unique_word_abbreviation/solution.py) |
  | 413 | [Arithmetic Slices](/problems/arithmetic-slices) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/arithmetic_slices/solution.py) |
  | 414 | [Third Maximum Number](/problems/third-maximum-number) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/third_maximum_number/solution.py) |
  | 416 | [Partition Equal Subset Sum](/problems/partition-equal-subset-sum) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/partition_equal_subset_sum/solution.py) |
  | 417 | [Pacific Atlantic Water Flow](/problems/pacific-atlantic-water-flow) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/pacific_atlantic_water_flow/solution.py) |
  | 418 | [Sentence Screen Fitting](/problems/sentence-screen-fitting) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sentence_screen_fitting/solution.py) |
  | 419 | [Battleships in a Board](/problems/battleships-in-a-board) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/battleships_in_a_board/solution.py) |
  | 421 | [Maximum XOR of Two Numbers in an Array](/problems/maximum-xor-of-two-numbers-in-an-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_xor_of_two_numbers_in_an_array/solution.py) |
  | 422 | [Valid Word Square](/problems/valid-word-square) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/valid_word_square/solution.py) |
  | 425 | [Word Squares](/problems/word-squares) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/word_squares/solution.py) |
  | 427 | [Construct Quad Tree](/problems/construct-quad-tree) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/construct_quad_tree/solution.py) |
  | 435 | [Non-overlapping Intervals](/problems/non-overlapping-intervals) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/non_overlapping_intervals/solution.py) |
  | 436 | [Find Right Interval](/problems/find-right-interval) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_right_interval/solution.py) |
  | 442 | [Find All Duplicates in an Array](/problems/find-all-duplicates-in-an-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_all_duplicates_in_an_array/solution.py) |
  | 444 | [Sequence Reconstruction](/problems/sequence-reconstruction) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sequence_reconstruction/solution.py) |
  | 446 | [Arithmetic Slices II - Subsequence](/problems/arithmetic-slices-ii-subsequence) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/arithmetic_slices_ii_subsequence/solution.py) |
  | 447 | [Number of Boomerangs](/problems/number-of-boomerangs) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_boomerangs/solution.py) |
  | 448 | [Find All Numbers Disappeared in an Array](/problems/find-all-numbers-disappeared-in-an-array) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_all_numbers_disappeared_in_an_array/solution.py) |
  | 452 | [Minimum Number of Arrows to Burst Balloons](/problems/minimum-number-of-arrows-to-burst-balloons) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_number_of_arrows_to_burst_balloons/solution.py) |
</div>

Pages: 1, [2](/catalog/topics/array-2), [3](/catalog/topics/array-3), [4](/catalog/topics/array-4)


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