Directories ¶ Show internal Expand all Path Synopsis ADS 01knapsack convex_hull disjoint_set heap heap/max heap/min heapsort list monoqueue quicksort rabin-karp stack tree trie/arr_trie trie/map_trie adventofcode 2022/day01 2022/day02 2022/day03 2022/day04 2022/day05 2022/day06 2022/day08 2022/day12 2022/day14 2022/util codeforces 1660B 1669A 1674A 1674B 1674C 1674D 1676A 1676B 1676C 1676D 1690D 1692A 1692B 1692C 1692D 1692F 1703A 1703B 1714A 1714B 1714C 1714E 1729A 1729B 1729C 1741A 1741B 1741C 1741D 1741E 1744A 1744B 1744C 1744D 1747A 1747B 1747C 1749A 1749B 1760A 1760B 1760C 1760D 1760E 1760F 1760G 1766A 1766B 1766C 1772A 1772B 1772C 1772D 1772E 1791A 1791B 1791C 1791D 1791E 1794A 1794B 1794C 1798A 1798B 1798D 1800A 1800B 1800C1 1800C2 1800D 1800E1 1800E2 1804A 1804B 1812A 1812B contests cf-nebius-welcome-round/A cf-nebius-welcome-round/B cf-round-790/A cf-round-790/B cf-round-790/C cf-round-790/D cf-round-790/E cf-round-799/1 cf-round-799/2 cf-round-799/3 cf-round-799/4 cf-round-799/5 cf-round-799/6 cf-round-799/7 cf-round-811/1 cf-round-811/2 cf-round-811/3 cf-round-811/5 cf-round-820/1 cf-round-820/2 cf-round-820/3 cf-round-820/4 cf-round-826/1 cf-round-826/2 cf-round-826/3 cf-round-826/4 cf-round-826/5 cf-round-827/A cf-round-827/B cf-round-827/C cf-round-827/D cf-round-827/E cf-round-827/F cf-round-827/G cf-round-828/A cf-round-828/B cf-round-828/C cf-round-828/D cf-round-828/E1 cf-round-832/A cf-round-832/B cf-round-832/C cf-round-835/A cf-round-835/B cf-round-835/C cf-round-835/D cf-round-835/E cf-round-835/F cf-round-835/G cf-round-839/A cf-round-839/B cf-round-839/C cf-round-839/D cf-round-839/E cf-round-839/F cf-round-839/G cf-round-842/A cf-round-842/B cf-round-842/C cf-round-842/D cf-round-855/A cf-round-855/B cf-round-855/C1 cf-round-855/C2 cf-round-855/D cf-round-855/E1 cf-round-855/E2 cf-round-855/F cf-round-856/A cf-round-856/B cf-round-856/C cf-round-856/D cf-round-856/E cf-round-856/F cf-round-860/A cf-round-860/B cf-round-860/D edu-cf-round-139/A edu-cf-round-139/B edu-cf-round-139/C lc-biweekly-100/1 lc-biweekly-100/2 lc-biweekly-100/4 lc-biweekly-101/1 lc-biweekly-101/2 lc-biweekly-77 lc-biweekly-85 lc-biweekly-98/1 lc-biweekly-98/2 lc-biweekly-98/3 lc-biweekly-99/1 lc-biweekly-99/2 lc-biweekly-99/3 lc-biweekly-99/4 lc-weekly-290 lc-weekly-291 lc-weekly-320 lc-weekly-321 lc-weekly-322/1 lc-weekly-322/2 lc-weekly-322/3 lc-weekly-322/4 lc-weekly-332/1 lc-weekly-332/2 lc-weekly-332/3 lc-weekly-333/1 lc-weekly-333/2 leetcode 01-matrix 1-bit-and-2-bit-characters 132-pattern 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 backspace-string-compare bag-of-tokens 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 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-subarrays-where-max-element-appears-at-least-k-times count-subarrays-with-fixed-bounds count-tested-devices-after-test-operations count-the-number-of-fair-pairs count-the-number-of-incremovable-subarrays-i count-total-number-of-colored-cells 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 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-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-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-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-pivot-integer find-the-substring-with-maximum-cost first-bad-version first-unique-character-in-a-string fizz-buzz flatten-nested-list-iterator flood-fill form-smallest-number-from-two-digit-arrays frog-jump-ii fruit-into-baskets furthest-point-from-origin game-of-life gas-station generate-parentheses greatest-common-divisor-of-strings group-anagrams group-the-people-given-the-group-size-they-belong-to guess-number-higher-or-lower hamming-distance 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-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-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 majority-element make-the-string-great 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-star-sum-of-a-graph maximum-subarray maximum-subsequence-score 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-hire-k-workers minimum-cost-to-move-chips-to-the-same-position minimum-depth-of-binary-tree 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-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-stones-removed-with-same-row-or-column move-zeroes multiply-strings my-calendar-i my-calendar-iii 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-of-1-bits number-of-changing-keys number-of-dice-rolls-with-target-sum number-of-distinct-averages 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-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 path-sum path-with-maximum-gold 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-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 reveal-cards-in-increasing-order reverse-bits reverse-integer reverse-linked-list reverse-linked-list-ii reverse-prefix-of-word reverse-string 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 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-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 smallest-string-starting-from-leaf smallest-string-with-swaps sort-an-array sort-array-by-parity sort-characters-by-frequency sort-colors spiral-matrix spiral-matrix-ii split-a-string-in-balanced-strings split-array-into-consecutive-subsequences split-with-minimum-sum sqrtx 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-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 third-maximum-number 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 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 widest-vertical-area-between-two-points-containing-no-points word-break word-ladder-ii word-pattern word-search word-search-ii zigzag-conversion tools templates yandex backend_contest/1 backend_contest/2 backend_contest/3 backend_contest/4 backend_contest/5 backend_contest/6 Click to show internal directories. Click to hide internal directories.