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

# All LeetCode Problems in Python, Part 2

> Every LeetCode problem in the catalog with difficulty, collections, and tested Python solutions. Part 2 of 8: problems 201-400.

Every problem shipped in this repository: 1404 problems (309 Easy, 819 Medium, 276 Hard).

<div className="sd-catalog-table">
  | # | Problem | Difficulty | Solution |
  | - | - | - | - |
  | 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) |
  | 222 | [Count Complete Tree Nodes](/problems/count-complete-tree-nodes) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_complete_tree_nodes/solution.py) |
  | 223 | [Rectangle Area](/problems/rectangle-area) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rectangle_area/solution.py) |
  | 224 | [Basic Calculator](/problems/basic-calculator) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/basic_calculator/solution.py) |
  | 225 | [Implement Stack using Queues](/problems/implement-stack-using-queues) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/implement_stack_using_queues/solution.py) |
  | 226 | [Invert Binary Tree](/problems/invert-binary-tree) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/invert_binary_tree/solution.py) |
  | 227 | [Basic Calculator II](/problems/basic-calculator-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/basic_calculator_ii/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) |
  | 230 | [Kth Smallest Element in a BST](/problems/kth-smallest-element-in-a-bst) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/kth_smallest_element_in_a_bst/solution.py) |
  | 231 | [Power of Two](/problems/power-of-two) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/power_of_two/solution.py) |
  | 232 | [Implement Queue using Stacks](/problems/implement-queue-using-stacks) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/implement_queue_using_stacks/solution.py) |
  | 233 | [Number of Digit One](/problems/number-of-digit-one) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_digit_one/solution.py) |
  | 234 | [Palindrome Linked List](/problems/palindrome-linked-list) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/palindrome_linked_list/solution.py) |
  | 235 | [Lowest Common Ancestor of a Binary Search Tree](/problems/lowest-common-ancestor-of-a-binary-search-tree) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/lowest_common_ancestor_of_a_binary_search_tree/solution.py) |
  | 236 | [Lowest Common Ancestor of a Binary Tree](/problems/lowest-common-ancestor-of-a-binary-tree) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/lowest_common_ancestor_of_a_binary_tree/solution.py) |
  | 237 | [Delete Node in a Linked List](/problems/delete-node-in-a-linked-list) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/delete_node_in_a_linked_list/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) |
  | 241 | [Different Ways to Add Parentheses](/problems/different-ways-to-add-parentheses) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/different_ways_to_add_parentheses/solution.py) |
  | 242 | [Valid Anagram](/problems/valid-anagram) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/valid_anagram/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) |
  | 246 | [Strobogrammatic Number](/problems/strobogrammatic-number) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/strobogrammatic_number/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) |
  | 250 | [Count Univalue Subtrees](/problems/count-univalue-subtrees) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_univalue_subtrees/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) |
  | 254 | [Factor Combinations](/problems/factor-combinations) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/factor_combinations/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) |
  | 257 | [Binary Tree Paths](/problems/binary-tree-paths) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_tree_paths/solution.py) |
  | 258 | [Add Digits](/problems/add-digits) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/add_digits/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) |
  | 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) |
  | 263 | [Ugly Number](/problems/ugly-number) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/ugly_number/solution.py) |
  | 264 | [Ugly Number II](/problems/ugly-number-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/ugly_number_ii/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) |
  | 266 | [Palindrome Permutation](/problems/palindrome-permutation) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/palindrome_permutation/solution.py) |
  | 267 | [Palindrome Permutation II](/problems/palindrome-permutation-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/palindrome_permutation_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) |
  | 270 | [Closest Binary Search Tree Value](/problems/closest-bst-value) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/closest_bst_value/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) |
  | 272 | [Closest Binary Search Tree Value II](/problems/closest-bst-value-ii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/closest_bst_value_ii/solution.py) |
  | 273 | [Integer to English Words](/problems/integer-to-english-words) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/integer_to_english_words/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) |
  | 276 | [Paint Fence](/problems/paint-fence) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/paint_fence/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) |
  | 278 | [First Bad Version](/problems/first-bad-version) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/first_bad_version/solution.py) |
  | 279 | [Perfect Squares](/problems/perfect-squares) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/perfect_squares/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) |
  | 282 | [Expression Add Operators](/problems/expression-add-operators) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/expression_add_operators/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) |
  | 285 | [Inorder Successor in BST](/problems/inorder-successor-in-bst) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/inorder_successor_in_bst/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) |
  | 290 | [Word Pattern](/problems/word-pattern) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/word_pattern/solution.py) |
  | 291 | [Word Pattern II](/problems/word-pattern-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/word_pattern_ii/solution.py) |
  | 292 | [Nim Game](/problems/nim-game) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/nim_game/solution.py) |
  | 293 | [Flip Game](/problems/flip-game) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/flip_game/solution.py) |
  | 294 | [Flip Game II](/problems/flip-game-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/flip_game_ii/solution.py) |
  | 295 | [Find Median from Data Stream](/problems/find-median-from-data-stream) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_median_from_data_stream/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) |
  | 297 | [Serialize and Deserialize Binary Tree](/problems/serialize-and-deserialize-binary-tree) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/serialize_and_deserialize_binary_tree/solution.py) |
  | 298 | [Binary Tree Longest Consecutive Sequence](/problems/binary-tree-longest-consecutive-sequence) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_tree_longest_consecutive_sequence/solution.py) |
  | 299 | [Bulls and Cows](/problems/bulls-and-cows) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/bulls_and_cows/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) |
  | 301 | [Remove Invalid Parentheses](/problems/remove-invalid-parentheses) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/remove_invalid_parentheses/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) |
  | 306 | [Additive Number](/problems/additive-number) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/additive_number/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) |
  | 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) |
  | 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) |
  | 314 | [Binary Tree Vertical Order Traversal](/problems/binary-tree-vertical-order-traversal) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_tree_vertical_order_traversal/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) |
  | 316 | [Remove Duplicate Letters](/problems/remove-duplicate-letters) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/remove_duplicate_letters/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) |
  | 319 | [Bulb Switcher](/problems/bulb-switcher) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/bulb_switcher/solution.py) |
  | 320 | [Generalized Abbreviation](/problems/generalized-abbreviation) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/generalized_abbreviation/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) |
  | 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) |
  | 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) |
  | 326 | [Power of Three](/problems/power-of-three) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/power_of_three/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) |
  | 328 | [Odd Even Linked List](/problems/odd-even-linked-list) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/odd_even_linked_list/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) |
  | 331 | [Verify Preorder Serialization of a Binary Tree](/problems/verify-preorder-serialization-of-a-binary-tree) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/verify_preorder_serialization_of_a_binary_tree/solution.py) |
  | 332 | [Reconstruct Itinerary](/problems/reconstruct-itinerary) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reconstruct_itinerary/solution.py) |
  | 333 | [Largest BST Subtree](/problems/largest-bst-subtree) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/largest_bst_subtree/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) |
  | 337 | [House Robber III](/problems/house-robber-iii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/house_robber_iii/solution.py) |
  | 338 | [Counting Bits](/problems/counting-bits) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/counting_bits/solution.py) |
  | 339 | [Nested List Weight Sum](/problems/nested-list-weight-sum) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/nested_list_weight_sum/solution.py) |
  | 340 | [Longest Substring with At Most K Distinct Characters](/problems/longest-substring-with-at-most-k-distinct-characters) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_substring_with_at_most_k_distinct_characters/solution.py) |
  | 341 | [Flatten Nested List Iterator](/problems/flatten-nested-list-iterator) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/flatten_nested_list_iterator/solution.py) |
  | 342 | [Power of Four](/problems/power-of-four) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/power_of_four/solution.py) |
  | 343 | [Integer Break](/problems/integer-break) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/integer_break/solution.py) |
  | 344 | [Reverse String](/problems/reverse-string) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reverse_string/solution.py) |
  | 345 | [Reverse Vowels of a String](/problems/reverse-vowels-of-a-string) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reverse_vowels_of_a_string/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) |
  | 351 | [Android Unlock Patterns](/problems/android-unlock-patterns) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/android_unlock_patterns/solution.py) |
  | 352 | [Data Stream as Disjoint Intervals](/problems/data-stream-as-disjoint-intervals) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/data_stream_as_disjoint_intervals/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) |
  | 355 | [Design Twitter](/problems/design-twitter) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/design_twitter/solution.py) |
  | 356 | [Line Reflection](/problems/line-reflection) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/line_reflection/solution.py) |
  | 357 | [Count Numbers with Unique Digits](/problems/count-numbers-with-unique-digits) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_numbers_with_unique_digits/solution.py) |
  | 358 | [Rearrange String k Distance Apart](/problems/rearrange-string-k-distance-apart) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rearrange_string_k_distance_apart/solution.py) |
  | 359 | [Logger Rate Limiter](/problems/logger-rate-limiter) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/logger_rate_limiter/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) |
  | 364 | [Nested List Weight Sum II](/problems/nested-list-weight-sum-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/nested_list_weight_sum_ii/solution.py) |
  | 365 | [Water and Jug Problem](/problems/water-and-jug-problem) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/water_and_jug_problem/solution.py) |
  | 366 | [Find Leaves of Binary Tree](/problems/find-leaves-of-binary-tree) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_leaves_of_binary_tree/solution.py) |
  | 367 | [Valid Perfect Square](/problems/valid-perfect-square) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/valid_perfect_square/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) |
  | 369 | [Plus One Linked List](/problems/plus-one-linked-list) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/plus_one_linked_list/solution.py) |
  | 370 | [Range Addition](/problems/range-addition) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/range_addition/solution.py) |
  | 371 | [Sum of Two Integers](/problems/sum-of-two-integers) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sum_of_two_integers/solution.py) |
  | 372 | [Super Pow](/problems/super-pow) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/super_pow/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) |
  | 374 | [Guess Number Higher or Lower](/problems/guess-number-higher-or-lower) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/guess_number_higher_or_lower/solution.py) |
  | 375 | [Guess Number Higher or Lower II](/problems/guess-number-higher-or-lower-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/guess_number_higher_or_lower_ii/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) |
  | 382 | [Linked List Random Node](/problems/linked-list-random-node) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/linked_list_random_node/solution.py) |
  | 383 | [Ransom Note](/problems/ransom-note) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/ransom_note/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) |
  | 385 | [Mini Parser](/problems/mini-parser) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/mini_parser/solution.py) |
  | 386 | [Lexicographical Numbers](/problems/lexicographical-numbers) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/lexicographical_numbers/solution.py) |
  | 387 | [First Unique Character in a String](/problems/first-unique-character-in-a-string) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/first_unique_character_in_a_string/solution.py) |
  | 388 | [Longest Absolute File Path](/problems/longest-absolute-file-path) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_absolute_file_path/solution.py) |
  | 389 | [Find the Difference](/problems/find-the-difference) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_the_difference/solution.py) |
  | 390 | [Elimination Game](/problems/elimination-game) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/elimination_game/solution.py) |
  | 391 | [Perfect Rectangle](/problems/perfect-rectangle) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/perfect_rectangle/solution.py) |
  | 392 | [Is Subsequence](/problems/is-subsequence) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/is_subsequence/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) |
  | 394 | [Decode String](/problems/decode-string) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/decode_string/solution.py) |
  | 395 | [Longest Substring with At Least K Repeating Characters](/problems/longest-substring-with-at-least-k-repeating-characters) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_substring_with_at_least_k_repeating_characters/solution.py) |
  | 396 | [Rotate Function](/problems/rotate-function) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/rotate_function/solution.py) |
  | 397 | [Integer Replacement](/problems/integer-replacement) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/integer_replacement/solution.py) |
  | 398 | [Random Pick Index](/problems/random-pick-index) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/random_pick_index/solution.py) |
  | 399 | [Evaluate Division](/problems/evaluate-division) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/evaluate_division/solution.py) |
  | 400 | [Nth Digit](/problems/nth-digit) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/nth_digit/solution.py) |
  | 401 | [Binary Watch](/problems/binary-watch) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_watch/solution.py) |
  | 402 | [Remove K Digits](/problems/remove-k-digits) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/remove_k_digits/solution.py) |
  | 403 | [Frog Jump](/problems/frog-jump) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/frog_jump/solution.py) |
  | 404 | [Sum of Left Leaves](/problems/sum-of-left-leaves) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sum_of_left_leaves/solution.py) |
  | 405 | [Convert a Number to Hexadecimal](/problems/convert-a-number-to-hexadecimal) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/convert_a_number_to_hexadecimal/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) |
  | 408 | [Valid Word Abbreviation](/problems/valid-word-abbreviation) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/valid_word_abbreviation/solution.py) |
  | 409 | [Longest Palindrome](/problems/longest-palindrome) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_palindrome/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) |
  | 412 | [Fizz Buzz](/problems/fizz-buzz) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/fizz_buzz/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) |
  | 415 | [Add Strings](/problems/add-strings) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/add_strings/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) |
</div>

Pages: [1](/catalog/all), 2, [3](/catalog/all-3), [4](/catalog/all-4), [5](/catalog/all-5), [6](/catalog/all-6), [7](/catalog/all-7), [8](/catalog/all-8)


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