Directories ¶ Show internal Expand all Path Synopsis 01-matrix 1-bit-and-2-bit-characters 132-pattern 2-keys-keyboard 3sum 3sum-closest 3sum-with-multiplicity 4sum accounts-merge add-binary add-digits add-one-row-to-tree add-strings add-to-array-form-of-integer add-two-integers add-two-numbers all-paths-from-source-to-target alternating-digit-sum ant-on-the-boundary append-characters-to-string-to-make-subsequence arithmetic-slices arranging-coins array-partition-i as-far-from-land-as-possible assign-cookies asteroid-collision available-captures-for-rook average-salary-excluding-the-minimum-and-maximum-salary average-waiting-time backspace-string-compare bag-of-tokens balance-a-binary-search-tree balanced-binary-tree baseball-game basic-calculator best-time-to-buy-and-sell-stock best-time-to-buy-and-sell-stock-ii best-time-to-buy-and-sell-stock-with-cooldown binary-search binary-search-tree-iterator binary-search-tree-to-greater-sum-tree binary-tree-inorder-traversal binary-tree-level-order-traversal binary-tree-maximum-path-sum binary-tree-paths binary-tree-postorder-traversal binary-tree-preorder-traversal binary-tree-right-side-view binary-tree-zigzag-level-order-traversal binary-trees-with-factors boats-to-save-people break-a-palindrome build-array-from-permutation buy-two-chocolates can-make-arithmetic-progression-from-sequence can-place-flowers candy capacity-to-ship-packages-within-d-days cells-with-odd-values-in-a-matrix check-completeness-of-a-binary-tree check-if-a-string-contains-all-binary-codes-of-size-k check-if-a-string-is-an-acronym-of-words check-if-array-is-sorted-and-rotated check-if-it-is-a-straight-line check-if-numbers-are-ascending-in-a-sentence check-if-strings-can-be-made-equal-with-operations-i check-if-the-sentence-is-pangram cherry-pickup-ii circular-sentence climbing-stairs clone-graph closest-nodes-queries-in-a-binary-search-tree coin-change combination-sum combination-sum-ii combination-sum-iii combination-sum-iv combinations compare-version-numbers complement-of-base-10-integer concatenation-of-array construct-binary-tree-from-inorder-and-postorder-traversal construct-binary-tree-from-preorder-and-inorder-traversal construct-quad-tree container-with-most-water contains-duplicate convert-a-number-to-hexadecimal convert-an-array-into-a-2d-array-with-conditions convert-binary-number-in-a-linked-list-to-integer convert-bst-to-greater-tree convert-sorted-array-to-binary-search-tree convert-sorted-list-to-binary-search-tree count-and-say count-beautiful-substrings-i count-complete-tree-nodes count-distinct-numbers-on-board count-elements-with-maximum-frequency count-lattice-points-inside-a-circle count-negative-numbers-in-a-sorted-matrix count-nodes-equal-to-average-of-subtree count-odd-numbers-in-an-interval-range count-pairs-whose-sum-is-less-than-target count-prefixes-of-a-given-string count-sorted-vowel-strings count-sub-islands count-subarrays-where-max-element-appears-at-least-k-times count-subarrays-with-fixed-bounds count-tested-devices-after-test-operations count-the-number-of-consistent-strings count-the-number-of-fair-pairs count-the-number-of-incremovable-subarrays-i count-total-number-of-colored-cells count-triplets-that-can-form-two-arrays-of-equal-xor count-unreachable-pairs-of-nodes-in-an-undirected-graph count-vowels-permutation count-ways-to-build-good-strings count-ways-to-group-overlapping-ranges counting-bits course-schedule cousins-in-binary-tree crawler-log-folder decode-ways deepest-leaves-sum defanging-an-ip-address delete-columns-to-make-sorted delete-leaves-with-a-given-value delete-node-in-a-linked-list delete-nodes-and-return-forest delete-operation-for-two-strings delete-the-middle-node-of-a-linked-list design-add-and-search-words-data-structure design-browser-history design-hashmap design-hashset design-parking-system design-underground-system detect-capital determine-if-string-halves-are-alike determine-if-two-strings-are-close detonate-the-maximum-bombs diameter-of-binary-tree distribute-money-to-maximum-children divide-an-array-into-subarrays-with-minimum-cost-i divide-array-in-sets-of-k-consecutive-numbers divide-array-into-arrays-with-max-difference divide-players-into-teams-of-equal-skill divide-two-integers domino-and-tromino-tiling double-a-number-represented-as-a-linked-list edit-distance encode-and-decode-tinyurl erect-the-fence evaluate-boolean-binary-tree evaluate-division evaluate-reverse-polish-notation excel-sheet-column-number excel-sheet-column-title extra-characters-in-a-string faulty-keyboard fibonacci-number final-value-of-variable-after-performing-operations find-all-anagrams-in-a-string find-all-numbers-disappeared-in-an-array find-center-of-star-graph find-common-characters find-duplicate-subtrees find-first-and-last-position-of-element-in-sorted-array find-first-palindromic-string-in-the-array find-if-path-exists-in-graph find-minimum-in-rotated-sorted-array find-numbers-with-even-number-of-digits find-pivot-index find-players-with-zero-or-one-losses find-polygon-with-the-largest-perimeter find-smallest-letter-greater-than-target find-subarrays-with-equal-sum find-the-array-concatenation-value find-the-difference find-the-difference-of-two-arrays find-the-longest-valid-obstacle-course-at-each-position find-the-maximum-sum-of-node-values find-the-minimum-and-maximum-number-of-nodes-between-critical-points find-the-pivot-integer find-the-substring-with-maximum-cost find-the-winner-of-the-circular-game first-bad-version first-unique-character-in-a-string fizz-buzz flatten-binary-tree-to-linked-list flatten-nested-list-iterator flood-fill form-smallest-number-from-two-digit-arrays fraction-addition-and-subtraction frog-jump-ii fruit-into-baskets furthest-point-from-origin game-of-life gas-station generate-parentheses get-equal-substrings-within-budget greatest-common-divisor-of-strings group-anagrams group-the-people-given-the-group-size-they-belong-to grumpy-bookstore-owner guess-number-higher-or-lower hamming-distance hand-of-straights happy-number height-checker house-robber implement-queue-using-stacks implement-stack-using-queues implement-strstr implement-trie-prefix-tree increasing-order-search-tree increasing-triplet-subsequence insert-delete-getrandom-o1 insert-greatest-common-divisors-in-linked-list insert-interval integer-to-roman intersection-of-multiple-arrays intersection-of-two-arrays intersection-of-two-arrays-ii intersection-of-two-linked-lists invert-binary-tree ipo is-graph-bipartite is-subsequence isomorphic-strings jewels-and-stones jump-game jump-game-ii jump-game-iv k-closest-points-to-origin k-th-smallest-prime-fraction k-th-symbol-in-grammar keys-and-rooms kids-with-the-greatest-number-of-candies koko-eating-bananas kth-distinct-string-in-an-array kth-largest-element-in-a-stream kth-largest-element-in-an-array kth-missing-positive-number kth-smallest-element-in-a-bst kth-smallest-element-in-a-sorted-matrix largest-divisible-subset largest-local-values-in-a-matrix largest-perimeter-triangle largest-positive-integer-that-exists-with-its-negative last-stone-weight leaf-similar-trees least-number-of-unique-integers-after-k-removals left-and-right-sum-differences length-of-last-word length-of-longest-subarray-with-at-most-k-frequency letter-combinations-of-a-phone-number lexicographical-numbers lexicographically-smallest-equivalent-string lfu-cache linked-list-cycle linked-list-cycle-ii linked-list-random-node longest-common-prefix longest-common-subsequence longest-consecutive-sequence longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit longest-cycle-in-a-graph longest-increasing-subsequence longest-palindrome longest-palindrome-by-concatenating-two-letter-words longest-palindromic-substring longest-string-chain longest-subarray-of-1s-after-deleting-one-element longest-subsequence-with-limited-sum longest-substring-without-repeating-characters lowest-common-ancestor-of-a-binary-search-tree lowest-common-ancestor-of-a-binary-tree lru-cache magic-squares-in-grid majority-element make-the-string-great make-two-arrays-equal-by-reversing-subarrays max-area-of-island max-increase-to-keep-city-skyline max-number-of-k-sum-pairs max-pair-sum-in-an-array max-sum-of-rectangle-no-larger-than-k maximize-greatness-of-an-array maximize-happiness-of-selected-children maximize-the-confusion-of-an-exam maximize-win-from-two-segments maximum-69-number maximum-bags-with-full-capacity-of-rocks maximum-depth-of-binary-tree maximum-difference-between-node-and-ancestor maximum-difference-by-remapping-a-digit maximum-erasure-value maximum-ice-cream-bars maximum-length-of-repeated-subarray maximum-nesting-depth-of-the-parentheses maximum-number-of-integers-to-choose-from-a-range-i maximum-number-of-words-found-in-sentences maximum-product-of-splitted-binary-tree maximum-product-of-word-lengths maximum-score-words-formed-by-letters maximum-star-sum-of-a-graph maximum-subarray maximum-subsequence-score maximum-total-importance-of-roads maximum-twin-sum-of-a-linked-list maximum-value-of-a-string-in-an-array median-of-two-sorted-arrays merge-intervals merge-k-sorted-lists merge-nodes-in-between-zeros merge-sorted-array merge-two-2d-arrays-by-summing-values merge-two-sorted-lists middle-of-the-linked-list min-cost-climbing-stairs min-cost-to-connect-all-points min-stack minimize-deviation-in-array minimum-average-difference minimum-common-value minimum-consecutive-cards-to-pick-up minimum-cost-for-tickets minimum-cost-to-convert-string-i minimum-cost-to-hire-k-workers minimum-cost-to-move-chips-to-the-same-position minimum-deletions-to-make-string-balanced minimum-depth-of-binary-tree minimum-difference-between-largest-and-smallest-value-in-three-moves minimum-distance-between-bst-nodes minimum-falling-path-sum minimum-flips-to-make-a-or-b-equal-to-c minimum-fuel-cost-to-report-to-the-capital minimum-genetic-mutation minimum-impossible-or minimum-length-of-string-after-deleting-similar-ends minimum-number-game minimum-number-of-arrows-to-burst-balloons minimum-number-of-days-to-make-m-bouquets minimum-number-of-k-consecutive-bit-flips minimum-number-of-moves-to-seat-everyone minimum-number-of-operations-to-make-array-xor-equal-to-k minimum-number-of-operations-to-move-all-balls-to-each-box minimum-number-of-pushes-to-type-word-i minimum-number-of-pushes-to-type-word-ii minimum-number-of-vertices-to-reach-all-nodes minimum-operations-to-reduce-an-integer-to-0 minimum-path-sum minimum-recolors-to-get-k-consecutive-black-blocks minimum-rounds-to-complete-all-tasks minimum-score-by-changing-two-elements minimum-score-of-a-path-between-two-cities minimum-size-subarray-sum minimum-time-to-complete-trips minimum-time-to-make-rope-colorful minimum-time-to-repair-cars mirror-reflection missing-number most-profit-assigning-work most-stones-removed-with-same-row-or-column move-zeroes multiply-strings my-calendar-i my-calendar-iii n-ary-tree-postorder-traversal n-ary-tree-preorder-traversal n-queens n-queens-ii n-th-tribonacci-number naming-a-company neither-minimum-nor-maximum next-permutation nim-game number-complement number-of-1-bits number-of-changing-keys number-of-dice-rolls-with-target-sum number-of-distinct-averages number-of-good-leaf-nodes-pairs number-of-good-pairs number-of-islands number-of-nodes-in-the-sub-tree-with-the-same-label number-of-operations-to-make-network-connected number-of-provinces number-of-segments-in-a-string number-of-senior-citizens number-of-steps-to-reduce-a-number-in-binary-representation-to-one number-of-steps-to-reduce-a-number-to-zero number-of-students-unable-to-eat-lunch number-of-unequal-triplets-in-array number-of-ways-to-split-a-string odd-even-linked-list online-stock-span orderly-queue palindrome-linked-list palindrome-number palindrome-partitioning partition-equal-subset-sum partitioning-into-minimum-number-of-deci-binary-numbers pascals-triangle pascals-triangle-ii pass-the-pillow patching-array path-sum path-with-maximum-gold path-with-maximum-probability path-with-minimum-effort peeking-iterator perfect-squares permutation-in-string permutations permutations-ii plus-one poor-pigs populating-next-right-pointers-in-each-node populating-next-right-pointers-in-each-node-ii power-of-four power-of-three power-of-two powx-n product-of-array-except-self queries-on-number-of-points-inside-a-circle range-sum-of-bst range-sum-of-sorted-subarray-sums range-sum-query-2d-immutable range-sum-query-immutable ransom-note rearrange-array-elements-by-sign recover-binary-search-tree rectangle-area reduce-array-size-to-the-half reducing-dishes relative-ranks relative-sort-array remove-all-adjacent-duplicates-in-string remove-all-adjacent-duplicates-in-string-ii remove-digit-from-number-to-maximize-result remove-duplicates-from-sorted-array remove-duplicates-from-sorted-list remove-element remove-k-digits remove-linked-list-elements remove-nodes-from-linked-list remove-nth-node-from-end-of-list remove-palindromic-subsequences remove-stones-to-minimize-the-total reorder-routes-to-make-all-paths-lead-to-the-city-zero reordered-power-of-2 repeated-dna-sequences repeated-substring-pattern replace-elements-with-greatest-element-on-right-side replace-words reveal-cards-in-increasing-order reverse-bits reverse-integer reverse-linked-list reverse-linked-list-ii reverse-prefix-of-word reverse-string reverse-substrings-between-each-pair-of-parentheses reverse-vowels-of-a-string reverse-words-in-a-string richest-customer-wealth roman-to-integer root-equals-sum-of-children rotate-image rotting-oranges running-sum-of-1d-array same-tree score-after-flipping-matrix score-of-a-string scramble-string search-a-2d-matrix search-a-2d-matrix-ii search-in-a-binary-search-tree search-in-rotated-sorted-array search-insert-position self-dividing-numbers separate-the-digits-in-an-array set-matrix-zeroes shift-2d-grid shifting-letters-ii shortest-completing-word shortest-distance-to-a-character shortest-path-visiting-all-nodes shortest-path-with-alternating-colors shortest-unsorted-continuous-subarray shuffle-the-array sign-of-the-product-of-an-array simplify-path single-element-in-a-sorted-array single-number single-number-ii single-number-iii smallest-string-starting-from-leaf smallest-string-with-swaps sort-an-array sort-array-by-increasing-frequency sort-array-by-parity sort-characters-by-frequency sort-colors sort-the-jumbled-numbers sort-the-people special-array-with-x-elements-greater-than-or-equal-x spiral-matrix spiral-matrix-ii split-a-string-in-balanced-strings split-array-into-consecutive-subsequences split-linked-list-in-parts split-with-minimum-sum sqrtx strange-printer strictly-palindromic-number string-compression string-compression-ii string-to-integer-atoi subrectangle-queries subsequence-with-the-minimum-score subsets substring-with-largest-variance substring-xor-queries subtract-the-product-and-sum-of-digits-of-an-integer successful-pairs-of-spells-and-potions sudoku-solver sum-of-all-subset-xor-totals sum-of-left-leaves sum-of-square-numbers sum-of-subarray-minimums sum-root-to-leaf-numbers summary-ranges surrounded-regions swap-nodes-in-pairs swapping-nodes-in-a-linked-list symmetric-tree take-gifts-from-the-richest-pile task-scheduler text-justification the-number-of-beautiful-subsets third-maximum-number three-consecutive-odds time-based-key-value-store time-needed-to-buy-tickets time-needed-to-inform-all-employees time-needed-to-rearrange-a-binary-string to-lower-case toeplitz-matrix top-k-frequent-elements top-k-frequent-words transpose-matrix trapping-rain-water triangle trim-a-binary-search-tree two-sum two-sum-ii-input-array-is-sorted two-sum-iv-input-is-a-bst type-of-triangle-ii ugly-number unique-morse-code-words unique-number-of-occurrences unique-paths unique-paths-iii univalued-binary-tree valid-anagram valid-palindrome valid-palindrome-ii valid-parentheses valid-parenthesis-string valid-perfect-square valid-sudoku validate-binary-search-tree verifying-an-alien-dictionary water-bottles widest-vertical-area-between-two-points-containing-no-points word-break word-ladder-ii word-pattern word-search word-search-ii zigzag-conversion Click to show internal directories. Click to hide internal directories.