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

> Every LeetCode problem in the catalog with difficulty, collections, and tested Python solutions. Part 3 of 8: problems 401-600.

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

<div className="sd-catalog-table">
  | # | Problem | Difficulty | Solution |
  | - | - | - | - |
  | 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) |
  | 420 | [Strong Password Checker](/problems/strong-password-checker) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/strong_password_checker/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) |
  | 423 | [Reconstruct Original Digits from English](/problems/reconstruct-original-digits-from-english) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reconstruct_original_digits_from_english/solution.py) |
  | 424 | [Longest Repeating Character Replacement](/problems/longest-repeating-character-replacement) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_repeating_character_replacement/solution.py) |
  | 425 | [Word Squares](/problems/word-squares) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/word_squares/solution.py) |
  | 426 | [Convert Binary Search Tree to Sorted Doubly Linked List](/problems/convert-binary-search-tree-to-sorted-doubly-linked-list) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/convert_binary_search_tree_to_sorted_doubly_linked_list/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) |
  | 428 | [Serialize and Deserialize N-ary Tree](/problems/serialize-and-deserialize-n-ary-tree) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/serialize_and_deserialize_n_ary_tree/solution.py) |
  | 429 | [N-ary Tree Level Order Traversal](/problems/n-ary-tree-level-order-traversal) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/n_ary_tree_level_order_traversal/solution.py) |
  | 430 | [Flatten a Multilevel Doubly Linked List](/problems/flatten-a-multilevel-doubly-linked-list) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/flatten_a_multilevel_doubly_linked_list/solution.py) |
  | 431 | [Encode N-ary Tree to Binary Tree](/problems/encode-n-ary-tree-to-binary-tree) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/encode_n_ary_tree_to_binary_tree/solution.py) |
  | 432 | [All O\`one Data Structure](/problems/all-oone-data-structure) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/all_oone_data_structure/solution.py) |
  | 433 | [Minimum Genetic Mutation](/problems/minimum-genetic-mutation) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_genetic_mutation/solution.py) |
  | 434 | [Number of Segments in a String](/problems/number-of-segments-in-a-string) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_segments_in_a_string/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) |
  | 437 | [Path Sum III](/problems/path-sum-iii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/path_sum_iii/solution.py) |
  | 438 | [Find All Anagrams in a String](/problems/find-all-anagrams-in-a-string) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_all_anagrams_in_a_string/solution.py) |
  | 439 | [Ternary Expression Parser](/problems/ternary-expression-parser) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/ternary_expression_parser/solution.py) |
  | 440 | [K-th Smallest in Lexicographical Order](/problems/k-th-smallest-in-lexicographical-order) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/k_th_smallest_in_lexicographical_order/solution.py) |
  | 441 | [Arranging Coins](/problems/arranging-coins) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/arranging_coins/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) |
  | 443 | [String Compression](/problems/string-compression) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/string_compression/solution.py) |
  | 444 | [Sequence Reconstruction](/problems/sequence-reconstruction) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sequence_reconstruction/solution.py) |
  | 445 | [Add Two Numbers II](/problems/add-two-numbers-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/add_two_numbers_ii/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) |
  | 449 | [Serialize and Deserialize BST](/problems/serialize-and-deserialize-bst) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/serialize_and_deserialize_bst/solution.py) |
  | 450 | [Delete Node in a BST](/problems/delete-node-in-a-bst) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/delete_node_in_a_bst/solution.py) |
  | 451 | [Sort Characters By Frequency](/problems/sort-characters-by-frequency) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sort_characters_by_frequency/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) |
  | 453 | [Minimum Moves to Equal Array Elements](/problems/minimum-moves-to-equal-array-elements) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_moves_to_equal_array_elements/solution.py) |
  | 454 | [4Sum II](/problems/four-sum-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/four_sum_ii/solution.py) |
  | 455 | [Assign Cookies](/problems/assign-cookies) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/assign_cookies/solution.py) |
  | 456 | [132 Pattern](/problems/pattern-132) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/pattern_132/solution.py) |
  | 457 | [Circular Array Loop](/problems/circular-array-loop) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/circular_array_loop/solution.py) |
  | 458 | [Poor Pigs](/problems/poor-pigs) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/poor_pigs/solution.py) |
  | 459 | [Repeated Substring Pattern](/problems/repeated-substring-pattern) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/repeated_substring_pattern/solution.py) |
  | 460 | [LFU Cache](/problems/lfu-cache) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/lfu_cache/solution.py) |
  | 461 | [Hamming Distance](/problems/hamming-distance) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/hamming_distance/solution.py) |
  | 462 | [Minimum Moves to Equal Array Elements II](/problems/minimum-moves-to-equal-array-elements-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_moves_to_equal_array_elements_ii/solution.py) |
  | 463 | [Island Perimeter](/problems/island-perimeter) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/island_perimeter/solution.py) |
  | 464 | [Can I Win](/problems/can-i-win) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/can_i_win/solution.py) |
  | 465 | [Optimal Account Balancing](/problems/optimal-account-balancing) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/optimal_account_balancing/solution.py) |
  | 466 | [Count The Repetitions](/problems/count-the-repetitions) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/count_the_repetitions/solution.py) |
  | 467 | [Unique Substrings in Wraparound String](/problems/unique-substrings-in-wraparound-string) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/unique_substrings_in_wraparound_string/solution.py) |
  | 468 | [Validate IP Address](/problems/validate-ip-address) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/validate_ip_address/solution.py) |
  | 469 | [Convex Polygon](/problems/convex-polygon) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/convex_polygon/solution.py) |
  | 470 | [Implement Rand10() Using Rand7()](/problems/implement-rand10-using-rand7) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/implement_rand10_using_rand7/solution.py) |
  | 471 | [Encode String with Shortest Length](/problems/encode-string-with-shortest-length) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/encode_string_with_shortest_length/solution.py) |
  | 472 | [Concatenated Words](/problems/concatenated-words) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/concatenated_words/solution.py) |
  | 473 | [Matchsticks to Square](/problems/matchsticks-to-square) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/matchsticks_to_square/solution.py) |
  | 474 | [Ones and Zeroes](/problems/ones-and-zeroes) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/ones_and_zeroes/solution.py) |
  | 475 | [Heaters](/problems/heaters) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/heaters/solution.py) |
  | 476 | [Number Complement](/problems/number-complement) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_complement/solution.py) |
  | 477 | [Total Hamming Distance](/problems/total-hamming-distance) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/total_hamming_distance/solution.py) |
  | 478 | [Generate Random Point in a Circle](/problems/generate-random-point-in-a-circle) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/generate_random_point_in_a_circle/solution.py) |
  | 479 | [Largest Palindrome Product](/problems/largest-palindrome-product) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/largest_palindrome_product/solution.py) |
  | 480 | [Sliding Window Median](/problems/sliding-window-median) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sliding_window_median/solution.py) |
  | 481 | [Magical String](/problems/magical-string) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/magical_string/solution.py) |
  | 482 | [License Key Formatting](/problems/license-key-formatting) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/license_key_formatting/solution.py) |
  | 483 | [Smallest Good Base](/problems/smallest-good-base) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/smallest_good_base/solution.py) |
  | 484 | [Find Permutation](/problems/find-permutation) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_permutation/solution.py) |
  | 485 | [Max Consecutive Ones](/problems/max-consecutive-ones) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/max_consecutive_ones/solution.py) |
  | 486 | [Predict the Winner](/problems/predict-the-winner) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/predict_the_winner/solution.py) |
  | 487 | [Max Consecutive Ones II](/problems/max-consecutive-ones-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/max_consecutive_ones_ii/solution.py) |
  | 488 | [Zuma Game](/problems/zuma-game) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/zuma_game/solution.py) |
  | 489 | [Robot Room Cleaner](/problems/robot-room-cleaner) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/robot_room_cleaner/solution.py) |
  | 490 | [The Maze](/problems/the-maze) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/the_maze/solution.py) |
  | 491 | [Non-decreasing Subsequences](/problems/non-decreasing-subsequences) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/non_decreasing_subsequences/solution.py) |
  | 492 | [Construct the Rectangle](/problems/construct-the-rectangle) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/construct_the_rectangle/solution.py) |
  | 493 | [Reverse Pairs](/problems/reverse-pairs) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reverse_pairs/solution.py) |
  | 494 | [Target Sum](/problems/target-sum) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/target_sum/solution.py) |
  | 495 | [Teemo Attacking](/problems/teemo-attacking) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/teemo_attacking/solution.py) |
  | 496 | [Next Greater Element I](/problems/next-greater-element-i) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/next_greater_element_i/solution.py) |
  | 497 | [Random Point in Non-overlapping Rectangles](/problems/random-point-in-non-overlapping-rectangles) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/random_point_in_non_overlapping_rectangles/solution.py) |
  | 498 | [Diagonal Traverse](/problems/diagonal-traverse) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/diagonal_traverse/solution.py) |
  | 499 | [The Maze III](/problems/the-maze-iii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/the_maze_iii/solution.py) |
  | 500 | [Keyboard Row](/problems/keyboard-row) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/keyboard_row/solution.py) |
  | 501 | [Find Mode in Binary Search Tree](/problems/find-mode-in-binary-search-tree) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_mode_in_binary_search_tree/solution.py) |
  | 502 | [IPO](/problems/ipo) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/ipo/solution.py) |
  | 503 | [Next Greater Element II](/problems/next-greater-element-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/next_greater_element_ii/solution.py) |
  | 504 | [Base 7](/problems/base-7) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/base_7/solution.py) |
  | 505 | [The Maze II](/problems/the-maze-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/the_maze_ii/solution.py) |
  | 506 | [Relative Ranks](/problems/relative-ranks) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/relative_ranks/solution.py) |
  | 507 | [Perfect Number](/problems/perfect-number) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/perfect_number/solution.py) |
  | 508 | [Most Frequent Subtree Sum](/problems/most-frequent-subtree-sum) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/most_frequent_subtree_sum/solution.py) |
  | 509 | [Fibonacci Number](/problems/fibonacci-number) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/fibonacci_number/solution.py) |
  | 510 | [Inorder Successor in BST II](/problems/inorder-successor-in-bst-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/inorder_successor_in_bst_ii/solution.py) |
  | 513 | [Find Bottom Left Tree Value](/problems/find-bottom-left-tree-value) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_bottom_left_tree_value/solution.py) |
  | 514 | [Freedom Trail](/problems/freedom-trail) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/freedom_trail/solution.py) |
  | 515 | [Find Largest Value in Each Tree Row](/problems/find-largest-value-in-each-tree-row) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_largest_value_in_each_tree_row/solution.py) |
  | 516 | [Longest Palindromic Subsequence](/problems/longest-palindromic-subsequence) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_palindromic_subsequence/solution.py) |
  | 517 | [Super Washing Machines](/problems/super-washing-machines) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/super_washing_machines/solution.py) |
  | 518 | [Coin Change II](/problems/coin-change-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/coin_change_ii/solution.py) |
  | 519 | [Random Flip Matrix](/problems/random-flip-matrix) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/random_flip_matrix/solution.py) |
  | 520 | [Detect Capital](/problems/detect-capital) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/detect_capital/solution.py) |
  | 521 | [Longest Uncommon Subsequence I](/problems/longest-uncommon-subsequence-i) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_uncommon_subsequence_i/solution.py) |
  | 522 | [Longest Uncommon Subsequence II](/problems/longest-uncommon-subsequence-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_uncommon_subsequence_ii/solution.py) |
  | 523 | [Continuous Subarray Sum](/problems/continuous-subarray-sum) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/continuous_subarray_sum/solution.py) |
  | 524 | [Longest Word in Dictionary through Deleting](/problems/longest-word-in-dictionary-through-deleting) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_word_in_dictionary_through_deleting/solution.py) |
  | 525 | [Contiguous Array](/problems/contiguous-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/contiguous_array/solution.py) |
  | 526 | [Beautiful Arrangement](/problems/beautiful-arrangement) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/beautiful_arrangement/solution.py) |
  | 527 | [Word Abbreviation](/problems/word-abbreviation) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/word_abbreviation/solution.py) |
  | 528 | [Random Pick with Weight](/problems/random-pick-with-weight) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/random_pick_with_weight/solution.py) |
  | 529 | [Minesweeper](/problems/minesweeper) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minesweeper/solution.py) |
  | 530 | [Minimum Absolute Difference in BST](/problems/minimum-absolute-difference-in-bst) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_absolute_difference_in_bst/solution.py) |
  | 531 | [Lonely Pixel I](/problems/lonely-pixel-i) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/lonely_pixel_i/solution.py) |
  | 532 | [K-diff Pairs in an Array](/problems/k-diff-pairs-in-an-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/k_diff_pairs_in_an_array/solution.py) |
  | 533 | [Lonely Pixel II](/problems/lonely-pixel-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/lonely_pixel_ii/solution.py) |
  | 535 | [Encode and Decode TinyURL](/problems/encode-and-decode-tinyurl) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/encode_and_decode_tinyurl/solution.py) |
  | 536 | [Construct Binary Tree from String](/problems/construct-binary-tree-from-string) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/construct_binary_tree_from_string/solution.py) |
  | 537 | [Complex Number Multiplication](/problems/complex-number-multiply) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/complex_number_multiply/solution.py) |
  | 538 | [Convert BST to Greater Tree](/problems/convert-bst-to-greater-tree) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/convert_bst_to_greater_tree/solution.py) |
  | 539 | [Minimum Time Difference](/problems/minimum-time-difference) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_time_difference/solution.py) |
  | 540 | [Single Element in a Sorted Array](/problems/single-element-in-a-sorted-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/single_element_in_a_sorted_array/solution.py) |
  | 541 | [Reverse String II](/problems/reverse-string-ii) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reverse_string_ii/solution.py) |
  | 542 | [01 Matrix](/problems/zero-one-matrix) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/zero_one_matrix/solution.py) |
  | 543 | [Diameter of Binary Tree](/problems/diameter-of-binary-tree) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/diameter_of_binary_tree/solution.py) |
  | 544 | [Output Contest Matches](/problems/output-contest-matches) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/output_contest_matches/solution.py) |
  | 545 | [Boundary of Binary Tree](/problems/boundary-of-binary-tree) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/boundary_of_binary_tree/solution.py) |
  | 546 | [Remove Boxes](/problems/remove-boxes) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/remove_boxes/solution.py) |
  | 547 | [Number of Provinces](/problems/number-of-provinces) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/number_of_provinces/solution.py) |
  | 548 | [Split Array with Equal Sum](/problems/split-array-with-equal-sum) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/split_array_with_equal_sum/solution.py) |
  | 549 | [Binary Tree Longest Consecutive Sequence II](/problems/binary-tree-longest-consecutive-sequence-ii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_tree_longest_consecutive_sequence_ii/solution.py) |
  | 551 | [Student Attendance Record I](/problems/student-attendance-record-i) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/student_attendance_record_i/solution.py) |
  | 552 | [Student Attendance Record II](/problems/student-attendance-record-ii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/student_attendance_record_ii/solution.py) |
  | 553 | [Optimal Division](/problems/optimal-division) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/optimal_division/solution.py) |
  | 554 | [Brick Wall](/problems/brick-wall) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/brick_wall/solution.py) |
  | 555 | [Split Concatenated Strings](/problems/split-concatenated-strings) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/split_concatenated_strings/solution.py) |
  | 556 | [Next Greater Element III](/problems/next-greater-element-iii) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/next_greater_element_iii/solution.py) |
  | 557 | [Reverse Words in a String III](/problems/reverse-words-in-a-string-iii) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reverse_words_in_a_string_iii/solution.py) |
  | 558 | [Logical OR of Two Binary Grids Represented as Quad-Trees](/problems/logical-or-of-two-binary-grids-represented-as-quad-trees) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/logical_or_of_two_binary_grids_represented_as_quad_trees/solution.py) |
  | 559 | [Maximum Depth of N-ary Tree](/problems/maximum-depth-of-n-ary-tree) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_depth_of_n_ary_tree/solution.py) |
  | 560 | [Subarray Sum Equals K](/problems/subarray-sum-equals-k) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/subarray_sum_equals_k/solution.py) |
  | 561 | [Array Partition](/problems/array-partition) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/array_partition/solution.py) |
  | 562 | [Longest Line of Consecutive One in Matrix](/problems/longest-line-of-consecutive-one-in-matrix) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_line_of_consecutive_one_in_matrix/solution.py) |
  | 563 | [Binary Tree Tilt](/problems/binary-tree-tilt) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/binary_tree_tilt/solution.py) |
  | 564 | [Find the Closest Palindrome](/problems/find-the-closest-palindrome) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_the_closest_palindrome/solution.py) |
  | 565 | [Array Nesting](/problems/array-nesting) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/array_nesting/solution.py) |
  | 566 | [Reshape the Matrix](/problems/reshape-the-matrix) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/reshape_the_matrix/solution.py) |
  | 567 | [Permutation in String](/problems/permutation-in-string) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/permutation_in_string/solution.py) |
  | 568 | [Maximum Vacation Days](/problems/maximum-vacation-days) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_vacation_days/solution.py) |
  | 572 | [Subtree of Another Tree](/problems/subtree-of-another-tree) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/subtree_of_another_tree/solution.py) |
  | 573 | [Squirrel Simulation](/problems/squirrel-simulation) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/squirrel_simulation/solution.py) |
  | 575 | [Distribute Candies](/problems/distribute-candies) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/distribute_candies/solution.py) |
  | 576 | [Out of Boundary Paths](/problems/out-of-boundary-paths) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/out_of_boundary_paths/solution.py) |
  | 581 | [Shortest Unsorted Continuous Subarray](/problems/shortest-unsorted-continuous-subarray) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/shortest_unsorted_continuous_subarray/solution.py) |
  | 582 | [Kill Process](/problems/kill-process) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/kill_process/solution.py) |
  | 583 | [Delete Operation for Two Strings](/problems/delete-operation-for-two-strings) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/delete_operation_for_two_strings/solution.py) |
  | 587 | [Erect the Fence](/problems/erect-the-fence) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/erect_the_fence/solution.py) |
  | 588 | [Design In-Memory File System](/problems/design-in-memory-file-system) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/design_in_memory_file_system/solution.py) |
  | 589 | [N-ary Tree Preorder Traversal](/problems/n-ary-tree-preorder-traversal) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/n_ary_tree_preorder_traversal/solution.py) |
  | 590 | [N-ary Tree Postorder Traversal](/problems/n-ary-tree-postorder-traversal) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/n_ary_tree_postorder_traversal/solution.py) |
  | 591 | [Tag Validator](/problems/tag-validator) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/tag_validator/solution.py) |
  | 592 | [Fraction Addition and Subtraction](/problems/fraction-addition-and-subtraction) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/fraction_addition_and_subtraction/solution.py) |
  | 593 | [Valid Square](/problems/valid-square) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/valid_square/solution.py) |
  | 594 | [Longest Harmonious Subsequence](/problems/longest-harmonious-subsequence) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/longest_harmonious_subsequence/solution.py) |
  | 598 | [Range Addition II](/problems/range-addition-ii) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/range_addition_ii/solution.py) |
  | 599 | [Minimum Index Sum of Two Lists](/problems/minimum-index-sum-of-two-lists) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_index_sum_of_two_lists/solution.py) |
  | 600 | [Non-negative Integers without Consecutive Ones](/problems/non-negative-integers-without-consecutive-ones) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/non_negative_integers_without_consecutive_ones/solution.py) |
  | 604 | [Design Compressed String Iterator](/problems/design-compressed-string-iterator) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/design_compressed_string_iterator/solution.py) |
  | 605 | [Can Place Flowers](/problems/can-place-flowers) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/can_place_flowers/solution.py) |
  | 606 | [Construct String from Binary Tree](/problems/construct-string-from-binary-tree) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/construct_string_from_binary_tree/solution.py) |
  | 609 | [Find Duplicate File in System](/problems/find-duplicate-file-in-system) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_duplicate_file_in_system/solution.py) |
  | 611 | [Valid Triangle Number](/problems/valid-triangle-number) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/valid_triangle_number/solution.py) |
  | 616 | [Add Bold Tag in String](/problems/add-bold-tag-in-string) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/add_bold_tag_in_string/solution.py) |
  | 617 | [Merge Two Binary Trees](/problems/merge-two-binary-trees) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/merge_two_binary_trees/solution.py) |
  | 621 | [Task Scheduler](/problems/task-scheduler) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/task_scheduler/solution.py) |
  | 622 | [Design Circular Queue](/problems/design-circular-queue) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/design_circular_queue/solution.py) |
  | 623 | [Add One Row to Tree](/problems/add-one-row-to-tree) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/add_one_row_to_tree/solution.py) |
  | 624 | [Maximum Distance in Arrays](/problems/maximum-distance-in-arrays) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_distance_in_arrays/solution.py) |
  | 625 | [Minimum Factorization](/problems/minimum-factorization) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/minimum_factorization/solution.py) |
  | 628 | [Maximum Product of Three Numbers](/problems/maximum-product-of-three-numbers) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_product_of_three_numbers/solution.py) |
  | 629 | [K Inverse Pairs Array](/problems/k-inverse-pairs-array) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/k_inverse_pairs_array/solution.py) |
  | 630 | [Course Schedule III](/problems/course-schedule-iii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/course_schedule_iii/solution.py) |
  | 631 | [Design Excel Sum Formula](/problems/design-excel-sum-formula) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/design_excel_sum_formula/solution.py) |
  | 632 | [Smallest Range Covering Elements from K Lists](/problems/smallest-range-covering-elements-from-k-lists) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/smallest_range_covering_elements_from_k_lists/solution.py) |
  | 633 | [Sum of Square Numbers](/problems/sum-of-square-numbers) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/sum_of_square_numbers/solution.py) |
  | 634 | [Find the Derangement of An Array](/problems/find-the-derangement-of-an-array) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/find_the_derangement_of_an_array/solution.py) |
  | 635 | [Design Log Storage System](/problems/design-log-storage-system) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/design_log_storage_system/solution.py) |
  | 636 | [Exclusive Time of Functions](/problems/exclusive-time-of-functions) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/exclusive_time_of_functions/solution.py) |
  | 637 | [Average of Levels in Binary Tree](/problems/average-of-levels-in-binary-tree) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/average_of_levels_in_binary_tree/solution.py) |
  | 638 | [Shopping Offers](/problems/shopping-offers) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/shopping_offers/solution.py) |
  | 639 | [Decode Ways II](/problems/decode-ways-ii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/decode_ways_ii/solution.py) |
  | 640 | [Solve the Equation](/problems/solve-the-equation) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/solve_the_equation/solution.py) |
  | 641 | [Design Circular Deque](/problems/design-circular-deque) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/design_circular_deque/solution.py) |
  | 642 | [Design Search Autocomplete System](/problems/design-search-autocomplete-system) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/design_search_autocomplete_system/solution.py) |
  | 643 | [Maximum Average Subarray I](/problems/maximum-average-subarray-i) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_average_subarray_i/solution.py) |
  | 644 | [Maximum Average Subarray II](/problems/maximum-average-subarray-ii) | Hard | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_average_subarray_ii/solution.py) |
  | 645 | [Set Mismatch](/problems/set-mismatch) | Easy | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/set_mismatch/solution.py) |
  | 646 | [Maximum Length of Pair Chain](/problems/maximum-length-of-pair-chain) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/maximum_length_of_pair_chain/solution.py) |
  | 647 | [Palindromic Substrings](/problems/palindromic-substrings) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/palindromic_substrings/solution.py) |
  | 648 | [Replace Words](/problems/replace-words) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/replace_words/solution.py) |
  | 649 | [Dota2 Senate](/problems/dota2-senate) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/dota2_senate/solution.py) |
  | 650 | [2 Keys Keyboard](/problems/two-keys-keyboard) | Medium | [solution.py](https://github.com/wislertt/leetcode-py/blob/main/leetcode/two_keys_keyboard/solution.py) |
</div>

Pages: [1](/catalog/all), [2](/catalog/all-2), 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.