Showing preview only (7,399K chars total). Download the full file or copy to clipboard to get everything.
Repository: hogan-tech/leetcode-solution
Branch: main
Commit: 46f0be8dc5df
Files: 3835
Total size: 6.3 MB
Directory structure:
gitextract_mc96q52d/
├── .github/
│ ├── FUNDING.yml
│ ├── scripts/
│ │ └── update_leetcode.cjs
│ ├── test.txt
│ └── workflows/
│ └── python-publish.yml
├── .vscode/
│ └── settings.json
├── C++/
│ ├── 0002-add-two-numbers.cpp
│ ├── 0003-longest-substring-without-repeating-characters.cpp
│ ├── 0009-palindrome-number.cpp
│ ├── 0013-roman-to-integer.cpp
│ ├── 0014-longest-common-prefix.cpp
│ ├── 0015-3sum.cpp
│ ├── 0019-remove-nth-node-from-end-of-list.cpp
│ ├── 0020-valid-parentheses.cpp
│ ├── 0021-merge-two-sorted-lists.cpp
│ ├── 0035-search-insert-position.cpp
│ ├── 0036-valid-sudoku.cpp
│ ├── 0045-jump-game-ii.cpp
│ ├── 0046-permutations.cpp
│ ├── 0048-rotate-image.cpp
│ ├── 0054-spiral-matrix.cpp
│ ├── 0055-jump-game.cpp
│ ├── 0056-merge-intervals.cpp
│ ├── 0059-spiral-matrix-ii.cpp
│ ├── 0070-climbing-stairs.cpp
│ ├── 0074-search-a-2d-matrix.cpp
│ ├── 0075-sort-colors.cpp
│ ├── 0077-combinations.cpp
│ ├── 0083-remove-duplicates-from-sorted-list.cpp
│ ├── 0088-merge-sorted-array.cpp
│ ├── 0094-binary-tree-inorder-traversal.cpp
│ ├── 0098-validate-binary-search-tree.cpp
│ ├── 0101-symmetric-tree.cpp
│ ├── 0102-binary-tree-level-order-traversal.cpp
│ ├── 0104-maximum-depth-of-binary-tree.cpp
│ ├── 0112-path-sum.cpp
│ ├── 0116-populating-next-right-pointers-in-each-node.cpp
│ ├── 0118-pascals-triangle.cpp
│ ├── 0119-pascals-triangle-ii.cpp
│ ├── 0120-triangle.cpp
│ ├── 0121-best-time-to-buy-and-sell-stock.cpp
│ ├── 0136-single-number.cpp
│ ├── 0141-linked-list-cycle.cpp
│ ├── 0144-binary-tree-preorder-traversal.cpp
│ ├── 0145-binary-tree-postorder-traversal.cpp
│ ├── 0167-two-sum-ii-input-array-is-sorted.cpp
│ ├── 0169-majority-element.cpp
│ ├── 0189-rotate-array.cpp
│ ├── 0190-reverse-bits.cpp
│ ├── 0191-number-of-1-bits.cpp
│ ├── 0198-house-robber.cpp
│ ├── 0203-remove-linked-list-elements.cpp
│ ├── 0206-reverse-linked-list.cpp
│ ├── 0213-house-robber-ii.cpp
│ ├── 0217-contains-duplicate.cpp
│ ├── 0231-power-of-two.cpp
│ ├── 0232-implement-queue-using-stacks.cpp
│ ├── 0235-lowest-common-ancestor-of-a-binary-search-tree.cpp
│ ├── 0242-valid-anagram.cpp
│ ├── 0278-first-bad-version.cpp
│ ├── 0283-move-zeroes.cpp
│ ├── 0344-reverse-string.cpp
│ ├── 0350-intersection-of-two-arrays-ii.cpp
│ ├── 0383-ransom-note.cpp
│ ├── 0387-first-unique-character-in-a-string.cpp
│ ├── 0509-fibonacci-number.cpp
│ ├── 0542-01-matrix.cpp
│ ├── 0557-reverse-words-in-a-string-iii.cpp
│ ├── 0566-reshape-the-matrix.cpp
│ ├── 0567-permutation-in-string.cpp
│ ├── 0617-merge-two-binary-trees.cpp
│ ├── 0653-two-sum-iv-input-is-a-bst.cpp
│ ├── 0695-max-area-of-island.cpp
│ ├── 0700-search-in-a-binary-search-tree.cpp
│ ├── 0701-insert-into-a-binary-search-tree.cpp
│ ├── 0704-binary-search.cpp
│ ├── 0706-design-hashmap.cpp
│ ├── 0733-flood-fill.cpp
│ ├── 0746-min-cost-climbing-stairs.cpp
│ ├── 0784-letter-case-permutation.cpp
│ ├── 0876-middle-of-the-linked-list.cpp
│ ├── 0977-squares-of-a-sorted-array.cpp
│ ├── 0994-rotting-oranges.cpp
│ ├── 1137-n-th-tribonacci-number.cpp
│ ├── 1265-print-immutable-linked-list-in-reverse.cpp
│ └── 1920-build-array-from-permutation.cpp
├── CODE_OF_CONDUCT.md
├── JavaScript/
│ ├── 0020-valid-parentheses.js
│ ├── 0021-merge-two-sorted-lists.js
│ ├── 0049-group-anagrams.js
│ ├── 0074-search-a-2d-matrix.js
│ ├── 0078-subsets.js
│ ├── 0094-binary-tree-inorder-traversal.js
│ ├── 0100-same-tree.js
│ ├── 0104-maximum-depth-of-binary-tree.js
│ ├── 0121-best-time-to-buy-and-sell-stock.js
│ ├── 0141-linked-list-cycle.js
│ ├── 0144-binary-tree-preorder-traversal.js
│ ├── 0145-binary-tree-postorder-traversal.js
│ ├── 0153-find-minimum-in-rotated-sorted-array.js
│ ├── 0206-reverse-linked-list.js
│ ├── 0217-contains-duplicate.js
│ ├── 0226-invert-binary-tree.js
│ ├── 0242-valid-anagram.js
│ ├── 0506-relative-ranks.js
│ ├── 0572-subtree-of-another-tree.js
│ ├── 0704-binary-search.js
│ ├── 0994-rotting-oranges.js
│ ├── 2619-array-prototype-last.js
│ ├── 2620-counter.js
│ ├── 2621-sleep.js
│ ├── 2622-cache-with-time-limit.js
│ ├── 2623-memoize.js
│ ├── 2625-flatten-deeply-nested-array.js
│ ├── 2626-array-reduce-transformation.js
│ ├── 2627-debounce.js
│ ├── 2628-json-deep-equal.js
│ ├── 2629-function-composition.js
│ ├── 2631-group-by.js
│ ├── 2632-curry.js
│ ├── 2633-convert-object-to-json-string.js
│ ├── 2634-filter-elements-from-array.js
│ ├── 2635-apply-transform-over-each-element-in-array.js
│ ├── 2636-promise-pool.js
│ ├── 2637-promise-time-limit.js
│ ├── 2665-counter-ii.js
│ ├── 2666-allow-one-function-call.js
│ ├── 2667-create-hello-world-function.js
│ ├── 2676-throttle.js
│ ├── 2677-chunk-array.js
│ ├── 2694-event-emitter.js
│ ├── 2695-array-wrapper.js
│ ├── 2703-return-length-of-arguments-passed.js
│ ├── 2704-to-be-or-not-to-be.js
│ ├── 2705-compact-object.js
│ ├── 2715-execute-cancellable-function-with-delay.js
│ ├── 2721-execute-asynchronous-functions-in-parallel.js
│ ├── 2722-join-two-arrays-by-id.js
│ ├── 2723-add-two-promises.js
│ ├── 2724-sort-by.js
│ ├── 2725-interval-cancellation.js
│ ├── 2726-calculator-with-method-chaining.js
│ └── 2727-is-object-empty.js
├── LICENSE
├── Python/
│ ├── 0001-two-sum.py
│ ├── 0002-add-two-numbers.py
│ ├── 0003-longest-substring-without-repeating-characters.py
│ ├── 0004-median-of-two-sorted-arrays.py
│ ├── 0005-longest-palindromic-substring.py
│ ├── 0006-zigzag-conversion.py
│ ├── 0007-reverse-integer.py
│ ├── 0008-string-to-integer-atoi.py
│ ├── 0010-regular-expression-matching.py
│ ├── 0011-container-with-most-water.py
│ ├── 0012-integer-to-roman.py
│ ├── 0013-roman-to-integer.py
│ ├── 0014-longest-common-prefix.py
│ ├── 0015-3sum.py
│ ├── 0016-3sum-closest.py
│ ├── 0017-letter-combinations-of-a-phone-number.py
│ ├── 0018-4sum.py
│ ├── 0019-remove-nth-node-from-end-of-list.py
│ ├── 0020-valid-parentheses.py
│ ├── 0021-merge-two-sorted-lists.py
│ ├── 0022-generate-parentheses.py
│ ├── 0023-merge-k-sorted-lists.py
│ ├── 0024-swap-nodes-in-pairs.py
│ ├── 0025-reverse-nodes-in-k-group.py
│ ├── 0026-remove-duplicates-from-sorted-array.py
│ ├── 0027-remove-element.py
│ ├── 0028-find-the-index-of-the-first-occurrence-in-a-string.py
│ ├── 0029-divide-two-integers.py
│ ├── 0030-substring-with-concatenation-of-all-words.py
│ ├── 0031-next-permutation.py
│ ├── 0032-longest-valid-parentheses.py
│ ├── 0033-search-in-rotated-sorted-array.py
│ ├── 0034-find-first-and-last-position-of-element-in-sorted-array.py
│ ├── 0035-search-insert-position.py
│ ├── 0036-valid-sudoku.py
│ ├── 0037-sudoku-solver.py
│ ├── 0038-count-and-say.py
│ ├── 0039-combination-sum.py
│ ├── 0040-combination-sum-ii.py
│ ├── 0041-first-missing-positive.py
│ ├── 0042-trapping-rain-water.py
│ ├── 0043-multiply-strings.py
│ ├── 0044-wildcard-matching.py
│ ├── 0045-jump-game-ii.py
│ ├── 0046-permutations.py
│ ├── 0047-permutations-ii.py
│ ├── 0048-rotate-image.py
│ ├── 0049-group-anagrams.py
│ ├── 0050-powx-n.py
│ ├── 0051-n-queens.py
│ ├── 0052-n-queens-ii.py
│ ├── 0053-maximum-subarray.py
│ ├── 0054-spiral-matrix.py
│ ├── 0055-jump-game.py
│ ├── 0056-merge-intervals.py
│ ├── 0057-insert-interval.py
│ ├── 0058-length-of-last-word.py
│ ├── 0059-spiral-matrix-ii.py
│ ├── 0061-rotate-list.py
│ ├── 0062-unique-paths.py
│ ├── 0063-unique-paths-ii.py
│ ├── 0064-minimum-path-sum.py
│ ├── 0066-plus-one.py
│ ├── 0067-add-binary.py
│ ├── 0068-text-justification.py
│ ├── 0069-sqrtx.py
│ ├── 0070-climbing-stairs.py
│ ├── 0071-simplify-path.py
│ ├── 0072-edit-distance.py
│ ├── 0073-set-matrix-zeroes.py
│ ├── 0074-search-a-2d-matrix.py
│ ├── 0075-sort-colors.py
│ ├── 0076-minimum-window-substring.py
│ ├── 0077-combinations.py
│ ├── 0078-subsets.py
│ ├── 0079-word-search.py
│ ├── 0080-remove-duplicates-from-sorted-array-ii.py
│ ├── 0081-search-in-rotated-sorted-array-ii.py
│ ├── 0082-remove-duplicates-from-sorted-list-ii.py
│ ├── 0083-remove-duplicates-from-sorted-list.py
│ ├── 0084-largest-rectangle-in-histogram.py
│ ├── 0085-maximal-rectangle.py
│ ├── 0086-partition-list.py
│ ├── 0087-scramble-string.py
│ ├── 0088-merge-sorted-array.py
│ ├── 0089-gray-code.py
│ ├── 0090-subsets-ii.py
│ ├── 0091-decode-ways.py
│ ├── 0092-reverse-linked-list-ii.py
│ ├── 0093-restore-ip-addresses.py
│ ├── 0095-unique-binary-search-trees-ii.py
│ ├── 0096-unique-binary-search-trees.py
│ ├── 0097-interleaving-string.py
│ ├── 0098-validate-binary-search-tree.py
│ ├── 0099-recover-binary-search-tree.py
│ ├── 0100-same-tree.py
│ ├── 0101-symmetric-tree.py
│ ├── 0102-binary-tree-level-order-traversal.py
│ ├── 0103-binary-tree-zigzag-level-order-traversal.py
│ ├── 0104-maximum-depth-of-binary-tree.py
│ ├── 0105-construct-binary-tree-from-preorder-and-inorder-traversal.py
│ ├── 0106-construct-binary-tree-from-inorder-and-postorder-traversal.py
│ ├── 0107-binary-tree-level-order-traversal-ii.py
│ ├── 0108-convert-sorted-array-to-binary-search-tree.py
│ ├── 0110-balanced-binary-tree.py
│ ├── 0111-minimum-depth-of-binary-tree.py
│ ├── 0112-path-sum.py
│ ├── 0113-path-sum-ii.py
│ ├── 0114-flatten-binary-tree-to-linked-list.py
│ ├── 0115-distinct-subsequences.py
│ ├── 0116-populating-next-right-pointers-in-each-node.py
│ ├── 0117-populating-next-right-pointers-in-each-node-ii.py
│ ├── 0118-pascals-triangle.py
│ ├── 0119-pascals-triangle-ii.py
│ ├── 0120-triangle.py
│ ├── 0121-best-time-to-buy-and-sell-stock.py
│ ├── 0122-best-time-to-buy-and-sell-stock-ii.py
│ ├── 0123-best-time-to-buy-and-sell-stock-iii.py
│ ├── 0124-binary-tree-maximum-path-sum.py
│ ├── 0125-valid-palindrome.py
│ ├── 0126-word-ladder-ii.py
│ ├── 0127-word-ladder.py
│ ├── 0128-longest-consecutive-sequence.py
│ ├── 0129-sum-root-to-leaf-numbers.py
│ ├── 0130-surrounded-regions.py
│ ├── 0131-palindrome-partitioning.py
│ ├── 0132-palindrome-partitioning-ii.py
│ ├── 0133-clone-graph.py
│ ├── 0134-gas-station.py
│ ├── 0135-candy.py
│ ├── 0136-single-number.py
│ ├── 0137-single-number-ii.py
│ ├── 0138-copy-list-with-random-pointer.py
│ ├── 0139-word-break.py
│ ├── 0140-word-break-ii.py
│ ├── 0141-linked-list-cycle.py
│ ├── 0142-linked-list-cycle-ii.py
│ ├── 0143-reorder-list.py
│ ├── 0145-binary-tree-postorder-traversal.py
│ ├── 0146-lru-cache.py
│ ├── 0148-sort-list.py
│ ├── 0149-max-points-on-a-line.py
│ ├── 0150-evaluate-reverse-polish-notation.py
│ ├── 0151-reverse-words-in-a-string.py
│ ├── 0152-maximum-product-subarray.py
│ ├── 0153-find-minimum-in-rotated-sorted-array.py
│ ├── 0155-min-stack.py
│ ├── 0159-longest-substring-with-at-most-two-distinct-characters.py
│ ├── 0160-intersection-of-two-linked-lists.py
│ ├── 0162-find-peak-element.py
│ ├── 0165-compare-version-numbers.py
│ ├── 0166-fraction-to-recurring-decimal.py
│ ├── 0167-two-sum-ii-input-array-is-sorted.py
│ ├── 0168-excel-sheet-column-title.py
│ ├── 0169-majority-element.py
│ ├── 0170-two-sum-iii-data-structure-design.py
│ ├── 0172-factorial-trailing-zeroes.py
│ ├── 0173-binary-search-tree-iterator.py
│ ├── 0179-largest-number.py
│ ├── 0187-repeated-dna-sequences.py
│ ├── 0188-best-time-to-buy-and-sell-stock-iv.py
│ ├── 0190-reverse-bits.py
│ ├── 0191-number-of-1-bits.py
│ ├── 0198-house-robber.py
│ ├── 0199-binary-tree-right-side-view.py
│ ├── 0200-number-of-islands.py
│ ├── 0201-bitwise-and-of-numbers-range.py
│ ├── 0202-happy-number.py
│ ├── 0203-remove-linked-list-elements.py
│ ├── 0205-isomorphic-strings.py
│ ├── 0206-reverse-linked-list.py
│ ├── 0207-course-schedule.py
│ ├── 0208-implement-trie-prefix-tree.py
│ ├── 0209-minimum-size-subarray-sum.py
│ ├── 0210-course-schedule-ii.py
│ ├── 0211-design-add-and-search-words-data-structure.py
│ ├── 0212-word-search-ii.py
│ ├── 0213-house-robber-ii.py
│ ├── 0214-shortest-palindrome.py
│ ├── 0215-kth-largest-element-in-an-array.py
│ ├── 0216-combination-sum-iii.py
│ ├── 0217-contains-duplicate.py
│ ├── 0218-the-skyline-problem.py
│ ├── 0219-contains-duplicate-ii.py
│ ├── 0221-maximal-square.py
│ ├── 0222-count-complete-tree-nodes.py
│ ├── 0224-basic-calculator.py
│ ├── 0225-implement-stack-using-queues.py
│ ├── 0226-invert-binary-tree.py
│ ├── 0227-basic-calculator-ii.py
│ ├── 0228-summary-ranges.py
│ ├── 0229-majority-element-ii.py
│ ├── 0230-kth-smallest-element-in-a-bst.py
│ ├── 0231-power-of-two.py
│ ├── 0232-implement-queue-using-stacks.py
│ ├── 0234-palindrome-linked-list.py
│ ├── 0235-lowest-common-ancestor-of-a-binary-search-tree.py
│ ├── 0236-lowest-common-ancestor-of-a-binary-tree.py
│ ├── 0237-delete-node-in-a-linked-list.py
│ ├── 0238-product-of-array-except-self.py
│ ├── 0239-sliding-window-maximum.py
│ ├── 0240-search-a-2d-matrix-ii.py
│ ├── 0241-different-ways-to-add-parentheses.py
│ ├── 0242-valid-anagram.py
│ ├── 0244-shortest-word-distance-ii.py
│ ├── 0246-strobogrammatic-number.py
│ ├── 0249-group-shifted-strings.py
│ ├── 0250-count-univalue-subtrees.py
│ ├── 0252-meeting-rooms.py
│ ├── 0253-meeting-rooms-ii.py
│ ├── 0254-factor-combinations.py
│ ├── 0255-verify-preorder-sequence-in-binary-search-tree.py
│ ├── 0256-paint-house.py
│ ├── 0257-binary-tree-paths.py
│ ├── 0259-3sum-smaller.py
│ ├── 0260-single-number-iii.py
│ ├── 0261-graph-valid-tree.py
│ ├── 0263-ugly-number.py
│ ├── 0264-ugly-number-ii.py
│ ├── 0265-paint-house-ii.py
│ ├── 0266-palindrome-permutation.py
│ ├── 0268-missing-number.py
│ ├── 0269-alien-dictionary.py
│ ├── 0270-closest-binary-search-tree-value.py
│ ├── 0271-encode-and-decode-strings.py
│ ├── 0272-closest-binary-search-tree-value-ii.py
│ ├── 0273-integer-to-english-words.py
│ ├── 0274-h-index.py
│ ├── 0276-paint-fence.py
│ ├── 0277-find-the-celebrity.py
│ ├── 0278-first-bad-version.py
│ ├── 0279-perfect-squares.py
│ ├── 0283-move-zeroes.py
│ ├── 0285-inorder-successor-in-bst.py
│ ├── 0286-walls-and-gates.py
│ ├── 0287-find-the-duplicate-number.py
│ ├── 0289-game-of-life.py
│ ├── 0290-word-pattern.py
│ ├── 0291-word-pattern-ii.py
│ ├── 0293-flip-game.py
│ ├── 0295-find-median-from-data-stream.py
│ ├── 0296-best-meeting-point.py
│ ├── 0297-serialize-and-deserialize-binary-tree.py
│ ├── 0298-binary-tree-longest-consecutive-sequence.py
│ ├── 0299-bulls-and-cows.py
│ ├── 0300-longest-increasing-subsequence.py
│ ├── 0301-remove-invalid-parentheses.py
│ ├── 0302-smallest-rectangle-enclosing-black-pixels.py
│ ├── 0303-range-sum-query-immutable.py
│ ├── 0304-range-sum-query-2d-immutable.py
│ ├── 0305-number-of-islands-ii.py
│ ├── 0307-range-sum-query-mutable.py
│ ├── 0309-best-time-to-buy-and-sell-stock-with-cooldown.py
│ ├── 0310-minimum-height-trees.py
│ ├── 0311-sparse-matrix-multiplication.py
│ ├── 0312-burst-balloons.py
│ ├── 0314-binary-tree-vertical-order-traversal.py
│ ├── 0315-count-of-smaller-numbers-after-self.py
│ ├── 0316-remove-duplicate-letters.py
│ ├── 0317-shortest-distance-from-all-buildings.py
│ ├── 0320-generalized-abbreviation.py
│ ├── 0322-coin-change.py
│ ├── 0323-number-of-connected-components-in-an-undirected-graph.py
│ ├── 0325-maximum-size-subarray-sum-equals-k.py
│ ├── 0326-power-of-three.py
│ ├── 0327-count-of-range-sum.py
│ ├── 0328-odd-even-linked-list.py
│ ├── 0329-longest-increasing-path-in-a-matrix.py
│ ├── 0330-patching-array.py
│ ├── 0331-verify-preorder-serialization-of-a-binary-tree.py
│ ├── 0332-reconstruct-itinerary.py
│ ├── 0333-largest-bst-subtree.py
│ ├── 0334-increasing-triplet-subsequence.py
│ ├── 0337-house-robber-iii.py
│ ├── 0338-counting-bits.py
│ ├── 0339-nested-list-weight-sum.py
│ ├── 0340-longest-substring-with-at-most-k-distinct-characters.py
│ ├── 0341-flatten-nested-list-iterator.py
│ ├── 0342-power-of-four.py
│ ├── 0343-integer-break.py
│ ├── 0344-reverse-string.py
│ ├── 0345-reverse-vowels-of-a-string.py
│ ├── 0346-moving-average-from-data-stream.py
│ ├── 0347-top-k-frequent-elements.py
│ ├── 0348-design-tic-tac-toe.py
│ ├── 0349-intersection-of-two-arrays.py
│ ├── 0350-intersection-of-two-arrays-ii.py
│ ├── 0351-android-unlock-patterns.py
│ ├── 0352-data-stream-as-disjoint-intervals.py
│ ├── 0353-domino-and-tromino-tiling.py
│ ├── 0354-russian-doll-envelopes.py
│ ├── 0355-design-twitter.py
│ ├── 0358-rearrange-string-k-distance-apart.py
│ ├── 0359-logger-rate-limiter.py
│ ├── 0361-bomb-enemy.py
│ ├── 0362-design-hit-counter.py
│ ├── 0364-nested-list-weight-sum-ii.py
│ ├── 0366-find-leaves-of-binary-tree.py
│ ├── 0368-largest-divisible-subset.py
│ ├── 0370-range-addition.py
│ ├── 0371-sum-of-two-integers.py
│ ├── 0373-find-k-pairs-with-smallest-sums.py
│ ├── 0374-guess-number-higher-or-lower.py
│ ├── 0377-combination-sum-iv.py
│ ├── 0378-kth-smallest-element-in-a-sorted-matrix.py
│ ├── 0380-insert-delete-getrandom-o1.py
│ ├── 0383-ransom-note.py
│ ├── 0386-lexicographical-numbers.py
│ ├── 0387-first-unique-character-in-a-string.py
│ ├── 0388-longest-absolute-file-path.py
│ ├── 0389-find-the-difference.py
│ ├── 0390-elimination-game.py
│ ├── 0391-perfect-rectangle.py
│ ├── 0392-is-subsequence.py
│ ├── 0393-utf-8-validation.py
│ ├── 0394-decode-string.py
│ ├── 0395-longest-substring-with-at-least-k-repeating-characters.py
│ ├── 0396-rotate-function.py
│ ├── 0397-integer-replacement.py
│ ├── 0398-random-pick-index.py
│ ├── 0399-evaluate-division.py
│ ├── 0400-nth-digit.py
│ ├── 0401-binary-watch.py
│ ├── 0402-remove-k-digits.py
│ ├── 0403-frog-jump.py
│ ├── 0404-sum-of-left-leaves.py
│ ├── 0405-convert-a-number-to-hexadecimal.py
│ ├── 0406-queue-reconstruction-by-height.py
│ ├── 0407-trapping-rain-water-ii.py
│ ├── 0408-valid-word-abbreviation.py
│ ├── 0409-longest-palindrome.py
│ ├── 0410-split-array-largest-sum.py
│ ├── 0414-third-maximum-number.py
│ ├── 0416-partition-equal-subset-sum.py
│ ├── 0417-pacific-atlantic-water-flow.py
│ ├── 0424-longest-repeating-character-replacement.py
│ ├── 0425-word-squares.py
│ ├── 0426-convert-binary-search-tree-to-sorted-doubly-linked-list.py
│ ├── 0427-construct-quad-tree.py
│ ├── 0432-all-oone-data-structure.py
│ ├── 0433-minimum-genetic-mutation.py
│ ├── 0435-non-overlapping-intervals.py
│ ├── 0436-find-right-interval.py
│ ├── 0437-path-sum-iii.py
│ ├── 0438-find-all-anagrams-in-a-string.py
│ ├── 0439-ternary-expression-parser.py
│ ├── 0440-k-th-smallest-in-lexicographical-order.py
│ ├── 0442-find-all-duplicates-in-an-array.py
│ ├── 0443-string-compression.py
│ ├── 0444-sequence-reconstruction.py
│ ├── 0445-add-two-numbers-ii.py
│ ├── 0446-arithmetic-slices-ii-subsequence.py
│ ├── 0448-find-all-numbers-disappeared-in-an-array.py
│ ├── 0449-serialize-and-deserialize-bst.py
│ ├── 0450-delete-node-in-a-bst.py
│ ├── 0451-sort-characters-by-frequency.py
│ ├── 0452-minimum-number-of-arrows-to-burst-balloons.py
│ ├── 0455-assign-cookies.py
│ ├── 0456-132-pattern.py
│ ├── 0457-circular-array-loop.py
│ ├── 0458-poor-pigs.py
│ ├── 0459-repeated-substring-pattern.py
│ ├── 0460-lfu-cache.py
│ ├── 0463-island-perimeter.py
│ ├── 0465-optimal-account-balancing.py
│ ├── 0473-matchsticks-to-square.py
│ ├── 0474-ones-and-zeroes.py
│ ├── 0475-heaters.py
│ ├── 0476-number-complement.py
│ ├── 0485-max-consecutive-ones.py
│ ├── 0486-predict-the-winner.py
│ ├── 0487-max-consecutive-ones-ii.py
│ ├── 0489-robot-room-cleaner.py
│ ├── 0490-the-maze.py
│ ├── 0491-non-decreasing-subsequences.py
│ ├── 0493-reverse-pairs.py
│ ├── 0494-target-sum.py
│ ├── 0496-next-greater-element-i.py
│ ├── 0498-diagonal-traverse.py
│ ├── 0499-the-maze-iii.py
│ ├── 0501-find-mode-in-binary-search-tree.py
│ ├── 0502-ipo.py
│ ├── 0505-the-maze-ii.py
│ ├── 0506-relative-ranks.py
│ ├── 0509-fibonacci-number.py
│ ├── 0510-inorder-successor-in-bst-ii.py
│ ├── 0513-find-bottom-left-tree-value.py
│ ├── 0514-freedom-trail.py
│ ├── 0515-find-largest-value-in-each-tree-row.py
│ ├── 0516-longest-palindromic-subsequence.py
│ ├── 0518-coin-change-ii.py
│ ├── 0523-continuous-subarray-sum.py
│ ├── 0525-contiguous-array.py
│ ├── 0527-word-abbreviation.py
│ ├── 0528-random-pick-with-weight.py
│ ├── 0530-minimum-absolute-difference-in-bst.py
│ ├── 0532-k-diff-pairs-in-an-array.py
│ ├── 0539-minimum-time-difference.py
│ ├── 0540-single-element-in-a-sorted-array.py
│ ├── 0542-01-matrix.py
│ ├── 0543-diameter-of-binary-tree.py
│ ├── 0545-boundary-of-binary-tree.py
│ ├── 0547-number-of-provinces.py
│ ├── 0549-binary-tree-longest-consecutive-sequence-ii.py
│ ├── 0552-student-attendance-record-ii.py
│ ├── 0560-subarray-sum-equals-k.py
│ ├── 0561-array-partition.py
│ ├── 0564-find-the-closest-palindrome.py
│ ├── 0567-permutation-in-string.py
│ ├── 0572-subtree-of-another-tree.py
│ ├── 0573-squirrel-simulation.py
│ ├── 0576-out-of-boundary-paths.py
│ ├── 0588-design-in-memory-file-system.py
│ ├── 0590-n-ary-tree-postorder-traversal.py
│ ├── 0592-fraction-addition-and-subtraction.py
│ ├── 0594-longest-harmonious-subsequence.py
│ ├── 0605-can-place-flowers.py
│ ├── 0606-construct-string-from-binary-tree.py
│ ├── 0609-find-duplicate-file-in-system.py
│ ├── 0611-valid-triangle-number.py
│ ├── 0616-add-bold-tag-in-string.py
│ ├── 0621-task-scheduler.py
│ ├── 0623-add-one-row-to-tree.py
│ ├── 0624-maximum-distance-in-arrays.py
│ ├── 0629-k-inverse-pairs-array.py
│ ├── 0632-smallest-range-covering-elements-from-k-lists.py
│ ├── 0633-sum-of-square-numbers.py
│ ├── 0636-exclusive-time-of-functions.py
│ ├── 0637-average-of-levels-in-binary-tree.py
│ ├── 0641-design-circular-deque.py
│ ├── 0643-maximum-average-subarray-i.py
│ ├── 0645-set-mismatch.py
│ ├── 0646-maximum-length-of-pair-chain.py
│ ├── 0647-palindromic-substrings.py
│ ├── 0648-replace-words.py
│ ├── 0649-dota2-senate.py
│ ├── 0650-2-keys-keyboard.py
│ ├── 0653-two-sum-iv-input-is-a-bst.py
│ ├── 0656-coin-path.py
│ ├── 0658-find-k-closest-elements.py
│ ├── 0661-image-smoother.py
│ ├── 0662-maximum-width-of-binary-tree.py
│ ├── 0663-equal-tree-partition.py
│ ├── 0664-strange-printer.py
│ ├── 0666-path-sum-iv.py
│ ├── 0670-maximum-swap.py
│ ├── 0677-map-sum-pairs.py
│ ├── 0678-valid-parenthesis-string.py
│ ├── 0679-24-game.py
│ ├── 0680-valid-palindrome-ii.py
│ ├── 0683-k-empty-slots.py
│ ├── 0684-redundant-connection.py
│ ├── 0689-maximum-sum-of-3-non-overlapping-subarrays.py
│ ├── 0692-top-k-frequent-words.py
│ ├── 0694-number-of-distinct-islands.py
│ ├── 0695-max-area-of-island.py
│ ├── 0702-search-in-a-sorted-array-of-unknown-size.py
│ ├── 0703-kth-largest-element-in-a-stream.py
│ ├── 0704-binary-search.py
│ ├── 0705-design-hashset.py
│ ├── 0706-design-hashmap.py
│ ├── 0712-minimum-ascii-delete-sum-for-two-strings.py
│ ├── 0713-subarray-product-less-than-k.py
│ ├── 0714-best-time-to-buy-and-sell-stock-with-transaction-fee.py
│ ├── 0715-range-module.py
│ ├── 0716-max-stack.py
│ ├── 0717-1-bit-and-2-bit-characters.py
│ ├── 0718-maximum-length-of-repeated-subarray.py
│ ├── 0719-find-k-th-smallest-pair-distance.py
│ ├── 0721-accounts-merge.py
│ ├── 0723-candy-crush.py
│ ├── 0724-find-pivot-index.py
│ ├── 0725-split-linked-list-in-parts.py
│ ├── 0726-number-of-atoms.py
│ ├── 0727-minimum-window-subsequence.py
│ ├── 0729-my-calendar-i.py
│ ├── 0731-my-calendar-ii.py
│ ├── 0733-flood-fill.py
│ ├── 0734-sentence-similarity.py
│ ├── 0735-asteroid-collision.py
│ ├── 0737-sentence-similarity-ii.py
│ ├── 0739-daily-temperatures.py
│ ├── 0740-delete-and-earn.py
│ ├── 0741-cherry-pickup.py
│ ├── 0743-network-delay-time.py
│ ├── 0744-find-smallest-letter-greater-than-target.py
│ ├── 0746-min-cost-climbing-stairs.py
│ ├── 0752-open-the-lock.py
│ ├── 0756-pyramid-transition-matrix.py
│ ├── 0757-set-intersection-size-at-least-two.py
│ ├── 0758-bold-words-in-string.py
│ ├── 0759-employee-free-time.py
│ ├── 0763-partition-labels.py
│ ├── 0767-reorganize-string.py
│ ├── 0768-partition-labels.py
│ ├── 0769-max-chunks-to-make-sorted.py
│ ├── 0773-sliding-puzzle.py
│ ├── 0774-minimize-max-distance-to-gas-station.py
│ ├── 0775-global-and-local-inversions.py
│ ├── 0776-split-bst.py
│ ├── 0778-swim-in-rising-water.py
│ ├── 0779-k-th-symbol-in-grammar.py
│ ├── 0781-rabbits-in-forest.py
│ ├── 0786-k-th-smallest-prime-fraction.py
│ ├── 0787-cheapest-flights-within-k-stops.py
│ ├── 0790-domino-and-tromino-tiling.py
│ ├── 0791-custom-sort-string.py
│ ├── 0794-valid-tic-tac-toe-state.py
│ ├── 0796-rotate-string.py
│ ├── 0797-all-paths-from-source-to-target.py
│ ├── 0799-champagne-tower.py
│ ├── 0802-find-eventual-safe-states.py
│ ├── 0807-max-increase-to-keep-city-skyline.py
│ ├── 0808-soup-servings.py
│ ├── 0812-largest-triangle-area.py
│ ├── 0814-binary-tree-pruning.py
│ ├── 0815-bus-routes.py
│ ├── 0817-linked-list-components.py
│ ├── 0823-binary-trees-with-factors.py
│ ├── 0826-most-profit-assigning-work.py
│ ├── 0827-making-a-large-island.py
│ ├── 0831-masking-personal-information.py
│ ├── 0832-flipping-an-image.py
│ ├── 0833-find-and-replace-in-string.py
│ ├── 0834-sum-of-distances-in-tree.py
│ ├── 0837-new-21-game.py
│ ├── 0838-push-dominoes.py
│ ├── 0840-magic-squares-in-grid.py
│ ├── 0841-keys-and-rooms.py
│ ├── 0844-backspace-string-compare.py
│ ├── 0845-longest-mountain-in-array.py
│ ├── 0846-hand-of-straights.py
│ ├── 0847-shortest-path-visiting-all-nodes.py
│ ├── 0849-maximize-distance-to-closest-person.py
│ ├── 0851-loud-and-rich.py
│ ├── 0852-peak-index-in-a-mountain-array.py
│ ├── 0853-car-fleet.py
│ ├── 0856-score-of-parentheses.py
│ ├── 0857-minimum-cost-to-hire-k-workers.py
│ ├── 0860-lemonade-change.py
│ ├── 0861-score-after-flipping-matrix.py
│ ├── 0862-shortest-subarray-with-sum-at-least-k.py
│ ├── 0863-all-nodes-distance-k-in-binary-tree.py
│ ├── 0865-smallest-subtree-with-all-the-deepest-nodes.py
│ ├── 0867-transpose-matrix.py
│ ├── 0869-reordered-power-of-2.py
│ ├── 0871-minimum-number-of-refueling-stops.py
│ ├── 0872-leaf-similar-trees.py
│ ├── 0873-length-of-longest-fibonacci-subsequence.py
│ ├── 0874-walking-robot-simulation.py
│ ├── 0875-koko-eating-bananas.py
│ ├── 0876-middle-of-the-linked-list.py
│ ├── 0880-decoded-string-at-index.py
│ ├── 0881-boats-to-save-people.py
│ ├── 0884-uncommon-words-from-two-sentences.py
│ ├── 0885-spiral-matrix-iii.py
│ ├── 0888-fair-candy-swap.py
│ ├── 0889-construct-binary-tree-from-preorder-and-postorder-traversal.py
│ ├── 0890-find-and-replace-pattern.py
│ ├── 0894-all-possible-full-binary-trees.py
│ ├── 0895-maximum-frequency-stack.py
│ ├── 0896-monotonic-array.py
│ ├── 0898-bitwise-ors-of-subarrays.py
│ ├── 0900-rle-iterator.py
│ ├── 0901-online-stock-span.py
│ ├── 0904-fruit-into-baskets.py
│ ├── 0905-sort-array-by-parity.py
│ ├── 0907-koko-eating-bananas.py
│ ├── 0907-sum-of-subarray-minimums.py
│ ├── 0909-snakes-and-ladders.py
│ ├── 0912-sort-an-array.py
│ ├── 0915-partition-array-into-disjoint-intervals.py
│ ├── 0916-word-subsets.py
│ ├── 0918-maximum-sum-circular-subarray.py
│ ├── 0920-number-of-music-playlists.py
│ ├── 0921-minimum-add-to-make-parentheses-valid.py
│ ├── 0924-minimize-malware-spread.py
│ ├── 0930-binary-subarrays-with-sum.py
│ ├── 0931-minimum-falling-path-sum.py
│ ├── 0933-number-of-recent-calls.py
│ ├── 0934-shortest-bridge.py
│ ├── 0935-knight-dialer.py
│ ├── 0938-range-sum-of-bst.py
│ ├── 0939-minimum-area-rectangle.py
│ ├── 0941-valid-mountain-array.py
│ ├── 0944-delete-columns-to-make-sorted.py
│ ├── 0945-minimum-increment-to-make-array-unique.py
│ ├── 0946-validate-stack-sequences.py
│ ├── 0947-most-stones-removed-with-same-row-or-column.py
│ ├── 0948-bag-of-tokens.py
│ ├── 0949-largest-time-for-given-digits.py
│ ├── 0950-reveal-cards-in-increasing-order.py
│ ├── 0951-flip-equivalent-binary-trees.py
│ ├── 0953-verifying-an-alien-dictionary.py
│ ├── 0954-array-of-doubled-pairs.py
│ ├── 0955-delete-columns-to-make-sorted-ii.py
│ ├── 0958-check-completeness-of-a-binary-tree.py
│ ├── 0959-regions-cut-by-slashes.py
│ ├── 0960-delete-columns-to-make-sorted-iii.py
│ ├── 0961-n-repeated-element-in-size-2n-array.py
│ ├── 0962-maximum-width-ramp.py
│ ├── 0966-vowel-spellchecker.py
│ ├── 0967-numbers-with-same-consecutive-differences.py
│ ├── 0969-pancake-sorting.py
│ ├── 0973-k-closest-points-to-origin.py
│ ├── 0974-subarray-sums-divisible-by-k.py
│ ├── 0976-largest-perimeter-triangle.py
│ ├── 0977-squares-of-a-sorted-array.py
│ ├── 0978-longest-turbulent-subarray.py
│ ├── 0979-distribute-coins-in-binary-tree.py
│ ├── 0981-time-based-key-value-store.py
│ ├── 0983-minimum-cost-for-tickets.py
│ ├── 0984-string-without-aaa-or-bbb.py
│ ├── 0986-interval-list-intersections.py
│ ├── 0987-vertical-order-traversal-of-a-binary-tree.py
│ ├── 0988-smallest-string-starting-from-leaf.py
│ ├── 0992-subarrays-with-k-different-integers.py
│ ├── 0993-cousins-in-binary-tree.py
│ ├── 0994-rotting-oranges.py
│ ├── 0995-minimum-number-of-k-consecutive-bit-flips.py
│ ├── 0997-find-the-town-judge.py
│ ├── 0998-maximum-binary-tree-ii.py
│ ├── 1002-find-common-characters.py
│ ├── 1003-check-if-word-is-valid-after-substitutions.py
│ ├── 1004-max-consecutive-ones-iii.py
│ ├── 1006-clumsy-factorial.py
│ ├── 1007-minimum-domino-rotations-for-equal-row.py
│ ├── 1008-construct-binary-search-tree-from-preorder-traversal.py
│ ├── 1009-complement-of-base-10-integer.py
│ ├── 1010-pairs-of-songs-with-total-durations-divisible-by-60.py
│ ├── 1011-capacity-to-ship-packages-within-d-days.py
│ ├── 1014-best-sightseeing-pair.py
│ ├── 1015-smallest-integer-divisible-by-k.py
│ ├── 1018-binary-prefix-divisible-by-5.py
│ ├── 1019-next-greater-node-in-linked-list.py
│ ├── 1023-camelcase-matching.py
│ ├── 1026-maximum-difference-between-node-and-ancestor.py
│ ├── 1028-recover-a-tree-from-preorder-traversal.py
│ ├── 1029-two-city-scheduling.py
│ ├── 1033-moving-stones-until-consecutive.py
│ ├── 1038-binary-search-tree-to-greater-sum-tree.py
│ ├── 1039-minimum-score-triangulation-of-polygon.py
│ ├── 1041-robot-bounded-in-circle.py
│ ├── 1043-partition-array-for-maximum-sum.py
│ ├── 1046-last-stone-weight.py
│ ├── 1047-remove-all-adjacent-duplicates-in-string.py
│ ├── 1048-longest-string-chain.py
│ ├── 1051-height-checker.py
│ ├── 1052-grumpy-bookstore-owner.py
│ ├── 1055-shortest-way-to-form-string.py
│ ├── 1057-campus-bikes.py
│ ├── 1060-missing-element-in-sorted-array.py
│ ├── 1061-lexicographically-smallest-equivalent-string.py
│ ├── 1062-longest-repeating-substring.py
│ ├── 1063-number-of-valid-subarrays.py
│ ├── 1065-index-pairs-of-a-string.py
│ ├── 1066-campus-bikes-ii.py
│ ├── 1071-greatest-common-divisor-of-strings.py
│ ├── 1072-flip-columns-for-maximum-number-of-equal-rows.py
│ ├── 1074-number-of-submatrices-that-sum-to-target.py
│ ├── 1079-letter-tile-possibilities.py
│ ├── 1081-smallest-subsequence-of-distinct-characters.py
│ ├── 1086-high-five.py
│ ├── 1087-brace-expansion.py
│ ├── 1090-largest-values-from-labels.py
│ ├── 1091-shortest-path-in-binary-matrix.py
│ ├── 1092-shortest-common-supersequence.py
│ ├── 1093-statistics-from-a-large-sample.py
│ ├── 1094-car-pooling.py
│ ├── 1095-find-in-mountain-array.py
│ ├── 1097-stream-of-characters.py
│ ├── 1099-two-sum-less-than-k.py
│ ├── 1100-find-k-length-substrings-with-no-repeated-characters.py
│ ├── 1101-the-earliest-moment-when-everyone-become-friends.py
│ ├── 1104-path-in-zigzag-labelled-binary-tree.py
│ ├── 1105-filling-bookcase-shelves.py
│ ├── 1106-parsing-a-boolean-expression.py
│ ├── 1109-corporate-flight-bookings.py
│ ├── 1110-delete-nodes-and-return-forest.py
│ ├── 1119-remove-vowels-from-a-string.py
│ ├── 1120-maximum-average-subtree.py
│ ├── 1121-divide-array-into-increasing-sequences.py
│ ├── 1122-relative-sort-array.py
│ ├── 1123-lowest-common-ancestor-of-deepest-leaves.py
│ ├── 1128-number-of-equivalent-domino-pairs.py
│ ├── 1133-largest-unique-number.py
│ ├── 1135-connecting-cities-with-minimum-cost.py
│ ├── 1136-parallel-courses.py
│ ├── 1137-n-th-tribonacci-number.py
│ ├── 1138-alphabet-board-path.py
│ ├── 1140-stone-game-ii.py
│ ├── 1143-longest-common-subsequence.py
│ ├── 1144-decrease-elements-to-make-array-zigzag.py
│ ├── 1146-snapshot-array.py
│ ├── 1150-check-if-a-number-is-majority-element-in-a-sorted-array.py
│ ├── 1151-minimum-swaps-to-group-all-1s-together.py
│ ├── 1152-analyze-user-website-visit-pattern.py
│ ├── 1155-number-of-dice-rolls-with-target-sum.py
│ ├── 1160-find-words-that-can-be-formed-by-characters.py
│ ├── 1161-maximum-level-sum-of-a-binary-tree.py
│ ├── 1165-single-row-keyboard.py
│ ├── 1166-design-file-system.py
│ ├── 1167-minimum-cost-to-connect-sticks.py
│ ├── 1168-optimize-water-distribution-in-a-village.py
│ ├── 1170-compare-strings-by-frequency-of-the-smallest-character.py
│ ├── 1171-remove-zero-sum-consecutive-nodes-from-linked-list.py
│ ├── 1176-diet-plan-performance.py
│ ├── 1181-before-and-after-puzzle.py
│ ├── 1182-shortest-distance-to-target-color.py
│ ├── 1183-maximum-number-of-ones.py
│ ├── 1190-reverse-substrings-between-each-pair-of-parentheses.py
│ ├── 1192-critical-connections-in-a-network.py
│ ├── 1197-minimum-knight-moves.py
│ ├── 1198-find-smallest-common-element-in-all-rows.py
│ ├── 1199-minimum-time-to-build-blocks.py
│ ├── 1200-minimum-absolute-difference.py
│ ├── 1202-smallest-string-with-swaps.py
│ ├── 1203-sort-items-by-groups-respecting-dependencies.py
│ ├── 1207-unique-number-of-occurrences.py
│ ├── 1208-get-equal-substrings-within-budget.py
│ ├── 1209-remove-all-adjacent-duplicates-in-string-ii.py
│ ├── 1213-intersection-of-three-sorted-arrays.py
│ ├── 1214-two-sum-bsts.py
│ ├── 1216-valid-palindrome-iii.py
│ ├── 1219-path-with-maximum-gold.py
│ ├── 1220-count-vowels-permutation.py
│ ├── 1222-queens-that-can-attack-the-king.py
│ ├── 1229-meeting-scheduler.py
│ ├── 1230-toss-strange-coins.py
│ ├── 1233-remove-sub-folders-from-the-filesystem.py
│ ├── 1235-maximum-profit-in-job-scheduling.py
│ ├── 1239-maximum-length-of-a-concatenated-string-with-unique-characters.py
│ ├── 1244-design-a-leaderboard.py
│ ├── 1245-tree-diameter.py
│ ├── 1248-count-number-of-nice-subarrays.py
│ ├── 1249-minimum-remove-to-make-valid-parentheses.py
│ ├── 1253-reconstruct-a-2-row-binary-matrix.py
│ ├── 1254-number-of-closed-islands.py
│ ├── 1255-maximum-score-words-formed-by-letters.py
│ ├── 1256-encode-number.py
│ ├── 1257-smallest-common-region.py
│ ├── 1261-find-elements-in-a-contaminated-binary-tree.py
│ ├── 1262-greatest-sum-divisible-by-three.py
│ ├── 1266-minimum-time-visiting-all-points.py
│ ├── 1267-count-servers-that-communicate.py
│ ├── 1268-search-suggestions-system.py
│ ├── 1269-number-of-ways-to-stay-in-the-same-place-after-some-steps.py
│ ├── 1272-remove-interval.py
│ ├── 1276-number-of-burgers-with-no-waste-of-ingredients.py
│ ├── 1277-count-square-submatrices-with-all-ones.py
│ ├── 1282-group-the-people-given-the-group-size-they-belong-to.py
│ ├── 1283-find-the-smallest-divisor-given-a-threshold.py
│ ├── 1287-element-appearing-more-than-25-in-sorted-array.py
│ ├── 1288-remove-covered-intervals.py
│ ├── 1289-minimum-falling-path-sum-ii.py
│ ├── 1290-convert-binary-number-in-a-linked-list-to-integer.py
│ ├── 1291-sequential-digits.py
│ ├── 1292-maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold.py
│ ├── 1295-find-numbers-with-even-number-of-digits.py
│ ├── 1296-divide-array-in-sets-of-k-consecutive-numbers.py
│ ├── 1298-maximum-candies-you-can-get-from-boxes.py
│ ├── 1300-sum-of-mutated-array-closest-to-target.py
│ ├── 1302-deepest-leaves-sum.py
│ ├── 1304-find-n-unique-integers-sum-up-to-zero.py
│ ├── 1305-all-elements-in-two-binary-search-trees.py
│ ├── 1306-jump-game-iii.py
│ ├── 1310-xor-queries-of-a-subarray.py
│ ├── 1314-matrix-block-sum.py
│ ├── 1315-sum-of-nodes-with-even-valued-grandparent.py
│ ├── 1317-convert-integer-to-the-sum-of-two-no-zero-integers.py
│ ├── 1318-minimum-flips-to-make-a-or-b-equal-to-c.py
│ ├── 1323-maximum-69-number.py
│ ├── 1324-print-words-vertically.py
│ ├── 1325-delete-leaves-with-a-given-value.py
│ ├── 1326-minimum-number-of-taps-to-open-to-water-a-garden.py
│ ├── 1328-break-a-palindrome.py
│ ├── 1329-sort-the-matrix-diagonally.py
│ ├── 1331-rank-transform-of-an-array.py
│ ├── 1333-filter-restaurants-by-vegan-friendly-price-and-distance.py
│ ├── 1334-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance.py
│ ├── 1335-minimum-difficulty-of-a-job-schedule.py
│ ├── 1337-the-k-weakest-rows-in-a-matrix.py
│ ├── 1338-reduce-array-size-to-the-half.py
│ ├── 1339-maximum-product-of-splitted-binary-tree.py
│ ├── 1343-number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold.py
│ ├── 1344-angle-between-hands-of-a-clock.py
│ ├── 1346-check-if-n-and-its-double-exist.py
│ ├── 1347-minimum-number-of-steps-to-make-two-strings-anagram.py
│ ├── 1351-count-negative-numbers-in-a-sorted-matrix.py
│ ├── 1352-product-of-the-last-k-numbers.py
│ ├── 1353-maximum-number-of-events-that-can-be-attended.py
│ ├── 1356-sort-integers-by-the-number-of-1-bits.py
│ ├── 1357-apply-discount-every-n-orders.py
│ ├── 1358-number-of-substrings-containing-all-three-characters.py
│ ├── 1359-count-all-valid-pickup-and-delivery-options.py
│ ├── 1360-number-of-days-between-two-dates.py
│ ├── 1361-validate-binary-tree-nodes.py
│ ├── 1362-closest-divisors.py
│ ├── 1365-how-many-numbers-are-smaller-than-the-current-number.py
│ ├── 1366-rank-teams-by-votes.py
│ ├── 1367-linked-list-in-binary-tree.py
│ ├── 1368-minimum-cost-to-make-at-least-one-valid-path-in-a-grid.py
│ ├── 1371-find-the-longest-substring-containing-vowels-in-even-counts.py
│ ├── 1372-longest-zigzag-path-in-a-binary-tree.py
│ ├── 1375-number-of-times-binary-string-is-prefix-aligned.py
│ ├── 1376-time-needed-to-inform-all-employees.py
│ ├── 1380-lucky-numbers-in-a-matrix.py
│ ├── 1381-design-a-stack-with-increment-operation.py
│ ├── 1382-balance-a-binary-search-tree.py
│ ├── 1385-find-the-distance-value-between-two-arrays.py
│ ├── 1387-sort-integers-by-the-power-value.py
│ ├── 1390-four-divisors.py
│ ├── 1394-find-lucky-integer-in-an-array.py
│ ├── 1395-count-number-of-teams.py
│ ├── 1396-design-underground-system.py
│ ├── 1399-count-largest-group.py
│ ├── 1400-construct-k-palindrome-strings.py
│ ├── 1404-number-of-steps-to-reduce-a-number-in-binary-representation-to-one.py
│ ├── 1405-longest-happy-string.py
│ ├── 1408-string-matching-in-an-array.py
│ ├── 1409-queries-on-a-permutation-with-key.py
│ ├── 1410-html-entity-parser.py
│ ├── 1411-number-of-ways-to-paint-n-3-grid.py
│ ├── 1414-find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k.py
│ ├── 1415-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n.py
│ ├── 1418-display-table-of-food-orders-in-a-restaurant.py
│ ├── 1420-build-array-where-you-can-find-the-maximum-exactly-k-comparisons.py
│ ├── 1422-maximum-score-after-splitting-a-string.py
│ ├── 1423-maximum-points-you-can-obtain-from-cards.py
│ ├── 1424-diagonal-traverse-ii.py
│ ├── 1425-constrained-subsequence-sum.py
│ ├── 1427-perform-string-shifts.py
│ ├── 1428-leftmost-column-with-at-least-a-one.py
│ ├── 1429-first-unique-number.py
│ ├── 1431-kids-with-the-greatest-number-of-candies.py
│ ├── 1432-max-difference-you-can-get-from-changing-an-integer.py
│ ├── 1433-check-if-a-string-can-break-another-string.py
│ ├── 1436-destination-city.py
│ ├── 1437-check-if-all-1s-are-at-least-length-k-places-away.py
│ ├── 1438-longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit.py
│ ├── 1441-build-an-array-with-stack-operations.py
│ ├── 1442-count-triplets-that-can-form-two-arrays-of-equal-xor.py
│ ├── 1447-simplified-fractions.py
│ ├── 1448-count-good-nodes-in-binary-tree.py
│ ├── 1451-rearrange-words-in-a-sentence.py
│ ├── 1452-people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list.py
│ ├── 1455-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence.py
│ ├── 1456-maximum-number-of-vowels-in-a-substring-of-given-length.py
│ ├── 1457-pseudo-palindromic-paths-in-a-binary-tree.py
│ ├── 1458-max-dot-product-of-two-subsequences.py
│ ├── 1460-make-two-arrays-equal-by-reversing-subarrays.py
│ ├── 1461-check-if-a-string-contains-all-binary-codes-of-size-k.py
│ ├── 1462-course-schedule-iv.py
│ ├── 1463-cherry-pickup-ii.py
│ ├── 1464-maximum-product-of-two-elements-in-an-array.py
│ ├── 1465-maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts.py
│ ├── 1466-reorder-routes-to-make-all-paths-lead-to-the-city-zero.py
│ ├── 1469-find-all-the-lonely-nodes.py
│ ├── 1470-shuffle-the-array.py
│ ├── 1471-the-k-strongest-values-in-an-array.py
│ ├── 1472-design-browser-history.py
│ ├── 1474-delete-n-nodes-after-m-nodes-of-a-linked-list.py
│ ├── 1475-final-prices-with-a-special-discount-in-a-shop.py
│ ├── 1476-subrectangle-queries.py
│ ├── 1481-least-number-of-unique-integers-after-k-removals.py
│ ├── 1482-minimum-number-of-days-to-make-m-bouquets.py
│ ├── 1488-avoid-flood-in-the-city.py
│ ├── 1489-find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree.py
│ ├── 1492-the-kth-factor-of-n.py
│ ├── 1493-longest-subarray-of-1s-after-deleting-one-element.py
│ ├── 1496-path-crossing.py
│ ├── 1497-check-if-array-pairs-are-divisible-by-k.py
│ ├── 1498-number-of-subsequences-that-satisfy-the-given-sum-condition.py
│ ├── 1503-last-moment-before-all-ants-fall-out-of-a-plank.py
│ ├── 1508-range-sum-of-sorted-subarray-sums.py
│ ├── 1509-minimum-difference-between-largest-and-smallest-value-in-three-moves.py
│ ├── 1512-number-of-good-pairs.py
│ ├── 1513-number-of-substrings-with-only-1s.py
│ ├── 1514-path-with-maximum-probability.py
│ ├── 1518-water-bottles.py
│ ├── 1523-count-odd-numbers-in-an-interval-range.py
│ ├── 1524-number-of-sub-arrays-with-odd-sum.py
│ ├── 1525-number-of-good-ways-to-split-a-string.py
│ ├── 1526-minimum-number-of-increments-on-subarrays-to-form-a-target-array.py
│ ├── 1529-minimum-suffix-flips.py
│ ├── 1530-number-of-good-leaf-nodes-pairs.py
│ ├── 1531-string-compression-ii.py
│ ├── 1534-count-good-triplets.py
│ ├── 1535-find-the-winner-of-an-array-game.py
│ ├── 1539-kth-missing-positive-number.py
│ ├── 1544-make-the-string-great.py
│ ├── 1545-find-kth-bit-in-nth-binary-string.py
│ ├── 1550-three-consecutive-odds.py
│ ├── 1551-minimum-operations-to-make-array-equal.py
│ ├── 1552-magnetic-force-between-two-balls.py
│ ├── 1557-minimum-number-of-vertices-to-reach-all-nodes.py
│ ├── 1561-maximum-number-of-coins-you-can-get.py
│ ├── 1568-minimum-number-of-days-to-disconnect-island.py
│ ├── 1570-dot-product-of-two-sparse-vectors.py
│ ├── 1574-shortest-subarray-to-be-removed-to-make-array-sorted.py
│ ├── 1578-minimum-time-to-make-rope-colorful.py
│ ├── 1579-remove-max-number-of-edges-to-keep-graph-fully-traversable.py
│ ├── 1580-put-boxes-into-the-warehouse-ii.py
│ ├── 1582-special-positions-in-a-binary-matrix.py
│ ├── 1584-min-cost-to-connect-all-points.py
│ ├── 1590-make-sum-divisible-by-p.py
│ ├── 1593-split-a-string-into-the-max-number-of-unique-substrings.py
│ ├── 1598-crawler-log-folder.py
│ ├── 1605-find-valid-matrix-given-row-and-column-sums.py
│ ├── 1608-special-array-with-x-elements-greater-than-or-equal-x.py
│ ├── 1609-even-odd-tree.py
│ ├── 1611-minimum-one-bit-operations-to-make-integers-zero.py
│ ├── 1614-maximum-nesting-depth-of-the-parentheses.py
│ ├── 1615-maximal-network-rank.py
│ ├── 1624-largest-substring-between-two-equal-characters.py
│ ├── 1625-lexicographically-smallest-string-after-applying-operations.py
│ ├── 1630-arithmetic-subarrays.py
│ ├── 1631-path-with-minimum-effort.py
│ ├── 1634-add-two-polynomials-represented-as-linked-lists.py
│ ├── 1636-sort-array-by-increasing-frequency.py
│ ├── 1637-widest-vertical-area-between-two-points-containing-no-points.py
│ ├── 1639-number-of-ways-to-form-a-target-string-given-a-dictionary.py
│ ├── 1641-count-sorted-vowel-strings.py
│ ├── 1642-furthest-building-you-can-reach.py
│ ├── 1644-lowest-common-ancestor-of-a-binary-tree-ii.py
│ ├── 1647-minimum-deletions-to-make-character-frequencies-unique.py
│ ├── 1650-lowest-common-ancestor-of-a-binary-tree-iii.py
│ ├── 1652-defuse-the-bomb.py
│ ├── 1653-minimum-deletions-to-make-string-balanced.py
│ ├── 1657-determine-if-two-strings-are-close.py
│ ├── 1658-minimum-operations-to-reduce-x-to-zero.py
│ ├── 1660-correct-a-binary-tree.py
│ ├── 1662-check-if-two-string-arrays-are-equivalent.py
│ ├── 1663-smallest-string-with-a-given-numeric-value.py
│ ├── 1669-merge-in-between-linked-lists.py
│ ├── 1671-minimum-number-of-removals-to-make-mountain-array.py
│ ├── 1679-max-number-of-k-sum-pairs.py
│ ├── 1684-count-the-number-of-consistent-strings.py
│ ├── 1685-sum-of-absolute-differences-in-a-sorted-array.py
│ ├── 1688-count-of-matches-in-tournament.py
│ ├── 1689-partitioning-into-minimum-number-of-deci-binary-numbers.py
│ ├── 1695-maximum-erasure-value.py
│ ├── 1700-number-of-students-unable-to-eat-lunch.py
│ ├── 1701-average-waiting-time.py
│ ├── 1704-determine-if-string-halves-are-alike.py
│ ├── 1706-where-will-the-ball-fall.py
│ ├── 1716-calculate-money-in-leetcode-bank.py
│ ├── 1717-maximum-score-from-removing-substrings.py
│ ├── 1718-construct-the-lexicographically-largest-valid-sequence.py
│ ├── 1721-swapping-nodes-in-a-linked-list.py
│ ├── 1726-tuple-with-same-product.py
│ ├── 1727-largest-submatrix-with-rearrangements.py
│ ├── 1730-shortest-path-to-get-food.py
│ ├── 1732-find-the-highest-altitude.py
│ ├── 1733-minimum-number-of-people-to-teach.py
│ ├── 1740-find-distance-in-a-binary-tree.py
│ ├── 1743-restore-the-array-from-adjacent-pairs.py
│ ├── 1746-maximum-subarray-sum-after-one-operation.py
│ ├── 1749-maximum-absolute-sum-of-any-subarray.py
│ ├── 1750-minimum-length-of-string-after-deleting-similar-ends.py
│ ├── 1752-check-if-array-is-sorted-and-rotated.py
│ ├── 1753-maximum-score-from-removing-stones.py
│ ├── 1756-design-most-recently-used-queue.py
│ ├── 1758-minimum-changes-to-make-alternating-binary-string.py
│ ├── 1759-count-number-of-homogenous-substrings.py
│ ├── 1760-minimum-limit-of-balls-in-a-bag.py
│ ├── 1762-buildings-with-an-ocean-view.py
│ ├── 1765-map-of-highest-peak.py
│ ├── 1768-merge-strings-alternately.py
│ ├── 1769-minimum-number-of-operations-to-move-all-balls-to-each-box.py
│ ├── 1770-maximum-score-from-performing-multiplication-operations.py
│ ├── 1780-check-if-number-is-a-sum-of-powers-of-three.py
│ ├── 1785-minimum-elements-to-add-to-form-a-given-sum.py
│ ├── 1790-check-if-one-string-swap-can-make-strings-equal.py
│ ├── 1791-find-center-of-star-graph.py
│ ├── 1792-maximum-average-pass-ratio.py
│ ├── 1793-maximum-score-of-a-good-subarray.py
│ ├── 1797-design-authentication-manager.py
│ ├── 1800-maximum-ascending-subarray-sum.py
│ ├── 1802-maximum-value-at-a-given-index-in-a-bounded-array.py
│ ├── 1804-implement-trie-ii-prefix-tree.py
│ ├── 1806-minimum-number-of-operations-to-reinitialize-a-permutation.py
│ ├── 1807-evaluate-the-bracket-pairs-of-a-string.py
│ ├── 1813-sentence-similarity-iii.py
│ ├── 1814-count-nice-pairs-in-an-array.py
│ ├── 1817-finding-the-users-active-minutes.py
│ ├── 1823-find-the-winner-of-the-circular-game.py
│ ├── 1828-queries-on-number-of-points-inside-a-circle.py
│ ├── 1829-maximum-xor-for-each-query.py
│ ├── 1833-maximum-ice-cream-bars.py
│ ├── 1834-single-threaded-cpu.py
│ ├── 1836-remove-duplicates-from-an-unsorted-linked-list.py
│ ├── 1838-frequency-of-the-most-frequent-element.py
│ ├── 1842-next-palindrome-using-same-digits.py
│ ├── 1845-seat-reservation-manager.py
│ ├── 1846-maximum-element-after-decreasing-and-rearranging.py
│ ├── 1851-minimum-interval-to-include-each-query.py
│ ├── 1852-distinct-numbers-in-each-subarray.py
│ ├── 1855-maximum-distance-between-a-pair-of-values.py
│ ├── 1857-largest-color-value-in-a-directed-graph.py
│ ├── 1858-longest-word-with-all-prefixes.py
│ ├── 1860-incremental-memory-leak.py
│ ├── 1861-rotating-the-box.py
│ ├── 1863-sum-of-all-subset-xor-totals.py
│ ├── 1865-finding-pairs-with-a-certain-sum.py
│ ├── 1870-minimum-speed-to-arrive-on-time.py
│ ├── 1874-minimize-product-sum-of-two-arrays.py
│ ├── 1877-minimize-maximum-pair-sum-in-array.py
│ ├── 1881-maximum-value-after-insertion.py
│ ├── 1885-count-pairs-in-two-arrays.py
│ ├── 1887-reduction-operations-to-make-the-array-elements-equal.py
│ ├── 1888-minimum-number-of-flips-to-make-the-binary-string-alternating.py
│ ├── 1891-cutting-ribbons.py
│ ├── 1894-find-the-student-that-will-replace-the-chalk.py
│ ├── 1895-largest-magic-square.py
│ ├── 1897-redistribute-characters-to-make-all-strings-equal.py
│ ├── 1898-maximum-number-of-removable-characters.py
│ ├── 1899-merge-triplets-to-form-target-triplet.py
│ ├── 1900-the-earliest-and-latest-rounds-where-players-compete.py
│ ├── 1903-largest-odd-number-in-string.py
│ ├── 1904-the-number-of-full-rounds-you-have-played.py
│ ├── 1905-count-sub-islands.py
│ ├── 1910-remove-all-occurrences-of-a-substring.py
│ ├── 1912-design-movie-rental-system.py
│ ├── 1913-maximum-product-difference-between-two-pairs.py
│ ├── 1915-number-of-wonderful-substrings.py
│ ├── 1920-build-array-from-permutation.py
│ ├── 1921-eliminate-maximum-number-of-monsters.py
│ ├── 1922-count-good-numbers.py
│ ├── 1925-count-square-sum-triples.py
│ ├── 1926-nearest-exit-from-entrance-in-maze.py
│ ├── 1929-concatenation-of-array.py
│ ├── 1930-unique-length-3-palindromic-subsequences.py
│ ├── 1931-painting-a-grid-with-three-different-colors.py
│ ├── 1935-maximum-number-of-words-you-can-type.py
│ ├── 1936-add-minimum-number-of-rungs.py
│ ├── 1937-maximum-number-of-points-with-cost.py
│ ├── 1940-longest-common-subsequence-between-sorted-arrays.py
│ ├── 1942-the-number-of-the-smallest-unoccupied-chair.py
│ ├── 1945-sum-of-digits-of-string-after-convert.py
│ ├── 1946-largest-number-after-mutating-substring.py
│ ├── 1948-delete-duplicate-folders-in-system.py
│ ├── 1957-delete-characters-to-make-fancy-string.py
│ ├── 1962-remove-stones-to-minimize-the-total.py
│ ├── 1963-minimum-number-of-swaps-to-make-the-string-balanced.py
│ ├── 1968-array-with-elements-not-equal-to-average-of-neighbors.py
│ ├── 1970-last-day-where-you-can-still-cross.py
│ ├── 1971-find-if-path-exists-in-graph.py
│ ├── 1973-count-nodes-equal-to-sum-of-descendants.py
│ ├── 1975-maximum-matrix-sum.py
│ ├── 1976-number-of-ways-to-arrive-at-destination.py
│ ├── 1980-find-unique-binary-string.py
│ ├── 1984-minimum-difference-between-highest-and-lowest-of-k-scores.py
│ ├── 1985-find-the-kth-largest-integer-in-the-array.py
│ ├── 1992-find-all-groups-of-farmland.py
│ ├── 2000-reverse-prefix-of-word.py
│ ├── 2001-number-of-pairs-of-interchangeable-rectangles.py
│ ├── 2002-maximum-product-of-the-length-of-two-palindromic-subsequences.py
│ ├── 2007-find-original-array-from-doubled-array.py
│ ├── 2009-minimum-number-of-operations-to-make-array-continuous.py
│ ├── 2011-final-value-of-variable-after-performing-operations.py
│ ├── 2012-sum-of-beauty-in-the-array.py
│ ├── 2013-detect-squares.py
│ ├── 2014-longest-subsequence-repeated-k-times.py
│ ├── 2016-maximum-difference-between-increasing-elements.py
│ ├── 2017-grid-game.py
│ ├── 2022-convert-1d-array-into-2d-array.py
│ ├── 2023-number-of-pairs-of-strings-with-concatenation-equal-to-target.py
│ ├── 2028-find-missing-observations.py
│ ├── 2033-minimum-operations-to-make-a-uni-value-grid.py
│ ├── 2034-stock-price-fluctuation.py
│ ├── 2035-partition-array-into-two-arrays-to-minimize-sum-difference.py
│ ├── 2037-minimum-number-of-moves-to-seat-everyone.py
│ ├── 2038-remove-colored-pieces-if-both-neighbors-are-the-same-color.py
│ ├── 2040-kth-smallest-product-of-two-sorted-arrays.py
│ ├── 2043-simple-bank-system.py
│ ├── 2044-count-number-of-maximum-bitwise-or-subsets.py
│ ├── 2045-second-minimum-time-to-reach-destination.py
│ ├── 2048-next-greater-numerically-balanced-number.py
│ ├── 2050-parallel-courses-iii.py
│ ├── 2053-kth-distinct-string-in-an-array.py
│ ├── 2054-two-best-non-overlapping-events.py
│ ├── 2055-plates-between-candles.py
│ ├── 2058-find-the-minimum-and-maximum-number-of-nodes-between-critical-points.py
│ ├── 2061-number-of-spaces-cleaning-robot-cleaned.py
│ ├── 2062-count-vowel-substrings-of-a-string.py
│ ├── 2064-minimized-maximum-of-products-distributed-to-any-store.py
│ ├── 2070-most-beautiful-item-for-each-query.py
│ ├── 2071-maximum-number-of-tasks-you-can-assign.py
│ ├── 2073-time-needed-to-buy-tickets.py
│ ├── 2074-reverse-nodes-in-even-length-groups.py
│ ├── 2077-paths-in-maze-that-lead-to-same-room.py
│ ├── 2079-watering-plants.py
│ ├── 2081-sum-of-k-mirror-numbers.py
│ ├── 2083-substrings-that-begin-and-end-with-the-same-letter.py
│ ├── 2089-find-target-indices-after-sorting-array.py
│ ├── 2090-k-radius-subarray-averages.py
│ ├── 2091-removing-minimum-and-maximum-from-array.py
│ ├── 2092-find-all-people-with-secret.py
│ ├── 2093-minimum-cost-to-reach-city-with-discounts.py
│ ├── 2094-finding-3-digit-even-numbers.py
│ ├── 2095-delete-the-middle-node-of-a-linked-list.py
│ ├── 2096-step-by-step-directions-from-a-binary-tree-node-to-another.py
│ ├── 2097-valid-arrangement-of-pairs.py
│ ├── 2099-find-subsequence-of-length-k-with-the-largest-sum.py
│ ├── 2101-detonate-the-maximum-bombs.py
│ ├── 2104-total-characters-in-string-after-transformations-i.py
│ ├── 2105-watering-plants-ii.py
│ ├── 2106-maximum-fruits-harvested-after-at-most-k-steps.py
│ ├── 2107-number-of-unique-flavors-after-sharing-k-candies.py
│ ├── 2108-find-first-palindromic-string-in-the-array.py
│ ├── 2109-adding-spaces-to-a-string.py
│ ├── 2110-number-of-smooth-descent-periods-of-a-stock.py
│ ├── 2115-find-all-possible-recipes-from-given-supplies.py
│ ├── 2116-check-if-a-parentheses-string-can-be-valid.py
│ ├── 2120-execution-of-all-suffix-instructions-staying-in-a-grid.py
│ ├── 2125-number-of-laser-beams-in-a-bank.py
│ ├── 2127-maximum-employees-to-be-invited-to-a-meeting.py
│ ├── 2130-maximum-twin-sum-of-a-linked-list.py
│ ├── 2131-longest-palindrome-by-concatenating-two-letter-words.py
│ ├── 2134-minimum-swaps-to-group-all-1s-together-ii.py
│ ├── 2138-divide-a-string-into-groups-of-size-k.py
│ ├── 2139-detect-squares.py
│ ├── 2139-minimum-moves-to-reach-target-score.py
│ ├── 2140-solving-questions-with-brainpower.py
│ ├── 2141-maximum-running-time-of-n-computers.py
│ ├── 2145-count-the-hidden-sequences.py
│ ├── 2147-number-of-ways-to-divide-a-long-corridor.py
│ ├── 2149-rearrange-array-elements-by-sign.py
│ ├── 2150-find-all-lonely-numbers-in-the-array.py
│ ├── 2154-keep-multiplying-found-values-by-two.py
│ ├── 2155-all-divisions-with-the-highest-score-of-a-binary-array.py
│ ├── 2161-partition-array-according-to-given-pivot.py
│ ├── 2163-minimum-difference-in-sums-after-removal-of-elements.py
│ ├── 2165-smallest-value-of-the-rearranged-number.py
│ ├── 2168-unique-substrings-with-equal-digit-frequency.py
│ ├── 2169-count-operations-to-obtain-zero.py
│ ├── 2176-count-equal-and-divisible-pairs-in-an-array.py
│ ├── 2177-find-three-consecutive-integers-that-sum-to-a-given-number.py
│ ├── 2178-maximum-split-of-positive-even-integers.py
│ ├── 2179-count-good-triplets-in-an-array.py
│ ├── 2181-merge-nodes-in-between-zeros.py
│ ├── 2182-construct-string-with-repeat-limit.py
│ ├── 2185-counting-words-with-a-given-prefix.py
│ ├── 2186-minimum-number-of-steps-to-make-two-strings-anagram-ii.py
│ ├── 2191-sort-the-jumbled-numbers.py
│ ├── 2192-all-ancestors-of-a-node-in-a-directed-acyclic-graph.py
│ ├── 2193-minimum-number-of-moves-to-make-palindrome.py
│ ├── 2196-create-binary-tree-from-descriptions.py
│ ├── 2197-replace-non-coprime-numbers-in-array.py
│ ├── 2200-find-all-k-distant-indices-in-an-array.py
│ ├── 2201-zero-array-transformation-i.py
│ ├── 2204-distance-to-a-cycle-in-undirected-graph.py
│ ├── 2206-divide-array-into-equal-pairs.py
│ ├── 2207-maximize-number-of-subsequences-in-a-string.py
│ ├── 2208-minimum-operations-to-halve-array-sum.py
│ ├── 2210-count-hills-and-valleys-in-an-array.py
│ ├── 2211-count-collisions-on-a-road.py
│ ├── 2214-minimum-health-to-beat-game.py
│ ├── 2215-find-the-difference-of-two-arrays.py
│ ├── 2216-minimum-deletions-to-make-array-beautiful.py
│ ├── 2220-minimum-bit-flips-to-convert-number.py
│ ├── 2221-find-triangular-sum-of-an-array.py
│ ├── 2225-find-players-with-zero-or-one-losses.py
│ ├── 2226-maximum-candies-allocated-to-k-children.py
│ ├── 2231-largest-number-after-digit-swaps-by-parity.py
│ ├── 2235-add-two-integers.py
│ ├── 2240-number-of-ways-to-buy-pens-and-pencils.py
│ ├── 2244-minimum-rounds-to-complete-all-tasks.py
│ ├── 2246-longest-path-with-different-adjacent-characters.py
│ ├── 2251-number-of-flowers-in-full-bloom.py
│ ├── 2256-minimum-average-difference.py
│ ├── 2257-count-unguarded-cells-in-the-grid.py
│ ├── 2260-minimum-consecutive-cards-to-pick-up.py
│ ├── 2262-total-appeal-of-a-string.py
│ ├── 2264-largest-3-same-digit-number-in-string.py
│ ├── 2265-count-nodes-equal-to-average-of-subtree.py
│ ├── 2270-number-of-ways-to-split-array.py
│ ├── 2273-find-resultant-array-after-removing-anagrams.py
│ ├── 2274-maximum-consecutive-floors-without-special-floors.py
│ ├── 2275-largest-combination-with-bitwise-and-greater-than-zero.py
│ ├── 2279-maximum-bags-with-full-capacity-of-rocks.py
│ ├── 2284-sender-with-largest-word-count.py
│ ├── 2285-maximum-total-importance-of-roads.py
│ ├── 2290-minimum-obstacle-removal-to-reach-corner.py
│ ├── 2291-maximum-profit-from-trading-stocks.py
│ ├── 2294-partition-array-such-that-maximum-difference-is-k.py
│ ├── 2295-replace-elements-in-an-array.py
│ ├── 2300-successful-pairs-of-spells-and-potions.py
│ ├── 2302-count-subarrays-with-score-less-than-k.py
│ ├── 2303-calculate-amount-paid-in-taxes.py
│ ├── 2310-sum-of-numbers-with-units-digit-k.py
│ ├── 2311-longest-binary-subsequence-less-than-or-equal-to-k.py
│ ├── 2322-minimum-score-after-removals-on-a-tree.py
│ ├── 2326-spiral-matrix-iv.py
│ ├── 2327-number-of-people-aware-of-a-secret.py
│ ├── 2331-evaluate-boolean-binary-tree.py
│ ├── 2334-subarray-with-elements-greater-than-varying-threshold.py
│ ├── 2336-smallest-number-in-infinite-set.py
│ ├── 2337-move-pieces-to-obtain-a-string.py
│ ├── 2338-count-the-number-of-ideal-arrays.py
│ ├── 2342-max-sum-of-a-pair-with-equal-sum-of-digits.py
│ ├── 2348-number-of-zero-filled-subarrays.py
│ ├── 2349-design-a-number-container-system.py
│ ├── 2352-equal-row-and-column-pairs.py
│ ├── 2353-design-a-food-rating-system.py
│ ├── 2355-maximum-number-of-books-you-can-take.py
│ ├── 2357-make-array-zero-by-subtracting-equal-amounts.py
│ ├── 2358-maximum-number-of-groups-entering-a-competition.py
│ ├── 2359-find-closest-node-to-given-two-nodes.py
│ ├── 2361-minimum-costs-using-the-train-line.py
│ ├── 2364-count-number-of-bad-pairs.py
│ ├── 2366-minimum-replacements-to-sort-the-array.py
│ ├── 2368-reachable-nodes-with-restrictions.py
│ ├── 2369-check-if-there-is-a-valid-partition-for-the-array.py
│ ├── 2370-longest-ideal-subsequence.py
│ ├── 2371-minimize-maximum-value-in-a-grid.py
│ ├── 2373-largest-local-values-in-a-matrix.py
│ ├── 2374-node-with-highest-edge-score.py
│ ├── 2375-construct-smallest-number-from-di-string.py
│ ├── 2379-minimum-recolors-to-get-k-consecutive-black-blocks.py
│ ├── 2380-time-needed-to-rearrange-a-binary-string.py
│ ├── 2381-shifting-letters-ii.py
│ ├── 2384-largest-palindromic-number.py
│ ├── 2385-amount-of-time-for-binary-tree-to-be-infected.py
│ ├── 2389-longest-subsequence-with-limited-sum.py
│ ├── 2390-removing-stars-from-a-string.py
│ ├── 2391-minimum-amount-of-time-to-collect-garbage.py
│ ├── 2392-build-a-matrix-with-conditions.py
│ ├── 2393-count-strictly-increasing-subarrays.py
│ ├── 2396-strictly-palindromic-number.py
│ ├── 2401-longest-nice-subarray.py
│ ├── 2402-meeting-rooms-iii.py
│ ├── 2405-optimal-partition-of-string.py
│ ├── 2406-divide-intervals-into-minimum-number-of-groups.py
│ ├── 2408-design-sql.py
│ ├── 2410-maximum-matching-of-players-with-trainers.py
│ ├── 2411-smallest-subarrays-with-maximum-bitwise-or.py
│ ├── 2414-length-of-the-longest-alphabetical-continuous-substring.py
│ ├── 2415-reverse-odd-levels-of-binary-tree.py
│ ├── 2416-sum-of-prefix-scores-of-strings.py
│ ├── 2418-sort-the-people.py
│ ├── 2419-longest-subarray-with-maximum-bitwise-and.py
│ ├── 2425-bitwise-xor-of-all-pairings.py
│ ├── 2428-maximum-sum-of-an-hourglass.py
│ ├── 2429-minimize-xor.py
│ ├── 2433-find-the-original-array-of-prefix-xor.py
│ ├── 2434-using-a-robot-to-print-the-lexicographically-smallest-string.py
│ ├── 2435-paths-in-matrix-whose-sum-is-divisible-by-k.py
│ ├── 2438-range-product-queries-of-powers.py
│ ├── 2439-minimize-maximum-of-array.py
│ ├── 2441-largest-positive-integer-that-exists-with-its-negative.py
│ ├── 2442-count-number-of-distinct-integers-after-reverse-operations.py
│ ├── 2443-sum-of-number-and-its-reverse.py
│ ├── 2444-count-subarrays-with-fixed-bounds.py
│ ├── 2452-words-within-two-edits-of-dictionary.py
│ ├── 2456-most-popular-video-creator.py
│ ├── 2458-height-of-binary-tree-after-subtree-removal-queries.py
│ ├── 2460-apply-operations-to-an-array.py
│ ├── 2461-maximum-sum-of-distinct-subarrays-with-length-k.py
│ ├── 2462-total-cost-to-hire-k-workers.py
│ ├── 2463-minimum-total-distance-traveled.py
│ ├── 2464-minimum-subarrays-in-a-valid-split.py
│ ├── 2466-count-ways-to-build-good-strings.py
│ ├── 2467-most-profitable-path-in-a-tree.py
│ ├── 2470-number-of-subarrays-with-lcm-equal-to-k.py
│ ├── 2471-minimum-number-of-operations-to-sort-a-binary-tree-by-level.py
│ ├── 2473-minimum-cost-to-buy-apples.py
│ ├── 2482-difference-between-ones-and-zeros-in-row-and-column.py
│ ├── 2483-minimum-penalty-for-a-shop.py
│ ├── 2485-find-the-pivot-integer.py
│ ├── 2486-append-characters-to-string-to-make-subsequence.py
│ ├── 2487-remove-nodes-from-linked-list.py
│ ├── 2490-circular-sentence.py
│ ├── 2491-divide-players-into-teams-of-equal-skill.py
│ ├── 2492-minimum-score-of-a-path-between-two-cities.py
│ ├── 2493-divide-nodes-into-the-maximum-number-of-groups.py
│ ├── 2501-longest-square-streak-in-an-array.py
│ ├── 2503-maximum-number-of-points-from-grid-queries.py
│ ├── 2505-bitwise-or-of-all-subsequence-sums.py
│ ├── 2507-smallest-value-after-replacing-with-sum-of-prime-factors.py
│ ├── 2516-take-k-of-each-character-from-left-and-right.py
│ ├── 2521-distinct-prime-factors-of-product-of-array.py
│ ├── 2523-closest-prime-numbers-in-range.py
│ ├── 2526-find-consecutive-integers-from-a-data-stream.py
│ ├── 2527-find-xor-beauty-of-array.py
│ ├── 2528-maximize-the-minimum-powered-city.py
│ ├── 2529-maximum-count-of-positive-integer-and-negative-integer.py
│ ├── 2530-maximal-score-after-applying-k-operations.py
│ ├── 2536-increment-submatrices-by-one.py
│ ├── 2537-count-the-number-of-good-subarrays.py
│ ├── 2539-count-the-number-of-good-subsequences.py
│ ├── 2540-minimum-common-value.py
│ ├── 2542-maximum-subsequence-score.py
│ ├── 2545-sort-the-students-by-their-kth-score.py
│ ├── 2551-put-marbles-in-bags.py
│ ├── 2554-maximum-number-of-integers-to-choose-from-a-range-i.py
│ ├── 2558-take-gifts-from-the-richest-pile.py
│ ├── 2559-count-vowel-strings-in-ranges.py
│ ├── 2560-house-robber-iv.py
│ ├── 2561-rearranging-fruits.py
│ ├── 2563-count-the-number-of-fair-pairs.py
│ ├── 2566-maximum-difference-by-remapping-a-digit.py
│ ├── 2570-merge-two-2d-arrays-by-summing-values.py
│ ├── 2575-find-the-divisibility-array-of-a-string.py
│ ├── 2577-minimum-time-to-visit-a-cell-in-a-grid.py
│ ├── 2579-count-total-number-of-colored-cells.py
│ ├── 2582-pass-the-pillow.py
│ ├── 2583-kth-largest-sum-in-a-binary-tree.py
│ ├── 2587-rearrange-array-to-maximize-prefix-score.py
│ ├── 2592-maximize-greatness-of-an-array.py
│ ├── 2593-find-score-of-an-array-after-marking-all-elements.py
│ ├── 2594-minimum-time-to-repair-cars.py
│ ├── 2596-check-knight-tour-configuration.py
│ ├── 2597-the-number-of-beautiful-subsets.py
│ ├── 2598-smallest-missing-non-negative-integer-after-operations.py
│ ├── 2599-make-the-prefix-sum-non-negative.py
│ ├── 2601-prime-subtraction-operation.py
│ ├── 2602-minimum-operations-to-make-all-array-elements-equal.py
│ ├── 2606-find-the-substring-with-maximum-cost.py
│ ├── 2610-convert-an-array-into-a-2d-array-with-conditions.py
│ ├── 2616-minimize-the-maximum-difference-of-pairs.py
│ ├── 2640-find-the-score-of-all-prefixes-of-an-array.py
│ ├── 2641-cousins-in-binary-tree-ii.py
│ ├── 2642-design-graph-with-shortest-path-calculator.py
│ ├── 2645-minimum-additions-to-make-valid-string.py
│ ├── 2654-minimum-number-of-operations-to-make-all-array-elements-equal-to-1.py
│ ├── 2657-find-the-prefix-common-array-of-two-arrays.py
│ ├── 2658-maximum-number-of-fish-in-a-grid.py
│ ├── 2661-first-completely-painted-row-or-column.py
│ ├── 2664-the-knights-tour.py
│ ├── 2671-frequency-tracker.py
│ ├── 2674-split-a-circular-linked-list.py
│ ├── 2678-number-of-senior-citizens.py
│ ├── 2679-sum-in-a-matrix.py
│ ├── 2683-neighboring-bitwise-xor.py
│ ├── 2684-maximum-number-of-moves-in-a-grid.py
│ ├── 2685-count-the-number-of-complete-components.py
│ ├── 2696-minimum-string-length-after-removing-substrings.py
│ ├── 2698-find-the-punishment-number-of-an-integer.py
│ ├── 2699-modify-graph-edge-weights.py
│ ├── 2706-buy-two-chocolates.py
│ ├── 2707-extra-characters-in-a-string.py
│ ├── 2708-maximum-strength-of-a-group.py
│ ├── 2709-greatest-common-divisor-traversal.py
│ ├── 2711-difference-of-number-of-distinct-values-on-diagonals.py
│ ├── 2730-find-the-longest-semi-repetitive-substring.py
│ ├── 2734-lexicographically-smallest-string-after-substring-operation.py
│ ├── 2737-find-the-closest-marked-node.py
│ ├── 2740-find-the-value-of-the-partition.py
│ ├── 2742-painting-the-walls.py
│ ├── 2743-count-substrings-without-repeating-character.py
│ ├── 2749-minimum-operations-to-make-the-integer-zero.py
│ ├── 2751-robot-collisions.py
│ ├── 2761-prime-pairs-with-target-sum.py
│ ├── 2762-continuous-subarrays.py
│ ├── 2770-maximum-number-of-jumps-to-reach-the-last-index.py
│ ├── 2771-longest-non-decreasing-subarray-from-two-arrays.py
│ ├── 2772-apply-operations-to-make-all-array-elements-equal-to-zero.py
│ ├── 2778-sum-of-squares-of-special-elements.py
│ ├── 2779-maximum-beauty-of-an-array-after-applying-operation.py
│ ├── 2780-minimum-index-of-a-valid-split.py
│ ├── 2784-check-if-array-is-good.py
│ ├── 2785-sort-vowels-in-a-string.py
│ ├── 2787-ways-to-express-an-integer-as-sum-of-powers.py
│ ├── 2788-split-strings-by-separator.py
│ ├── 2789-largest-element-in-an-array-after-merge-operations.py
│ ├── 2798-number-of-employees-who-met-the-target.py
│ ├── 2799-count-complete-subarrays-in-an-array.py
│ ├── 2802-find-the-k-th-lucky-number.py
│ ├── 2806-account-balance-after-rounded-purchase.py
│ ├── 2807-insert-greatest-common-divisors-in-linked-list.py
│ ├── 2810-faulty-keyboard.py
│ ├── 2811-check-if-it-is-possible-to-split-array.py
│ ├── 2812-find-the-safest-path-in-a-grid.py
│ ├── 2814-minimum-time-takes-to-reach-destination-without-drowning.py
│ ├── 2816-double-a-number-represented-as-a-linked-list.py
│ ├── 2818-apply-operations-to-maximize-score.py
│ ├── 2824-count-pairs-whose-sum-is-less-than-target.py
│ ├── 2825-make-string-a-subsequence-using-cyclic-increments.py
│ ├── 2829-determine-the-minimum-sum-of-a-k-avoiding-array.py
│ ├── 2832-maximal-range-that-each-element-is-maximum-in-it.py
│ ├── 2833-furthest-point-from-origin.py
│ ├── 2834-find-the-minimum-possible-sum-of-a-beautiful-array.py
│ ├── 2838-maximum-coins-heroes-can-collect.py
│ ├── 2840-check-if-strings-can-be-made-equal-with-operations-ii.py
│ ├── 2841-maximum-sum-of-almost-unique-subarray.py
│ ├── 2843-count-symmetric-integers.py
│ ├── 2845-count-of-interesting-subarrays.py
│ ├── 2849-determine-if-a-cell-is-reachable-at-a-given-time.py
│ ├── 2850-minimum-moves-to-spread-stones-over-grid.py
│ ├── 2852-sum-of-remoteness-of-all-cells.py
│ ├── 2856-minimum-array-length-after-pair-removals.py
│ ├── 2864-maximum-odd-binary-number.py
│ ├── 2865-beautiful-towers-i.py
│ ├── 2870-minimum-number-of-operations-to-make-array-empty.py
│ ├── 2872-maximum-number-of-k-divisible-components.py
│ ├── 2873-maximum-value-of-an-ordered-triplet-i.py
│ ├── 2874-maximum-value-of-an-ordered-triplet-ii.py
│ ├── 2877-create-a-dataframe-from-list.py
│ ├── 2878-get-the-size-of-a-dataframe.py
│ ├── 2879-display-the-first-three-rows.py
│ ├── 2880-select-data.py
│ ├── 2881-create-a-new-column.py
│ ├── 2882-drop-duplicate-rows.py
│ ├── 2883-drop-missing-data.py
│ ├── 2884-modify-columns.py
│ ├── 2885-rename-columns.py
│ ├── 2886-change-data-type.py
│ ├── 2887-fill-missing-data.py
│ ├── 2888-reshape-data-concatenate.py
│ ├── 2889-reshape-data-pivot.py
│ ├── 2890-reshape-data-melt.py
│ ├── 2891-method-chaining.py
│ ├── 2894-divisible-and-non-divisible-sums-difference.py
│ ├── 2895-minimum-processing-time.py
│ ├── 2900-longest-unequal-adjacent-groups-subsequence-i.py
│ ├── 2901-longest-unequal-adjacent-groups-subsequence-ii.py
│ ├── 2904-shortest-and-lexicographically-smallest-beautiful-string.py
│ ├── 2909-minimum-sum-of-mountain-triplets-ii.py
│ ├── 2914-minimum-number-of-changes-to-make-binary-string-beautiful.py
│ ├── 2918-minimum-equal-sum-of-two-arrays-after-replacing-zeros.py
│ ├── 2923-find-champion-i.py
│ ├── 2924-find-champion-ii.py
│ ├── 2927-distribute-candies-among-children-iii.py
│ ├── 2929-distribute-candies-among-children-ii.py
│ ├── 2933-high-access-employees.py
│ ├── 2938-separate-black-and-white-balls.py
│ ├── 2940-find-building-where-alice-and-bob-can-meet.py
│ ├── 2942-find-words-containing-character.py
│ ├── 2943-maximize-area-of-square-hole-in-grid.py
│ ├── 2947-count-beautiful-substrings-i.py
│ ├── 2948-make-lexicographically-smallest-array-by-swapping-elements.py
│ ├── 2955-number-of-same-end-substrings.py
│ ├── 2957-remove-adjacent-almost-equal-characters.py
│ ├── 2958-length-of-longest-subarray-with-at-most-k-frequency.py
│ ├── 2961-double-modular-exponentiation.py
│ ├── 2962-count-subarrays-where-max-element-appears-at-least-k-times.py
│ ├── 2965-find-missing-and-repeated-values.py
│ ├── 2966-divide-array-into-arrays-with-max-difference.py
│ ├── 2971-find-polygon-with-the-largest-perimeter.py
│ ├── 2975-maximum-square-area-by-removing-fences-from-a-field.py
│ ├── 2976-minimum-cost-to-convert-string-i.py
│ ├── 2977-minimum-cost-to-convert-string-ii.py
│ ├── 2981-find-longest-special-substring-that-occurs-thrice-i.py
│ ├── 2997-minimum-number-of-operations-to-make-array-xor-equal-to-k.py
│ ├── 2999-count-the-number-of-powerful-integers.py
│ ├── 3000-maximum-area-of-longest-diagonal-rectangle.py
│ ├── 3003-maximize-the-number-of-partitions-after-operations.py
│ ├── 3005-count-elements-with-maximum-frequency.py
│ ├── 3006-find-beautiful-indices-in-the-given-array-i.py
│ ├── 3010-divide-an-array-into-subarrays-with-minimum-cost-i.py
│ ├── 3011-find-if-array-can-be-sorted.py
│ ├── 3013-divide-an-array-into-subarrays-with-minimum-cost-ii.py
│ ├── 3016-minimum-number-of-pushes-to-type-word-ii.py
│ ├── 3020-find-the-maximum-number-of-elements-in-subset.py
│ ├── 3021-alice-and-bob-playing-flower-game.py
│ ├── 3024-type-of-triangle.py
│ ├── 3025-find-the-number-of-ways-to-place-people-i.py
│ ├── 3026-maximum-good-subarray-sum.py
│ ├── 3027-find-the-number-of-ways-to-place-people-ii.py
│ ├── 3034-number-of-subarrays-that-match-a-pattern-i.py
│ ├── 3039-apply-operations-to-make-string-empty.py
│ ├── 3042-count-prefix-and-suffix-pairs-i.py
│ ├── 3043-find-the-length-of-the-longest-common-prefix.py
│ ├── 3047-find-the-largest-area-of-square-inside-two-rectangles.py
│ ├── 3062-winner-of-the-linked-list-game.py
│ ├── 3063-linked-list-frequency.py
│ ├── 3066-minimum-operations-to-exceed-threshold-value-ii.py
│ ├── 3068-find-the-maximum-sum-of-node-values.py
│ ├── 3070-count-submatrices-with-top-left-element-and-sum-less-than-k.py
│ ├── 3074-apple-redistribution-into-boxes.py
│ ├── 3075-maximize-happiness-of-selected-children.py
│ ├── 3084-count-substrings-starting-and-ending-with-given-character.py
│ ├── 3085-minimum-deletions-to-make-string-k-special.py
│ ├── 3091-apply-operations-to-make-sum-of-array-greater-than-or-equal-to-k.py
│ ├── 3095-shortest-subarray-with-or-at-least-k-i.py
│ ├── 3096-minimum-levels-to-gain-more-points.py
│ ├── 3097-shortest-subarray-with-or-at-least-k-ii.py
│ ├── 3100-water-bottles-ii.py
│ ├── 3101-count-alternating-subarrays.py
│ ├── 3105-longest-strictly-increasing-or-strictly-decreasing-subarray.py
│ ├── 3106-lexicographically-smallest-string-after-operations-with-constraint.py
│ ├── 3108-minimum-cost-walk-in-weighted-graph.py
│ ├── 3110-score-of-a-string.py
│ ├── 3111-minimum-rectangles-to-cover-points.py
│ ├── 3115-maximum-prime-difference.py
│ ├── 3121-count-the-number-of-special-characters-ii.py
│ ├── 3128-right-triangles.py
│ ├── 3133-minimum-array-end.py
│ ├── 3136-valid-word.py
│ ├── 3137-minimum-number-of-operations-to-make-word-k-periodic.py
│ ├── 3147-taking-maximum-energy-from-the-mystic-dungeon.py
│ ├── 3151-special-array-i.py
│ ├── 3152-special-array-ii.py
│ ├── 3155-maximum-number-of-upgradable-servers.py
│ ├── 3159-find-occurrences-of-an-element-in-an-array.py
│ ├── 3160-find-the-number-of-distinct-colors-among-the-balls.py
│ ├── 3163-string-compression-iii.py
│ ├── 3169-count-days-without-meetings.py
│ ├── 3170-lexicographically-minimum-string-after-removing-stars.py
│ ├── 3174-clear-digits.py
│ ├── 3175-find-the-first-player-to-win-k-games-in-a-row.py
│ ├── 3176-find-the-maximum-length-of-a-good-subsequence-i.py
│ ├── 3177-find-the-maximum-length-of-a-good-subsequence-ii.py
│ ├── 3179-find-the-n-th-value-after-k-seconds.py
│ ├── 3186-maximum-total-damage-with-spell-casting.py
│ ├── 3189-minimum-moves-to-get-a-peaceful-board.py
│ ├── 3190-find-minimum-operations-to-make-all-elements-divisible-by-three.py
│ ├── 3191-minimum-operations-to-make-binary-array-elements-equal-to-one-i.py
│ ├── 3192-minimum-operations-to-make-binary-array-elements-equal-to-one-ii.py
│ ├── 3195-find-the-minimum-area-to-cover-all-ones-i.py
│ ├── 3197-find-the-minimum-area-to-cover-all-ones-ii.py
│ ├── 3201-find-the-maximum-length-of-valid-subsequence-i.py
│ ├── 3202-find-the-maximum-length-of-valid-subsequence-ii.py
│ ├── 3203-find-minimum-diameter-after-merging-two-trees.py
│ ├── 3208-alternating-groups-ii.py
│ ├── 3211-generate-binary-strings-without-adjacent-zeros.py
│ ├── 3217-delete-nodes-from-linked-list-present-in-array.py
│ ├── 3223-minimum-length-of-string-after-operations.py
│ ├── 3227-vowels-game-in-a-string.py
│ ├── 3228-maximum-number-of-operations-to-move-ones-to-the-end.py
│ ├── 3233-find-the-count-of-numbers-which-are-not-special.py
│ ├── 3234-count-the-number-of-substrings-with-dominant-ones.py
│ ├── 3239-minimum-number-of-flips-to-make-binary-grid-palindromic-i.py
│ ├── 3243-shortest-distance-after-road-addition-queries-i.py
│ ├── 3249-count-the-number-of-good-nodes.py
│ ├── 3254-find-the-power-of-k-size-subarrays-i.py
│ ├── 3259-maximum-energy-boost-from-two-drinks.py
│ ├── 3264-final-array-state-after-k-multiplication-operations-i.py
│ ├── 3271-hash-divided-string.py
│ ├── 3272-find-the-count-of-good-integers.py
│ ├── 3275-k-th-nearest-obstacle-queries.py
│ ├── 3280-convert-date-to-binary.py
│ ├── 3281-maximize-score-of-numbers-in-ranges.py
│ ├── 3282-reach-end-of-array-with-max-score.py
│ ├── 3285-find-indices-of-stable-mountains.py
│ ├── 3286-find-a-safe-walk-through-a-grid.py
│ ├── 3289-the-two-sneaky-numbers-of-digitville.py
│ ├── 3290-maximum-multiplication-score.py
│ ├── 3295-report-spam-message.py
│ ├── 3296-minimum-number-of-seconds-to-make-mountain-height-zero.py
│ ├── 3300-minimum-element-after-replacement-with-digit-sum.py
│ ├── 3301-maximize-the-total-height-of-unique-towers.py
│ ├── 3304-find-the-k-th-character-in-string-game-i.py
│ ├── 3305-count-of-substrings-containing-every-vowel-and-k-consonants-i.py
│ ├── 3306-count-of-substrings-containing-every-vowel-and-k-consonants-ii.py
│ ├── 3307-find-the-k-th-character-in-string-game-ii.py
│ ├── 3309-maximum-possible-number-by-binary-concatenation.py
│ ├── 3310-remove-methods-from-project.py
│ ├── 3314-construct-the-minimum-bitwise-array-i.py
│ ├── 3315-construct-the-minimum-bitwise-array-ii.py
│ ├── 3318-find-x-sum-of-all-k-long-subarrays-i.py
│ ├── 3319-k-th-largest-perfect-subtree-size-in-binary-tree.py
│ ├── 3321-find-x-sum-of-all-k-long-subarrays-ii.py
│ ├── 3324-find-the-sequence-of-strings-appeared-on-the-screen.py
│ ├── 3325-count-substrings-with-k-frequency-characters-i.py
│ ├── 3330-find-the-original-typed-string-i.py
│ ├── 3331-find-subtree-sizes-after-changes.py
│ ├── 3333-find-the-original-typed-string-ii.py
│ ├── 3334-find-the-maximum-factor-score-of-array.py
│ ├── 3335-total-characters-in-string-after-transformations-i.py
│ ├── 3337-total-characters-in-string-after-transformations-ii.py
│ ├── 3340-check-balanced-string.py
│ ├── 3341-find-minimum-time-to-reach-last-room-i.py
│ ├── 3342-find-minimum-time-to-reach-last-room-ii.py
│ ├── 3343-count-number-of-balanced-permutations.py
│ ├── 3345-smallest-divisible-digit-product-i.py
│ ├── 3346-maximum-frequency-of-an-element-after-performing-operations-i.py
│ ├── 3347-maximum-frequency-of-an-element-after-performing-operations-ii.py
│ ├── 3349-adjacent-increasing-subarrays-detection-i.py
│ ├── 3350-adjacent-increasing-subarrays-detection-ii.py
│ ├── 3354-make-array-elements-equal-to-zero.py
│ ├── 3355-zero-array-transformation-i.py
│ ├── 3356-zero-array-transformation-ii.py
│ ├── 3360-stone-removal-game.py
│ ├── 3361-shift-distance-between-two-strings.py
│ ├── 3362-zero-array-transformation-iii.py
│ ├── 3363-find-the-maximum-number-of-fruits-collected.py
│ ├── 3364-minimum-positive-sum-subarray.py
│ ├── 3365-rearrange-k-substrings-to-form-target-string.py
│ ├── 3370-smallest-number-with-all-set-bits.py
│ ├── 3371-identify-the-largest-outlier-in-an-array.py
│ ├── 3372-maximize-the-number-of-target-nodes-after-connecting-trees-i.py
│ ├── 3373-maximize-the-number-of-target-nodes-after-connecting-trees-ii.py
│ ├── 3375-minimum-operations-to-make-array-values-equal-to-k.py
│ ├── 3379-transformed-array.py
│ ├── 3380-maximum-area-rectangle-with-point-constraints-i.py
│ ├── 3381-maximum-subarray-sum-with-length-divisible-by-k.py
│ ├── 3386-button-with-longest-push-time.py
│ ├── 3387-maximize-amount-after-two-days-of-conversions.py
│ ├── 3392-count-subarrays-of-length-three-with-a-condition.py
│ ├── 3393-count-paths-with-the-given-xor-value.py
│ ├── 3394-check-if-grid-can-be-cut-into-sections.py
│ ├── 3396-minimum-number-of-operations-to-make-elements-in-array-distinct.py
│ ├── 3397-maximum-number-of-distinct-elements-after-operations.py
│ ├── 3402-minimum-operations-to-make-columns-strictly-increasing.py
│ ├── 3403-find-the-lexicographically-largest-string-from-the-box-i.py
│ ├── 3405-count-the-number-of-arrays-with-k-matching-adjacent-elements.py
│ ├── 3407-substring-matching-pattern.py
│ ├── 3408-design-task-manager.py
│ ├── 3411-maximum-subarray-with-equal-products.py
│ ├── 3412-find-mirror-score-of-a-string.py
│ ├── 3417-zigzag-grid-traversal-with-skip.py
│ ├── 3418-maximum-amount-of-money-robot-can-earn.py
│ ├── 3423-maximum-difference-between-adjacent-elements-in-a-circular-array.py
│ ├── 3424-minimum-cost-to-make-arrays-identical.py
│ ├── 3427-sum-of-variable-length-subarrays.py
│ ├── 3428-maximum-and-minimum-sums-of-at-most-size-k-subsequences.py
│ ├── 3432-count-partitions-with-even-sum-difference.py
│ ├── 3433-count-mentions-per-user.py
│ ├── 3434-maximum-frequency-after-subarray-operation.py
│ ├── 3438-find-valid-pair-of-adjacent-digits-in-string.py
│ ├── 3439-reschedule-meetings-for-maximum-free-time-i.py
│ ├── 3440-reschedule-meetings-for-maximum-free-time-i.py
│ ├── 3442-maximum-difference-between-even-and-odd-frequency-i.py
│ ├── 3443-maximum-manhattan-distance-after-k-changes.py
│ ├── 3445-maximum-difference-between-even-and-odd-frequency-ii.py
│ ├── 3446-sort-matrix-by-diagonals.py
│ ├── 3447-assign-elements-to-groups-with-constraints.py
│ ├── 3452-sum-of-good-numbers.py
│ ├── 3453-separate-squares-i.py
│ ├── 3454-separate-squares-ii.py
│ ├── 3456-find-special-substring-of-length-k.py
│ ├── 3457-eat-pizzas.py
│ ├── 3459-length-of-longest-v-shaped-diagonal-segment.py
│ ├── 3461-check-if-digits-are-equal-in-string-after-operations-i.py
│ ├── 3462-maximum-sum-with-at-most-k-elements.py
│ ├── 3467-transform-array-by-parity.py
│ ├── 3468-find-the-number-of-copy-arrays.py
│ ├── 3471-find-the-largest-almost-missing-integer.py
│ ├── 3473-sum-of-k-subarrays-with-length-at-least-m.py
│ ├── 3477-fruits-into-baskets-ii.py
│ ├── 3478-choose-k-elements-with-maximum-sum.py
│ ├── 3479-fruits-into-baskets-iii.py
│ ├── 3480-maximize-subarrays-after-removing-one-conflicting-pair.py
│ ├── 3483-unique-3-digit-even-numbers.py
│ ├── 3484-design-spreadsheet.py
│ ├── 3487-maximum-unique-subarray-sum-after-deletion.py
│ ├── 3488-closest-equal-element-queries.py
│ ├── 3489-zero-array-transformation-iv.py
│ ├── 3492-maximum-containers-on-a-ship.py
│ ├── 3493-properties-graph.py
│ ├── 3494-find-the-minimum-amount-of-time-to-brew-potions.py
│ ├── 3495-minimum-operations-to-make-array-elements-zero.py
│ ├── 3498-reverse-degree-of-a-string.py
│ ├── 3499-maximize-active-section-with-trade-i.py
│ ├── 3502-minimum-cost-to-reach-every-position.py
│ ├── 3503-longest-palindrome-after-substring-concatenation-i.py
│ ├── 3507-minimum-pair-removal-to-sort-array-i.py
│ ├── 3508-implement-router.py
│ ├── 3510-minimum-pair-removal-to-sort-array-ii.py
│ ├── 3512-minimum-operations-to-make-array-sum-divisible-by-k.py
│ ├── 3513-number-of-unique-xor-triplets-i.py
│ ├── 3514-number-of-unique-xor-triplets-ii.py
│ ├── 3516-find-closest-person.py
│ ├── 3517-smallest-palindromic-rearrangement-i.py
│ ├── 3519-count-numbers-with-non-decreasing-digits.py
│ ├── 3522-calculate-score-after-performing-instructions.py
│ ├── 3523-make-array-non-decreasing.py
│ ├── 3524-find-x-value-of-array-i.py
│ ├── 3527-find-the-most-common-response.py
│ ├── 3528-unit-conversion-i.py
│ ├── 3531-count-covered-buildings.py
│ ├── 3532-path-existence-queries-in-a-graph-i.py
│ ├── 3536-maximum-product-of-two-digits.py
│ ├── 3537-fill-a-special-grid.py
│ ├── 3539-find-sum-of-array-product-of-magical-sequences.py
│ ├── 3541-find-most-frequent-vowel-and-consonant.py
│ ├── 3542-minimum-operations-to-convert-all-elements-to-zero.py
│ ├── 3545-minimum-deletions-for-at-most-k-distinct-characters.py
│ ├── 3546-equal-sum-grid-partition-i.py
│ ├── 3550-minimum-swaps-to-sort-by-digit-sum.py
│ ├── 3551-smallest-index-with-digit-sum-equal-to-index.py
│ ├── 3556-sum-of-largest-prime-substrings.py
│ ├── 3558-number-of-ways-to-assign-edge-weights-i.py
│ ├── 3560-find-minimum-log-transportation-cost.py
│ ├── 3561-resulting-string-after-adjacent-removals.py
│ ├── 3562-maximum-profit-from-trading-stocks-with-discounts.py
│ ├── 3566-partition-array-into-two-equal-product-subsets.py
│ ├── 3567-minimum-moves-to-clean-the-classroom.py
│ ├── 3568-maximize-count-of-distinct-primes-after-split.py
│ ├── 3569-minimum-absolute-difference-in-sliding-submatrix.py
│ ├── 3573-best-time-to-buy-and-sell-stock-v.py
│ ├── 3574-maximize-ysum-by-picking-a-triplet-of-distinct-xvalues.py
│ ├── 3576-transform-array-to-all-equal-elements.py
│ ├── 3577-count-the-number-of-computer-unlocking-permutations.py
│ ├── 3578-count-partitions-with-max-min-difference-at-most-k.py
│ ├── 3582-generate-tag-for-video-caption.py
│ ├── 3583-count-special-triplets.py
│ ├── 3584-maximum-product-of-first-and-last-elements-of-a-subsequence.py
│ ├── 3587-minimum-adjacent-swaps-to-alternate-parity.py
│ ├── 3588-find-maximum-area-of-a-triangle.py
│ ├── 3591-check-if-any-element-has-prime-frequency.py
│ ├── 3592-inverse-coin-change.py
│ ├── 3593-minimum-increments-to-equalize-leaf-paths.py
│ ├── 3597-partition-string.py
│ ├── 3599-partition-array-to-minimize-xor.py
│ ├── 3602-hexadecimal-and-hexatrigesimal-conversion.py
│ ├── 3603-minimum-cost-path-with-alternating-directions-ii.py
│ ├── 3604-minimum-time-to-reach-destination-in-directed-graph.py
│ ├── 3606-coupon-code-validator.py
│ ├── 3607-power-grid-maintenance.py
│ ├── 3608-minimum-time-for-k-connected-components.py
│ ├── 3612-process-string-with-special-operations-i.py
│ ├── 3613-minimize-maximum-component-cost.py
│ ├── 3614-process-string-with-special-operations-ii.py
│ ├── 3622-check-divisibility-by-digit-sum-and-product.py
│ ├── 3623-count-number-of-trapezoids-i.py
│ ├── 3624-number-of-integers-with-popcount-depth-equal-to-k-ii.py
│ ├── 3625-count-number-of-trapezoids-ii.py
│ ├── 3627-maximum-median-sum-of-subsequences-of-size-3.py
│ ├── 3628-maximum-number-of-subsequences-after-one-inserting.py
│ ├── 3633-earliest-finish-time-for-land-and-water-rides-i.py
│ ├── 3634-minimum-removals-to-balance-array.py
│ ├── 3635-earliest-finish-time-for-land-and-water-rides-ii.py
│ ├── 3637-trionic-array-i.py
│ ├── 3638-maximum-balanced-shipments.py
│ ├── 3640-trionic-array-ii.py
│ ├── 3643-flip-square-submatrix-vertically.py
│ ├── 3644-maximum-k-to-sort-a-permutation.py
│ ├── 3646-next-special-palindrome-number.py
│ ├── 3648-minimum-sensors-to-cover-grid.py
│ ├── 3649-number-of-perfect-pairs.py
│ ├── 3650-minimum-cost-path-with-edge-reversals.py
│ ├── 3651-minimum-cost-path-with-teleportations.py
│ ├── 3652-best-time-to-buy-and-sell-stock-using-strategy.py
│ ├── 3653-xor-after-range-multiplication-queries-i.py
│ ├── 3654-minimum-sum-after-divisible-sum-deletions.py
│ ├── 3658-gcd-of-odd-and-even-sums.py
│ ├── 3659-partition-array-into-k-distinct-groups.py
│ ├── 3663-find-the-least-frequent-digit.py
│ ├── 3665-twisted-mirror-path-count.py
│ ├── 3668-restore-finishing-order.py
│ ├── 3669-balanced-k-factor-decomposition.py
│ ├── 3674-minimum-operations-to-equalize-array.py
│ ├── 3675-minimum-operations-to-transform-string.py
│ ├── 3676-count-bowl-subarrays.py
│ ├── 3678-smallest-absent-positive-greater-than-average.py
│ ├── 3679-minimum-discards-to-balance-inventory.py
│ ├── 3681-maximum-xor-of-subsequences.py
│ ├── 3688-bitwise-or-of-even-numbers-in-an-array.py
│ ├── 3689-maximum-total-subarray-value-i.py
│ ├── 3690-split-and-merge-array-transformation.py
│ ├── 3692-majority-frequency-characters.py
│ ├── 3693-climbing-stairs-ii.py
│ ├── 3694-distinct-points-reachable-after-substring-removal.py
│ ├── 3697-compute-decimal-representation.py
│ ├── 3698-split-array-with-minimum-difference.py
│ ├── 3701-compute-alternating-sum.py
│ ├── 3702-longest-subsequence-with-non-zero-bitwise-xor.py
│ ├── 3703-remove-k-balanced-substrings.py
│ ├── 3707-equal-score-substrings.py
│ ├── 3708-longest-fibonacci-subarray.py
│ ├── 3709-design-exam-scores-tracker.py
│ ├── 3712-sum-of-elements-with-frequency-divisible-by-k.py
│ ├── 3713-longest-balanced-substring-i.py
│ ├── 3715-sum-of-perfect-square-ancestors.py
│ ├── 3718-smallest-missing-multiple-of-k.py
│ ├── 3719-longest-balanced-subarray-i.py
│ ├── 3720-lexicographically-smallest-permutation-greater-than-target.py
│ ├── 3721-longest-balanced-subarray-ii.py
│ ├── 373-find-k-pairs-with-smallest-sums.py
│ ├── 3731-find-missing-elements.py
│ ├── 3732-maximum-product-of-three-elements-after-one-replacement.py
│ ├── 3733-minimum-time-to-complete-all-deliveries.py
│ ├── 3740-minimum-distance-between-three-equal-elements-i.py
│ ├── 3741-minimum-distance-between-three-equal-elements-ii.py
│ ├── 3742-maximum-path-score-in-a-grid.py
│ ├── 3745-maximize-expression-of-three-elements.py
│ ├── 3746-minimum-string-length-after-balanced-removals.py
│ ├── 3747-count-distinct-integers-after-removing-zeros.py
│ ├── 3748-sort-matrix-by-diagonals.py
│ ├── 3750-minimum-number-of-flips-to-reverse-binary-string.py
│ ├── 3751-total-waviness-of-numbers-in-range-i.py
│ ├── 3752-lexicographically-smallest-negated-permutation-that-sums-to-target.py
│ ├── 3765-complete-prime-number.py
│ ├── 3766-minimum-operations-to-make-binary-palindrome.py
│ ├── 3767-maximize-points-after-choosing-k-tasks.py
│ ├── 3769-sort-integers-by-binary-reflection.py
│ ├── 3770-largest-prime-from-consecutive-prime-sum.py
│ ├── 3771-total-score-of-dungeon-runs.py
│ ├── 3774-absolute-difference-between-maximum-and-minimum-k-elements.py
│ ├── 3775-reverse-words-with-same-vowel-count.py
│ ├── 3776-minimum-moves-to-balance-circular-array.py
│ ├── 3779-minimum-number-of-operations-to-have-distinct-elements.py
│ ├── 3780-maximum-sum-of-three-numbers-divisible-by-three.py
│ ├── 3781-maximum-score-after-binary-swaps.py
│ ├── 3783-mirror-distance-of-an-integer.py
│ ├── 3784-minimum-deletion-cost-to-make-all-characters-equal.py
│ ├── 3785-minimum-swaps-to-avoid-forbidden-values.py
│ ├── 401-binary-watch.py
│ ├── 480-sliding-window-median.py
│ └── 661-49-group-anagrams.py
├── Question_List_0001_1000.md
├── Question_List_1001_2000.md
├── Question_List_2001_3000.md
├── Question_List_3001_4000.md
├── README.md
├── Readme/
│ ├── 0001-two-sum.md
│ ├── 0002-add-two-numbers.md
│ ├── 0003-longest-substring-without-repeating-characters.md
│ ├── 0004-median-of-two-sorted-arrays.md
│ ├── 0005-longest-palindromic-substring.md
│ ├── 0006-zigzag-conversion.md
│ ├── 0007-reverse-integer.md
│ ├── 0008-string-to-integer-atoi.md
│ ├── 0009-palindrome-number.md
│ ├── 0010-regular-expression-matching.md
│ ├── 0011-container-with-most-water.md
│ ├── 0012-integer-to-roman.md
│ ├── 0013-roman-to-integer.md
│ ├── 0014-longest-common-prefix.md
│ ├── 0015-3sum.md
│ ├── 0016-3sum-closest.md
│ ├── 0017-letter-combinations-of-a-phone-number.md
│ ├── 0018-4sum.md
│ ├── 0019-remove-nth-node-from-end-of-list.md
│ ├── 0020-valid-parentheses.md
│ ├── 0021-merge-two-sorted-lists.md
│ ├── 0022-generate-parentheses.md
│ ├── 0023-merge-k-sorted-lists.md
│ ├── 0024-swap-nodes-in-pairs.md
│ ├── 0025-reverse-nodes-in-k-group.md
│ ├── 0026-remove-duplicates-from-sorted-array.md
│ ├── 0027-remove-element.md
│ ├── 0028-find-the-index-of-the-first-occurrence-in-a-string.md
│ ├── 0029-divide-two-integers.md
│ ├── 0030-substring-with-concatenation-of-all-words.md
│ ├── 0031-next-permutation.md
│ ├── 0032-longest-valid-parentheses.md
│ ├── 0033-search-in-rotated-sorted-array.md
│ ├── 0034-find-first-and-last-position-of-element-in-sorted-array.md
│ ├── 0035-search-insert-position.md
│ ├── 0036-valid-sudoku.md
│ ├── 0037-sudoku-solver.md
│ ├── 0038-count-and-say.md
│ ├── 0039-combination-sum.md
│ ├── 0040-combination-sum-ii.md
│ ├── 0041-first-missing-positive.md
│ ├── 0042-trapping-rain-water.md
│ ├── 0043-multiply-strings.md
│ ├── 0044-wildcard-matching.md
│ ├── 0045-jump-game-ii.md
│ ├── 0046-permutations.md
│ ├── 0047-permutations-ii.md
│ ├── 0048-rotate-image.md
│ ├── 0049-group-anagrams.md
│ ├── 0050-powx-n.md
│ ├── 0051-n-queens.md
│ ├── 0052-n-queens-ii.md
│ ├── 0053-maximum-subarray.md
│ ├── 0054-spiral-matrix.md
│ ├── 0055-jump-game.md
│ ├── 0056-merge-intervals.md
│ ├── 0057-insert-interval.md
│ ├── 0058-length-of-last-word.md
│ ├── 0059-spiral-matrix-ii.md
│ ├── 0061-rotate-list.md
│ ├── 0062-unique-paths.md
│ ├── 0063-unique-paths-ii.md
│ ├── 0064-minimum-path-sum.md
│ ├── 0066-plus-one.md
│ ├── 0067-add-binary.md
│ ├── 0068-text-justification.md
│ ├── 0069-sqrtx.md
│ ├── 0070-climbing-stairs.md
│ ├── 0071-simplify-path.md
│ ├── 0072-edit-distance.md
│ ├── 0073-set-matrix-zeroes.md
│ ├── 0074-search-a-2d-matrix.md
│ ├── 0075-sort-colors.md
│ ├── 0076-minimum-window-substring.md
│ ├── 0077-combinations.md
│ ├── 0078-subsets.md
│ ├── 0079-word-search.md
│ ├── 0080-remove-duplicates-from-sorted-array-ii.md
│ ├── 0081-search-in-rotated-sorted-array-ii.md
│ ├── 0082-remove-duplicates-from-sorted-list-ii.md
│ ├── 0083-remove-duplicates-from-sorted-list.md
│ ├── 0084-largest-rectangle-in-histogram.md
│ ├── 0085-maximal-rectangle.md
│ ├── 0086-partition-list.md
│ ├── 0087-scramble-string.md
│ ├── 0088-merge-sorted-array.md
│ ├── 0089-gray-code.md
│ ├── 0090-subsets-ii.md
│ ├── 0091-decode-ways.md
│ ├── 0092-reverse-linked-list-ii.md
│ ├── 0093-restore-ip-addresses.md
│ ├── 0094-binary-tree-inorder-traversal.md
│ ├── 0095-unique-binary-search-trees-ii.md
│ ├── 0096-unique-binary-search-trees.md
│ ├── 0097-interleaving-string.md
│ ├── 0098-validate-binary-search-tree.md
│ ├── 0099-recover-binary-search-tree.md
│ ├── 0100-same-tree.md
│ ├── 0101-symmetric-tree.md
│ ├── 0102-binary-tree-level-order-traversal.md
│ ├── 0103-binary-tree-zigzag-level-order-traversal.md
│ ├── 0104-maximum-depth-of-binary-tree.md
│ ├── 0105-construct-binary-tree-from-preorder-and-inorder-traversal.md
│ ├── 0106-construct-binary-tree-from-inorder-and-postorder-traversal.md
│ ├── 0107-binary-tree-level-order-traversal-ii.md
│ ├── 0108-convert-sorted-array-to-binary-search-tree.md
│ ├── 0110-balanced-binary-tree.md
│ ├── 0111-minimum-depth-of-binary-tree.md
│ ├── 0112-path-sum.md
│ ├── 0113-path-sum-ii.md
│ ├── 0114-flatten-binary-tree-to-linked-list.md
│ ├── 0115-distinct-subsequences.md
│ ├── 0116-populating-next-right-pointers-in-each-node.md
│ ├── 0117-populating-next-right-pointers-in-each-node-ii.md
│ ├── 0118-pascals-triangle.md
│ ├── 0119-pascals-triangle-ii.md
│ ├── 0120-triangle.md
│ ├── 0121-best-time-to-buy-and-sell-stock.md
│ ├── 0122-best-time-to-buy-and-sell-stock-ii.md
│ ├── 0123-best-time-to-buy-and-sell-stock-iii.md
│ ├── 0124-binary-tree-maximum-path-sum.md
│ ├── 0125-valid-palindrome.md
│ ├── 0126-word-ladder-ii.md
│ ├── 0127-word-ladder.md
│ ├── 0128-longest-consecutive-sequence.md
│ ├── 0129-sum-root-to-leaf-numbers.md
│ ├── 0130-surrounded-regions.md
│ ├── 0131-palindrome-partitioning.md
│ ├── 0132-palindrome-partitioning-ii.md
│ ├── 0133-clone-graph.md
│ ├── 0134-gas-station.md
│ ├── 0135-candy.md
│ ├── 0136-single-number.md
│ ├── 0137-single-number-ii.md
│ ├── 0138-copy-list-with-random-pointer.md
│ ├── 0139-word-break.md
│ ├── 0140-word-break-ii.md
│ ├── 0141-linked-list-cycle.md
│ ├── 0142-linked-list-cycle-ii.md
│ ├── 0143-reorder-list.md
│ ├── 0144-binary-tree-preorder-traversal.md
│ ├── 0145-binary-tree-postorder-traversal.md
│ ├── 0146-lru-cache.md
│ ├── 0148-sort-list.md
│ ├── 0149-max-points-on-a-line.md
│ ├── 0150-evaluate-reverse-polish-notation.md
│ ├── 0151-reverse-words-in-a-string.md
│ ├── 0152-maximum-product-subarray.md
│ ├── 0153-find-minimum-in-rotated-sorted-array.md
│ ├── 0155-min-stack.md
│ ├── 0159-longest-substring-with-at-most-two-distinct-characters.md
│ ├── 0160-intersection-of-two-linked-lists.md
│ ├── 0162-find-peak-element.md
│ ├── 0166-fraction-to-recurring-decimal.md
│ ├── 0167-two-sum-ii-input-array-is-sorted.md
│ ├── 0168-excel-sheet-column-title.md
│ ├── 0169-majority-element.md
│ ├── 0170-two-sum-iii-data-structure-design.md
│ ├── 0172-factorial-trailing-zeroes.md
│ ├── 0173-binary-search-tree-iterator.md
│ ├── 0179-largest-number.md
│ ├── 0187-repeated-dna-sequences.md
│ ├── 0188-best-time-to-buy-and-sell-stock-iv.md
│ ├── 0189-rotate-array.md
│ ├── 0190-reverse-bits.md
│ ├── 0191-number-of-1-bits.md
│ ├── 0197-rising-temperature.md
│ ├── 0198-house-robber.md
│ ├── 0199-binary-tree-right-side-view.md
│ ├── 0200-number-of-islands.md
│ ├── 0201-bitwise-and-of-numbers-range.md
│ ├── 0202-happy-number.md
│ ├── 0203-remove-linked-list-elements.md
│ ├── 0205-isomorphic-strings.md
│ ├── 0206-reverse-linked-list.md
│ ├── 0207-course-schedule.md
│ ├── 0208-implement-trie-prefix-tree.md
│ ├── 0209-minimum-size-subarray-sum.md
│ ├── 0210-course-schedule-ii.md
│ ├── 0211-design-add-and-search-words-data-structure.md
│ ├── 0212-word-search-ii.md
│ ├── 0213-house-robber-ii.md
│ ├── 0214-shortest-palindrome.md
│ ├── 0215-kth-largest-element-in-an-array.md
│ ├── 0216-combination-sum-iii.md
│ ├── 0217-contains-duplicate.md
│ ├── 0218-the-skyline-problem.md
│ ├── 0219-contains-duplicate-ii.md
│ ├── 0221-maximal-square.md
│ ├── 0222-count-complete-tree-nodes.md
│ ├── 0224-basic-calculator.md
│ ├── 0225-implement-stack-using-queues.md
│ ├── 0226-invert-binary-tree.md
│ ├── 0227-basic-calculator-ii.md
│ ├── 0228-summary-ranges.md
│ ├── 0229-majority-element-ii.md
│ ├── 0230-kth-smallest-element-in-a-bst.md
│ ├── 0231-power-of-two.md
│ ├── 0232-implement-queue-using-stacks.md
│ ├── 0234-palindrome-linked-list.md
│ ├── 0235-lowest-common-ancestor-of-a-binary-search-tree.md
│ ├── 0236-lowest-common-ancestor-of-a-binary-tree.md
│ ├── 0237-delete-node-in-a-linked-list.md
│ ├── 0238-product-of-array-except-self.md
│ ├── 0239-sliding-window-maximum.md
│ ├── 0240-search-a-2d-matrix-ii.md
│ ├── 0241-different-ways-to-add-parentheses.md
│ ├── 0242-valid-anagram.md
│ ├── 0244-shortest-word-distance-ii.md
│ ├── 0246-strobogrammatic-number.md
│ ├── 0249-group-shifted-strings.md
│ ├── 0250-count-univalue-subtrees.md
│ ├── 0252-meeting-rooms.md
│ ├── 0253-meeting-rooms-ii.md
│ ├── 0254-factor-combinations.md
│ ├── 0255-verify-preorder-sequence-in-binary-search-tree.md
│ ├── 0256-paint-house.md
│ ├── 0257-binary-tree-paths.md
│ ├── 0259-3sum-smaller.md
│ ├── 0260-single-number-iii.md
│ ├── 0261-graph-valid-tree.md
│ ├── 0263-ugly-number.md
│ ├── 0264-ugly-number-ii.md
│ ├── 0265-paint-house-ii.md
│ ├── 0266-palindrome-permutation.md
│ ├── 0268-missing-number.md
│ ├── 0269-alien-dictionary.md
│ ├── 0270-closest-binary-search-tree-value.md
│ ├── 0271-encode-and-decode-strings.md
│ ├── 0272-closest-binary-search-tree-value-ii.md
│ ├── 0273-integer-to-english-words.md
│ ├── 0274-h-index.md
│ ├── 0276-paint-fence.md
│ ├── 0277-find-the-celebrity.md
│ ├── 0278-first-bad-version.md
│ ├── 0279-perfect-squares.md
│ ├── 0283-move-zeroes.md
│ ├── 0285-inorder-successor-in-bst.md
│ ├── 0286-walls-and-gates.md
│ ├── 0287-find-the-duplicate-number.md
│ ├── 0289-game-of-life.md
│ ├── 0290-word-pattern.md
│ ├── 0291-word-pattern-ii.md
│ ├── 0293-flip-game.md
│ ├── 0295-find-median-from-data-stream.md
│ ├── 0296-best-meeting-point.md
│ ├── 0297-serialize-and-deserialize-binary-tree.md
│ ├── 0298-binary-tree-longest-consecutive-sequence.md
│ ├── 0299-bulls-and-cows.md
│ ├── 0300-longest-increasing-subsequence.md
│ ├── 0301-remove-invalid-parentheses.md
│ ├── 0302-smallest-rectangle-enclosing-black-pixels.md
│ ├── 0303-range-sum-query-immutable.md
│ ├── 0304-range-sum-query-2d-immutable.md
│ ├── 0305-number-of-islands-ii.md
│ ├── 0307-range-sum-query-mutable.md
│ ├── 0309-best-time-to-buy-and-sell-stock-with-cooldown.md
│ ├── 0310-minimum-height-trees.md
│ ├── 0311-sparse-matrix-multiplication.md
│ ├── 0312-burst-balloons.md
│ ├── 0314-binary-tree-vertical-order-traversal.md
│ ├── 0315-count-of-smaller-numbers-after-self.md
│ ├── 0316-remove-duplicate-letters.md
│ ├── 0317-shortest-distance-from-all-buildings.md
│ ├── 0320-generalized-abbreviation.md
│ ├── 0322-coin-change.md
│ ├── 0323-number-of-connected-components-in-an-undirected-graph.md
│ ├── 0325-maximum-size-subarray-sum-equals-k.md
│ ├── 0326-power-of-three.md
│ ├── 0327-count-of-range-sum.md
│ ├── 0328-odd-even-linked-list.md
│ ├── 0329-longest-increasing-path-in-a-matrix.md
│ ├── 0330-patching-array.md
│ ├── 0331-verify-preorder-serialization-of-a-binary-tree.md
│ ├── 0332-reconstruct-itinerary.md
│ ├── 0333-largest-bst-subtree.md
│ ├── 0334-increasing-triplet-subsequence.md
│ ├── 0337-house-robber-iii.md
│ ├── 0338-counting-bits.md
│ ├── 0339-nested-list-weight-sum.md
│ ├── 0340-longest-substring-with-at-most-k-distinct-characters.md
│ ├── 0341-flatten-nested-list-iterator.md
│ ├── 0342-power-of-four.md
│ ├── 0343-integer-break.md
│ ├── 0344-reverse-string.md
│ ├── 0345-reverse-vowels-of-a-string.md
│ ├── 0346-moving-average-from-data-stream.md
│ ├── 0347-top-k-frequent-elements.md
│ ├── 0348-design-tic-tac-toe.md
│ ├── 0349-intersection-of-two-arrays.md
│ ├── 0350-intersection-of-two-arrays-ii.md
│ ├── 0351-android-unlock-patterns.md
│ ├── 0352-data-stream-as-disjoint-intervals.md
│ ├── 0353-domino-and-tromino-tiling.md
│ ├── 0354-russian-doll-envelopes.md
│ ├── 0355-design-twitter.md
│ ├── 0358-rearrange-string-k-distance-apart.md
│ ├── 0359-logger-rate-limiter.md
│ ├── 0361-bomb-enemy.md
│ ├── 0362-design-hit-counter.md
│ ├── 0364-nested-list-weight-sum-ii.md
│ ├── 0366-find-leaves-of-binary-tree.md
│ ├── 0368-largest-divisible-subset.md
│ ├── 0370-range-addition.md
│ ├── 0371-sum-of-two-integers.md
│ ├── 0373-find-k-pairs-with-smallest-sums.md
│ ├── 0374-guess-number-higher-or-lower.md
│ ├── 0377-combination-sum-iv.md
│ ├── 0378-kth-smallest-element-in-a-sorted-matrix.md
│ ├── 0380-insert-delete-getrandom-o1.md
│ ├── 0383-ransom-note.md
│ ├── 0386-lexicographical-numbers.md
│ ├── 0387-first-unique-character-in-a-string.md
│ ├── 0388-longest-absolute-file-path.md
│ ├── 0389-find-the-difference.md
│ ├── 0390-elimination-game.md
│ ├── 0391-perfect-rectangle.md
│ ├── 0392-is-subsequence.md
│ ├── 0393-utf-8-validation.md
│ ├── 0394-decode-string.md
│ ├── 0395-longest-substring-with-at-least-k-repeating-characters.md
│ ├── 0396-rotate-function.md
│ ├── 0397-integer-replacement.md
│ ├── 0398-random-pick-index.md
│ ├── 0399-evaluate-division.md
│ ├── 0400-nth-digit.md
│ ├── 0401-binary-watch.md
│ ├── 0402-remove-k-digits.md
│ ├── 0403-frog-jump.md
│ ├── 0404-sum-of-left-leaves.md
│ ├── 0405-convert-a-number-to-hexadecimal.md
│ ├── 0406-queue-reconstruction-by-height.md
│ ├── 0407-trapping-rain-water-ii.md
│ ├── 0408-valid-word-abbreviation.md
│ ├── 0409-longest-palindrome.md
│ ├── 0410-split-array-largest-sum.md
│ ├── 0414-third-maximum-number.md
│ ├── 0416-partition-equal-subset-sum.md
│ ├── 0417-pacific-atlantic-water-flow.md
│ ├── 0424-longest-repeating-character-replacement.md
│ ├── 0425-word-squares.md
│ ├── 0426-convert-binary-search-tree-to-sorted-doubly-linked-list.md
│ ├── 0427-construct-quad-tree.md
│ ├── 0432-all-oone-data-structure.md
│ ├── 0433-minimum-genetic-mutation.md
│ ├── 0435-non-overlapping-intervals.md
│ ├── 0436-find-right-interval.md
│ ├── 0437-path-sum-iii.md
│ ├── 0438-find-all-anagrams-in-a-string.md
│ ├── 0439-ternary-expression-parser.md
│ ├── 0440-k-th-smallest-in-lexicographical-order.md
│ ├── 0442-find-all-duplicates-in-an-array.md
│ ├── 0443-string-compression.md
│ ├── 0444-sequence-reconstruction.md
│ ├── 0445-add-two-numbers-ii.md
│ ├── 0446-arithmetic-slices-ii-subsequence.md
│ ├── 0448-find-all-numbers-disappeared-in-an-array.md
│ ├── 0449-serialize-and-deserialize-bst.md
│ ├── 0450-delete-node-in-a-bst.md
│ ├── 0451-sort-characters-by-frequency.md
│ ├── 0452-minimum-number-of-arrows-to-burst-balloons.md
│ ├── 0455-assign-cookies.md
│ ├── 0456-132-pattern.md
│ ├── 0457-circular-array-loop.md
│ ├── 0458-poor-pigs.md
│ ├── 0459-repeated-substring-pattern.md
│ ├── 0460-lfu-cache.md
│ ├── 0463-island-perimeter.md
│ ├── 0465-optimal-account-balancing.md
│ ├── 0473-matchsticks-to-square.md
│ ├── 0474-ones-and-zeroes.md
│ ├── 0475-heaters.md
│ ├── 0476-number-complement.md
│ ├── 0485-max-consecutive-ones.md
│ ├── 0487-max-consecutive-ones-ii.md
│ ├── 0490-the-maze.md
│ ├── 0491-non-decreasing-subsequences.md
│ ├── 0493-reverse-pairs.md
│ ├── 0494-target-sum.md
│ ├── 0496-next-greater-element-i.md
│ ├── 0498-diagonal-traverse.md
│ ├── 0499-the-maze-iii.md
│ ├── 0501-find-mode-in-binary-search-tree.md
│ ├── 0502-ipo.md
│ ├── 0505-the-maze-ii.md
│ ├── 0506-relative-ranks.md
│ ├── 0509-fibonacci-number.md
│ ├── 0510-inorder-successor-in-bst-ii.md
│ ├── 0513-find-bottom-left-tree-value.md
│ ├── 0514-freedom-trail.md
│ ├── 0515-find-largest-value-in-each-tree-row.md
│ ├── 0516-longest-palindromic-subsequence.md
│ ├── 0518-coin-change-ii.md
│ ├── 0523-continuous-subarray-sum.md
│ ├── 0525-contiguous-array.md
│ ├── 0527-word-abbreviation.md
│ ├── 0528-random-pick-with-weight.md
│ ├── 0530-minimum-absolute-difference-in-bst.md
│ ├── 0532-k-diff-pairs-in-an-array.md
│ ├── 0539-minimum-time-difference.md
│ ├── 0540-single-element-in-a-sorted-array.md
│ ├── 0542-01-matrix.md
│ ├── 0543-diameter-of-binary-tree.md
│ ├── 0545-boundary-of-binary-tree.md
│ ├── 0547-number-of-provinces.md
│ ├── 0549-binary-tree-longest-consecutive-sequence-ii.md
│ ├── 0552-student-attendance-record-ii.md
│ ├── 0557-reverse-words-in-a-string-iii.md
│ ├── 0560-subarray-sum-equals-k.md
│ ├── 0561-array-partition.md
│ ├── 0564-find-the-closest-palindrome.md
│ ├── 0566-reshape-the-matrix.md
│ ├── 0567-permutation-in-string.md
│ ├── 0570-managers-with-at-least-5-direct-reports.md
│ ├── 0572-subtree-of-another-tree.md
│ ├── 0573-squirrel-simulation.md
│ ├── 0576-out-of-boundary-paths.md
│ ├── 0577-employee-bonus.md
│ ├── 0584-find-customer-referee.md
│ ├── 0588-design-in-memory-file-system.md
│ ├── 0590-n-ary-tree-postorder-traversal.md
│ ├── 0592-fraction-addition-and-subtraction.md
│ ├── 0594-longest-harmonious-subsequence.md
│ ├── 0595-big-countries.md
│ ├── 0605-can-place-flowers.md
│ ├── 0606-construct-string-from-binary-tree.md
│ ├── 0609-find-duplicate-file-in-system.md
│ ├── 0611-valid-triangle-number.md
│ ├── 0616-add-bold-tag-in-string.md
│ ├── 0617-merge-two-binary-trees.md
│ ├── 0620-not-boring-movies.md
│ ├── 0621-task-scheduler.md
│ ├── 0623-add-one-row-to-tree.md
│ ├── 0624-maximum-distance-in-arrays.md
│ ├── 0629-k-inverse-pairs-array.md
│ ├── 0632-smallest-range-covering-elements-from-k-lists.md
│ ├── 0633-sum-of-square-numbers.md
│ ├── 0636-exclusive-time-of-functions.md
│ ├── 0637-average-of-levels-in-binary-tree.md
│ ├── 0641-design-circular-deque.md
│ ├── 0643-maximum-average-subarray-i.md
│ ├── 0645-set-mismatch.md
│ ├── 0646-maximum-length-of-pair-chain.md
│ ├── 0647-palindromic-substrings.md
│ ├── 0648-replace-words.md
│ ├── 0649-dota2-senate.md
│ ├── 0650-2-keys-keyboard.md
│ ├── 0653-two-sum-iv-input-is-a-bst.md
│ ├── 0656-coin-path.md
│ ├── 0658-find-k-closest-elements.md
│ ├── 0661-image-smoother.md
│ ├── 0662-maximum-width-of-binary-tree.md
│ ├── 0663-equal-tree-partition.md
│ ├── 0664-strange-printer.md
│ ├── 0666-path-sum-iv.md
│ ├── 0670-maximum-swap.md
│ ├── 0677-map-sum-pairs.md
│ ├── 0678-valid-parenthesis-string.md
│ ├── 0679-24-game.md
│ ├── 0680-valid-palindrome-ii.md
│ ├── 0683-k-empty-slots.md
│ ├── 0684-redundant-connection.md
│ ├── 0689-maximum-sum-of-3-non-overlapping-subarrays.md
│ ├── 0692-top-k-frequent-words.md
│ ├── 0694-number-of-distinct-islands.md
│ ├── 0695-max-area-of-island.md
│ ├── 0700-search-in-a-binary-search-tree.md
│ ├── 0701-insert-into-a-binary-search-tree.md
│ ├── 0702-search-in-a-sorted-array-of-unknown-size.md
│ ├── 0703-kth-largest-element-in-a-stream.md
│ ├── 0704-binary-search.md
│ ├── 0705-design-hashset.md
│ ├── 0706-design-hashmap.md
│ ├── 0712-minimum-ascii-delete-sum-for-two-strings.md
│ ├── 0713-subarray-product-less-than-k.md
│ ├── 0714-best-time-to-buy-and-sell-stock-with-transaction-fee.md
│ ├── 0715-range-module.md
│ ├── 0716-max-stack.md
│ ├── 0717-1-bit-and-2-bit-characters.md
│ ├── 0718-maximum-length-of-repeated-subarray.md
│ ├── 0719-find-k-th-smallest-pair-distance.md
│ ├── 0721-accounts-merge.md
│ ├── 0723-candy-crush.md
│ ├── 0724-find-pivot-index.md
│ ├── 0725-split-linked-list-in-parts.md
│ ├── 0726-number-of-atoms.md
│ ├── 0727-minimum-window-subsequence.md
│ ├── 0729-my-calendar-i.md
│ ├── 0731-my-calendar-ii.md
│ ├── 0733-flood-fill.md
│ ├── 0734-sentence-similarity.md
│ ├── 0735-asteroid-collision.md
│ ├── 0737-sentence-similarity-ii.md
│ ├── 0739-daily-temperatures.md
│ ├── 0740-delete-and-earn.md
│ ├── 0741-cherry-pickup.md
│ ├── 0743-network-delay-time.md
│ ├── 0744-find-smallest-letter-greater-than-target.md
│ ├── 0746-min-cost-climbing-stairs.md
│ ├── 0752-open-the-lock.md
│ ├── 0756-pyramid-transition-matrix.md
│ ├── 0757-set-intersection-size-at-least-two.md
│ ├── 0758-bold-words-in-string.md
│ ├── 0759-employee-free-time.md
│ ├── 0763-partition-labels.md
│ ├── 0767-reorganize-string.md
│ ├── 0769-max-chunks-to-make-sorted.md
│ ├── 0773-sliding-puzzle.md
│ ├── 0774-minimize-max-distance-to-gas-station.md
│ ├── 0775-global-and-local-inversions.md
│ ├── 0776-split-bst.md
│ ├── 0778-swim-in-rising-water.md
│ ├── 0779-k-th-symbol-in-grammar.md
│ ├── 0781-rabbits-in-forest.md
│ ├── 0784-letter-case-permutation.md
│ ├── 0786-k-th-smallest-prime-fraction.md
│ ├── 0787-cheapest-flights-within-k-stops.md
│ ├── 0790-domino-and-tromino-tiling.md
│ ├── 0791-custom-sort-string.md
│ ├── 0794-valid-tic-tac-toe-state.md
│ ├── 0796-rotate-string.md
│ ├── 0797-all-paths-from-source-to-target.md
│ ├── 0799-champagne-tower.md
│ ├── 0802-find-eventual-safe-states.md
│ ├── 0807-max-increase-to-keep-city-skyline.md
│ ├── 0808-soup-servings.md
│ ├── 0812-largest-triangle-area.md
│ ├── 0814-binary-tree-pruning.md
│ ├── 0815-bus-routes.md
│ ├── 0817-linked-list-components.md
│ ├── 0823-binary-trees-with-factors.md
│ ├── 0826-most-profit-assigning-work.md
│ ├── 0827-making-a-large-island.md
│ ├── 0831-masking-personal-information.md
│ ├── 0832-flipping-an-image.md
│ ├── 0833-find-and-replace-in-string.md
│ ├── 0834-sum-of-distances-in-tree.md
│ ├── 0837-new-21-game.md
│ ├── 0838-push-dominoes.md
│ ├── 0840-magic-squares-in-grid.md
│ ├── 0841-keys-and-rooms.md
│ ├── 0844-backspace-string-compare.md
│ ├── 0845-longest-mountain-in-array.md
│ ├── 0846-hand-of-straights.md
│ ├── 0847-shortest-path-visiting-all-nodes.md
│ ├── 0849-maximize-distance-to-closest-person.md
│ ├── 0851-loud-and-rich.md
│ ├── 0852-peak-index-in-a-mountain-array.md
│ ├── 0853-car-fleet.md
│ ├── 0856-score-of-parentheses.md
│ ├── 0857-minimum-cost-to-hire-k-workers.md
│ ├── 0860-lemonade-change.md
│ ├── 0861-score-after-flipping-matrix.md
│ ├── 0862-shortest-subarray-with-sum-at-least-k.md
│ ├── 0863-all-nodes-distance-k-in-binary-tree.md
│ ├── 0865-smallest-subtree-with-all-the-deepest-nodes.md
│ ├── 0867-transpose-matrix.md
│ ├── 0869-reordered-power-of-2.md
│ ├── 0871-minimum-number-of-refueling-stops.md
│ ├── 0872-leaf-similar-trees.md
│ ├── 0873-length-of-longest-fibonacci-subsequence.md
│ ├── 0874-walking-robot-simulation.md
│ ├── 0875-koko-eating-bananas.md
│ ├── 0876-middle-of-the-linked-list.md
│ ├── 0880-decoded-string-at-index.md
│ ├── 0881-boats-to-save-people.md
│ ├── 0884-uncommon-words-from-two-sentences.md
│ ├── 0885-spiral-matrix-iii.md
│ ├── 0888-fair-candy-swap.md
│ ├── 0889-construct-binary-tree-from-preorder-and-postorder-traversal.md
│ ├── 0890-find-and-replace-pattern.md
│ ├── 0894-all-possible-full-binary-trees.md
│ ├── 0895-maximum-frequency-stack.md
│ ├── 0896-monotonic-array.md
│ ├── 0898-bitwise-ors-of-subarrays.md
│ ├── 0900-rle-iterator.md
│ ├── 0901-online-stock-span.md
│ ├── 0904-fruit-into-baskets.md
│ ├── 0905-sort-array-by-parity.md
│ ├── 0907-sum-of-subarray-minimums.md
│ ├── 0909-snakes-and-ladders.md
│ ├── 0912-sort-an-array.md
│ ├── 0915-partition-array-into-disjoint-intervals.md
│ ├── 0916-word-subsets.md
│ ├── 0918-maximum-sum-circular-subarray.md
│ ├── 0920-number-of-music-playlists.md
│ ├── 0921-minimum-add-to-make-parentheses-valid.md
│ ├── 0924-minimize-malware-spread.md
│ ├── 0930-binary-subarrays-with-sum.md
│ ├── 0931-minimum-falling-path-sum.md
│ ├── 0933-number-of-recent-calls.md
│ ├── 0934-shortest-bridge.md
│ ├── 0935-knight-dialer.md
│ ├── 0938-range-sum-of-bst.md
│ ├── 0939-minimum-area-rectangle.md
│ ├── 0941-valid-mountain-array.md
│ ├── 0944-delete-columns-to-make-sorted.md
│ ├── 0945-minimum-increment-to-make-array-unique.md
│ ├── 0946-validate-stack-sequences.md
│ ├── 0947-most-stones-removed-with-same-row-or-column.md
│ ├── 0948-bag-of-tokens.md
│ ├── 0949-largest-time-for-given-digits.md
│ ├── 0950-reveal-cards-in-increasing-order.md
│ ├── 0951-flip-equivalent-binary-trees.md
│ ├── 0953-verifying-an-alien-dictionary.md
│ ├── 0954-array-of-doubled-pairs.md
│ ├── 0955-delete-columns-to-make-sorted-ii.md
│ ├── 0958-check-completeness-of-a-binary-tree.md
│ ├── 0959-regions-cut-by-slashes.md
│ ├── 0960-delete-columns-to-make-sorted-iii.md
│ ├── 0961-n-repeated-element-in-size-2n-array.md
│ ├── 0962-maximum-width-ramp.md
│ ├── 0966-vowel-spellchecker.md
│ ├── 0967-numbers-with-same-consecutive-differences.md
│ ├── 0969-pancake-sorting.md
│ ├── 0973-k-closest-points-to-origin.md
│ ├── 0974-subarray-sums-divisible-by-k.md
│ ├── 0976-largest-perimeter-triangle.md
│ ├── 0977-squares-of-a-sorted-array.md
│ ├── 0978-longest-turbulent-subarray.md
│ ├── 0979-distribute-coins-in-binary-tree.md
│ ├── 0981-time-based-key-value-store.md
│ ├── 0983-minimum-cost-for-tickets.md
│ ├── 0984-string-without-aaa-or-bbb.md
│ ├── 0986-interval-list-intersections.md
│ ├── 0987-vertical-order-traversal-of-a-binary-tree.md
│ ├── 0988-smallest-string-starting-from-leaf.md
│ ├── 0992-subarrays-with-k-different-integers.md
│ ├── 0993-cousins-in-binary-tree.md
│ ├── 0994-rotting-oranges.md
│ ├── 0995-minimum-number-of-k-consecutive-bit-flips.md
│ ├── 0997-find-the-town-judge.md
│ ├── 0998-maximum-binary-tree-ii.md
│ ├── 1002-find-common-characters.md
│ ├── 1003-check-if-word-is-valid-after-substitutions.md
│ ├── 1004-max-consecutive-ones-iii.md
│ ├── 1006-clumsy-factorial.md
│ ├── 1007-minimum-domino-rotations-for-equal-row.md
│ ├── 1008-construct-binary-search-tree-from-preorder-traversal.md
│ ├── 1009-complement-of-base-10-integer.md
│ ├── 1010-pairs-of-songs-with-total-durations-divisible-by-60.md
│ ├── 1011-capacity-to-ship-packages-within-d-days.md
│ ├── 1014-best-sightseeing-pair.md
│ ├── 1015-smallest-integer-divisible-by-k.md
│ ├── 1018-binary-prefix-divisible-by-5.md
│ ├── 1019-next-greater-node-in-linked-list.md
│ ├── 1023-camelcase-matching.md
│ ├── 1026-maximum-difference-between-node-and-ancestor.md
│ ├── 1028-recover-a-tree-from-preorder-traversal.md
│ ├── 1029-two-city-scheduling.md
│ ├── 1033-moving-stones-until-consecutive.md
│ ├── 1039-minimum-score-triangulation-of-polygon.md
│ ├── 1041-robot-bounded-in-circle.md
│ ├── 1043-partition-array-for-maximum-sum.md
│ ├── 1046-last-stone-weight.md
│ ├── 1047-remove-all-adjacent-duplicates-in-string.md
│ ├── 1048-longest-string-chain.md
│ ├── 1051-height-checker.md
│ ├── 1052-grumpy-bookstore-owner.md
│ ├── 1055-shortest-way-to-form-string.md
│ ├── 1057-campus-bikes.md
│ ├── 1060-missing-element-in-sorted-array.md
│ ├── 1061-lexicographically-smallest-equivalent-string.md
│ ├── 1062-longest-repeating-substring.md
│ ├── 1063-number-of-valid-subarrays.md
│ ├── 1065-index-pairs-of-a-string.md
│ ├── 1066-campus-bikes-ii.md
│ ├── 1068-product-sales-analysis-i.md
│ ├── 1071-greatest-common-divisor-of-strings.md
│ ├── 1072-flip-columns-for-maximum-number-of-equal-rows.md
│ ├── 1074-number-of-submatrices-that-sum-to-target.md
│ ├── 1075-project-employees-i.md
│ ├── 1079-letter-tile-possibilities.md
│ ├── 1081-smallest-subsequence-of-distinct-characters.md
│ ├── 1086-high-five.md
│ ├── 1087-brace-expansion.md
│ ├── 1090-largest-values-from-labels.md
│ ├── 1091-shortest-path-in-binary-matrix.md
│ ├── 1092-shortest-common-supersequence.md
│ ├── 1093-statistics-from-a-large-sample.md
│ ├── 1094-car-pooling.md
│ ├── 1095-find-in-mountain-array.md
│ ├── 1097-stream-of-characters.md
│ ├── 1099-two-sum-less-than-k.md
│ ├── 1100-find-k-length-substrings-with-no-repeated-characters.md
│ ├── 1101-the-earliest-moment-when-everyone-become-friends.md
│ ├── 1104-path-in-zigzag-labelled-binary-tree.md
│ ├── 1105-filling-bookcase-shelves.md
│ ├── 1106-parsing-a-boolean-expression.md
│ ├── 1109-corporate-flight-bookings.md
│ ├── 1110-delete-nodes-and-return-forest.md
│ ├── 1119-remove-vowels-from-a-string.md
│ ├── 1120-maximum-average-subtree.md
│ ├── 1121-divide-array-into-increasing-sequences.md
│ ├── 1122-relative-sort-array.md
│ ├── 1123-lowest-common-ancestor-of-deepest-leaves.md
│ ├── 1128-number-of-equivalent-domino-pairs.md
│ ├── 1133-largest-unique-number.md
│ ├── 1135-connecting-cities-with-minimum-cost.md
│ ├── 1136-parallel-courses.md
│ ├── 1137-n-th-tribonacci-number.md
│ ├── 1138-alphabet-board-path.md
│ ├── 1140-stone-game-ii.md
│ ├── 1143-longest-common-subsequence.md
│ ├── 1144-decrease-elements-to-make-array-zigzag.md
│ ├── 1146-snapshot-array.md
│ ├── 1148-article-views-i.md
│ ├── 1150-check-if-a-number-is-majority-element-in-a-sorted-array.md
│ ├── 1151-minimum-swaps-to-group-all-1s-together.md
│ ├── 1152-analyze-user-website-visit-pattern.md
│ ├── 1155-number-of-dice-rolls-with-target-sum.md
│ ├── 1160-find-words-that-can-be-formed-by-characters.md
│ ├── 1161-maximum-level-sum-of-a-binary-tree.md
│ ├── 1165-single-row-keyboard.md
│ ├── 1166-design-file-system.md
│ ├── 1167-minimum-cost-to-connect-sticks.md
│ ├── 1168-optimize-water-distribution-in-a-village.md
│ ├── 1170-compare-strings-by-frequency-of-the-smallest-character.md
│ ├── 1171-remove-zero-sum-consecutive-nodes-from-linked-list.md
│ ├── 1176-diet-plan-performance.md
│ ├── 1181-before-and-after-puzzle.md
│ ├── 1182-shortest-distance-to-target-color.md
│ ├── 1183-maximum-number-of-ones.md
│ ├── 1190-reverse-substrings-between-each-pair-of-parentheses.md
│ ├── 1192-critical-connections-in-a-network.md
│ ├── 1197-minimum-knight-moves.md
│ ├── 1198-find-smallest-common-element-in-all-rows.md
│ ├── 1199-minimum-time-to-build-blocks.md
│ ├── 1200-minimum-absolute-difference.md
│ ├── 1202-smallest-string-with-swaps.md
│ ├── 1203-sort-items-by-groups-respecting-dependencies.md
│ ├── 1207-unique-number-of-occurrences.md
│ ├── 1208-get-equal-substrings-within-budget.md
│ ├── 1209-remove-all-adjacent-duplicates-in-string-ii.md
│ ├── 1213-intersection-of-three-sorted-arrays.md
│ ├── 1214-two-sum-bsts.md
│ ├── 1216-valid-palindrome-iii.md
│ ├── 1219-path-with-maximum-gold.md
│ ├── 1220-count-vowels-permutation.md
│ ├── 1222-queens-that-can-attack-the-king.md
│ ├── 1229-meeting-scheduler.md
│ ├── 1230-toss-strange-coins.md
│ ├── 1233-remove-sub-folders-from-the-filesystem.md
│ ├── 1235-maximum-profit-in-job-scheduling.md
│ ├── 1239-maximum-length-of-a-concatenated-string-with-unique-characters.md
│ ├── 1244-design-a-leaderboard.md
│ ├── 1245-tree-diameter.md
│ ├── 1248-count-number-of-nice-subarrays.md
│ ├── 1249-minimum-remove-to-make-valid-parentheses.md
│ ├── 1251-average-selling-price.md
│ ├── 1253-reconstruct-a-2-row-binary-matrix.md
│ ├── 1254-number-of-closed-islands.md
│ ├── 1255-maximum-score-words-formed-by-letters.md
│ ├── 1256-encode-number.md
│ ├── 1257-smallest-common-region.md
│ ├── 1261-find-elements-in-a-contaminated-binary-tree.md
│ ├── 1262-greatest-sum-divisible-by-three.md
│ ├── 1265-print-immutable-linked-list-in-reverse.md
│ ├── 1266-minimum-time-visiting-all-points.md
│ ├── 1267-count-servers-that-communicate.md
│ ├── 1268-search-suggestions-system.md
│ ├── 1269-number-of-ways-to-stay-in-the-same-place-after-some-steps.md
│ ├── 1272-remove-interval.md
│ ├── 1276-number-of-burgers-with-no-waste-of-ingredients.md
│ ├── 1277-count-square-submatrices-with-all-ones.md
│ ├── 1280-students-and-examinations.md
│ ├── 1282-group-the-people-given-the-group-size-they-belong-to.md
│ ├── 1283-find-the-smallest-divisor-given-a-threshold.md
│ ├── 1287-element-appearing-more-than-25-in-sorted-array.md
│ ├── 1288-remove-covered-intervals.md
│ ├── 1289-minimum-falling-path-sum-ii.md
│ ├── 1290-convert-binary-number-in-a-linked-list-to-integer.md
│ ├── 1291-sequential-digits.md
│ ├── 1292-maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold.md
│ ├── 1295-find-numbers-with-even-number-of-digits.md
│ ├── 1296-divide-array-in-sets-of-k-consecutive-numbers.md
│ ├── 1298-maximum-candies-you-can-get-from-boxes.md
│ ├── 1300-sum-of-mutated-array-closest-to-target.md
│ ├── 1302-deepest-leaves-sum.md
│ ├── 1304-find-n-unique-integers-sum-up-to-zero.md
│ ├── 1305-all-elements-in-two-binary-search-trees.md
│ ├── 1306-jump-game-iii.md
│ ├── 1310-xor-queries-of-a-subarray.md
│ ├── 1314-matrix-block-sum.md
│ ├── 1315-sum-of-nodes-with-even-valued-grandparent.md
│ ├── 1317-convert-integer-to-the-sum-of-two-no-zero-integers.md
│ ├── 1318-minimum-flips-to-make-a-or-b-equal-to-c.md
│ ├── 1323-maximum-69-number.md
│ ├── 1324-print-words-vertically.md
│ ├── 1325-delete-leaves-with-a-given-value.md
│ ├── 1326-minimum-number-of-taps-to-open-to-water-a-garden.md
│ ├── 1328-break-a-palindrome.md
│ ├── 1329-sort-the-matrix-diagonally.md
│ ├── 1331-rank-transform-of-an-array.md
│ ├── 1333-filter-restaurants-by-vegan-friendly-price-and-distance.md
│ ├── 1334-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance.md
│ ├── 1335-minimum-difficulty-of-a-job-schedule.md
│ ├── 1337-the-k-weakest-rows-in-a-matrix.md
│ ├── 1338-reduce-array-size-to-the-half.md
│ ├── 1339-maximum-product-of-splitted-binary-tree.md
│ ├── 1343-number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold.md
│ ├── 1344-angle-between-hands-of-a-clock.md
│ ├── 1346-check-if-n-and-its-double-exist.md
│ ├── 1347-minimum-number-of-steps-to-make-two-strings-anagram.md
│ ├── 1351-count-negative-numbers-in-a-sorted-matrix.md
│ ├── 1352-product-of-the-last-k-numbers.md
│ ├── 1353-maximum-number-of-events-that-can-be-attended.md
│ ├── 1356-sort-integers-by-the-number-of-1-bits.md
│ ├── 1357-apply-discount-every-n-orders.md
│ ├── 1358-number-of-substrings-containing-all-three-characters.md
│ ├── 1359-count-all-valid-pickup-and-delivery-options.md
│ ├── 1360-number-of-days-between-two-dates.md
│ ├── 1361-validate-binary-tree-nodes.md
│ ├── 1362-closest-divisors.md
│ ├── 1365-how-many-numbers-are-smaller-than-the-current-number.md
│ ├── 1366-rank-teams-by-votes.md
│ ├── 1367-linked-list-in-binary-tree.md
│ ├── 1368-minimum-cost-to-make-at-least-one-valid-path-in-a-grid.md
│ ├── 1371-find-the-longest-substring-containing-vowels-in-even-counts.md
│ ├── 1372-longest-zigzag-path-in-a-binary-tree.md
│ ├── 1375-number-of-times-binary-string-is-prefix-aligned.md
│ ├── 1376-time-needed-to-inform-all-employees.md
│ ├── 1378-replace-employee-id-with-the-unique-identifier.md
│ ├── 1380-lucky-numbers-in-a-matrix.md
│ ├── 1381-design-a-stack-with-increment-operation.md
│ ├── 1385-find-the-distance-value-between-two-arrays.md
│ ├── 1387-sort-integers-by-the-power-value.md
│ ├── 1390-four-divisors.md
│ ├── 1394-find-lucky-integer-in-an-array.md
│ ├── 1395-count-number-of-teams.md
│ ├── 1396-design-underground-system.md
│ ├── 1399-count-largest-group.md
│ ├── 1400-construct-k-palindrome-strings.md
│ ├── 1404-number-of-steps-to-reduce-a-number-in-binary-representation-to-one.md
│ ├── 1405-longest-happy-string.md
│ ├── 1408-string-matching-in-an-array.md
│ ├── 1409-queries-on-a-permutation-with-key.md
│ ├── 1410-html-entity-parser.md
│ ├── 1411-number-of-ways-to-paint-n-3-grid.md
│ ├── 1414-find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k.md
│ ├── 1415-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n.md
│ ├── 1418-display-table-of-food-orders-in-a-restaurant.md
│ ├── 1420-build-array-where-you-can-find-the-maximum-exactly-k-comparisons.md
│ ├── 1422-maximum-score-after-splitting-a-string.md
│ ├── 1423-maximum-points-you-can-obtain-from-cards.md
│ ├── 1424-diagonal-traverse-ii.md
│ ├── 1425-constrained-subsequence-sum.md
│ ├── 1427-perform-string-shifts.md
│ ├── 1428-leftmost-column-with-at-least-a-one.md
│ ├── 1429-first-unique-number.md
│ ├── 1431-kids-with-the-greatest-number-of-candies.md
│ ├── 1432-max-difference-you-can-get-from-changing-an-integer.md
│ ├── 1433-check-if-a-string-can-break-another-string.md
│ ├── 1436-destination-city.md
│ ├── 1437-check-if-all-1s-are-at-least-length-k-places-away.md
│ ├── 1438-longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit.md
│ ├── 1441-build-an-array-with-stack-operations.md
│ ├── 1442-count-triplets-that-can-form-two-arrays-of-equal-xor.md
│ ├── 1447-simplified-fractions.md
│ ├── 1448-count-good-nodes-in-binary-tree.md
│ ├── 1451-rearrange-words-in-a-sentence.md
│ ├── 1452-people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list.md
│ ├── 1455-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence.md
│ ├── 1456-maximum-number-of-vowels-in-a-substring-of-given-length.md
│ ├── 1457-pseudo-palindromic-paths-in-a-binary-tree.md
│ ├── 1458-max-dot-product-of-two-subsequences.md
│ ├── 1460-make-two-arrays-equal-by-reversing-subarrays.md
│ ├── 1461-check-if-a-string-contains-all-binary-codes-of-size-k.md
│ ├── 1462-course-schedule-iv.md
│ ├── 1464-maximum-product-of-two-elements-in-an-array.md
│ ├── 1465-maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts.md
│ ├── 1466-reorder-routes-to-make-all-paths-lead-to-the-city-zero.md
│ ├── 1469-find-all-the-lonely-nodes.md
│ ├── 1470-shuffle-the-array.md
│ ├── 1471-the-k-strongest-values-in-an-array.md
│ ├── 1472-design-browser-history.md
│ ├── 1474-delete-n-nodes-after-m-nodes-of-a-linked-list.md
│ ├── 1475-final-prices-with-a-special-discount-in-a-shop.md
│ ├── 1476-subrectangle-queries.md
│ ├── 1481-least-number-of-unique-integers-after-k-removals.md
│ ├── 1482-minimum-number-of-days-to-make-m-bouquets.md
│ ├── 1488-avoid-flood-in-the-city.md
│ ├── 1489-find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree.md
│ ├── 1492-the-kth-factor-of-n.md
│ ├── 1493-longest-subarray-of-1s-after-deleting-one-element.md
│ ├── 1496-path-crossing.md
│ ├── 1497-check-if-array-pairs-are-divisible-by-k.md
│ ├── 1498-number-of-subsequences-that-satisfy-the-given-sum-condition.md
│ ├── 1503-last-moment-before-all-ants-fall-out-of-a-plank.md
│ ├── 1508-range-sum-of-sorted-subarray-sums.md
│ ├── 1509-minimum-difference-between-largest-and-smallest-value-in-three-moves.md
│ ├── 1512-number-of-good-pairs.md
│ ├── 1513-number-of-substrings-with-only-1s.md
│ ├── 1514-path-with-maximum-probability.md
│ ├── 1518-water-bottles.md
│ ├── 1523-count-odd-numbers-in-an-interval-range.md
│ ├── 1524-number-of-sub-arrays-with-odd-sum.md
│ ├── 1525-number-of-good-ways-to-split-a-string.md
│ ├── 1526-minimum-number-of-increments-on-subarrays-to-form-a-target-array.md
│ ├── 1529-minimum-suffix-flips.md
│ ├── 1530-number-of-good-leaf-nodes-pairs.md
│ ├── 1531-string-compression-ii.md
│ ├── 1534-count-good-triplets.md
│ ├── 1535-find-the-winner-of-an-array-game.md
│ ├── 1539-kth-missing-positive-number.md
│ ├── 1544-make-the-string-great.md
│ ├── 1545-find-kth-bit-in-nth-binary-string.md
│ ├── 1550-three-consecutive-odds.md
│ ├── 1551-minimum-operations-to-make-array-equal.md
│ ├── 1552-magnetic-force-between-two-balls.md
│ ├── 1557-minimum-number-of-vertices-to-reach-all-nodes.md
│ ├── 1561-maximum-number-of-coins-you-can-get.md
│ ├── 1568-minimum-number-of-days-to-disconnect-island.md
│ ├── 1570-dot-product-of-two-sparse-vectors.md
│ ├── 1574-shortest-subarray-to-be-removed-to-make-array-sorted.md
│ ├── 1578-minimum-time-to-make-rope-colorful.md
│ ├── 1580-put-boxes-into-the-warehouse-ii.md
│ ├── 1581-customer-who-visited-but-did-not-make-any-transactions.md
│ ├── 1582-special-positions-in-a-binary-matrix.md
│ ├── 1584-min-cost-to-connect-all-points.md
│ ├── 1590-make-sum-divisible-by-p.md
│ ├── 1593-split-a-string-into-the-max-number-of-unique-substrings.md
│ ├── 1598-crawler-log-folder.md
│ ├── 1605-find-valid-matrix-given-row-and-column-sums.md
│ ├── 1608-special-array-with-x-elements-greater-than-or-equal-x.md
│ ├── 1609-even-odd-tree.md
│ ├── 1611-minimum-one-bit-operations-to-make-integers-zero.md
│ ├── 1614-maximum-nesting-depth-of-the-parentheses.md
│ ├── 1615-maximal-network-rank.md
│ ├── 1624-largest-substring-between-two-equal-characters.md
│ ├── 1625-lexicographically-smallest-string-after-applying-operations.md
│ ├── 1630-arithmetic-subarrays.md
│ ├── 1631-path-with-minimum-effort.md
│ ├── 1633-percentage-of-users-attended-a-contest.md
│ ├── 1634-add-two-polynomials-represented-as-linked-lists.md
│ ├── 1636-sort-array-by-increasing-frequency.md
│ ├── 1639-number-of-ways-to-form-a-target-string-given-a-dictionary.md
│ ├── 1641-count-sorted-vowel-strings.md
│ ├── 1642-furthest-building-you-can-reach.md
│ ├── 1644-lowest-common-ancestor-of-a-binary-tree-ii.md
│ ├── 1647-minimum-deletions-to-make-character-frequencies-unique.md
│ ├── 1650-lowest-common-ancestor-of-a-binary-tree-iii.md
│ ├── 1652-defuse-the-bomb.md
│ ├── 1653-minimum-deletions-to-make-string-balanced.md
│ ├── 1657-determine-if-two-strings-are-close.md
│ ├── 1658-minimum-operations-to-reduce-x-to-zero.md
│ ├── 1660-correct-a-binary-tree.md
│ ├── 1661-average-time-of-process-per-machine.md
│ ├── 1662-check-if-two-string-arrays-are-equivalent.md
│ ├── 1663-smallest-string-with-a-given-numeric-value.md
│ ├── 1669-merge-in-between-linked-lists.md
│ ├── 1671-minimum-number-of-removals-to-make-mountain-array.md
│ ├── 1679-max-number-of-k-sum-pairs.md
│ ├── 1683-invalid-tweets.md
│ ├── 1684-count-the-number-of-consistent-strings.md
│ ├── 1685-sum-of-absolute-differences-in-a-sorted-array.md
│ ├── 1688-count-of-matches-in-tournament.md
│ ├── 1689-partitioning-into-minimum-number-of-deci-binary-numbers.md
│ ├── 1695-maximum-erasure-value.md
│ ├── 1700-number-of-students-unable-to-eat-lunch.md
│ ├── 1701-average-waiting-time.md
│ ├── 1704-determine-if-string-halves-are-alike.md
│ ├── 1706-where-will-the-ball-fall.md
│ ├── 1716-calculate-money-in-leetcode-bank.md
│ ├── 1717-maximum-score-from-removing-substrings.md
│ ├── 1718-construct-the-lexicographically-largest-valid-sequence.md
│ ├── 1721-swapping-nodes-in-a-linked-list.md
│ ├── 1726-tuple-with-same-product.md
│ ├── 1727-largest-submatrix-with-rearrangements.md
│ ├── 1730-shortest-path-to-get-food.md
│ ├── 1732-find-the-highest-altitude.md
│ ├── 1733-minimum-number-of-people-to-teach.md
│ ├── 1740-find-distance-in-a-binary-tree.md
│ ├── 1743-restore-the-array-from-adjacent-pairs.md
│ ├── 1746-maximum-subarray-sum-after-one-operation.md
│ ├── 1749-maximum-absolute-sum-of-any-subarray.md
│ ├── 1750-minimum-length-of-string-after-deleting-similar-ends.md
│ ├── 1752-check-if-array-is-sorted-and-rotated.md
│ ├── 1753-maximum-score-from-removing-stones.md
│ ├── 1756-design-most-recently-used-queue.md
│ ├── 1757-recyclable-and-low-fat-products.md
│ ├── 1758-minimum-changes-to-make-alternating-binary-string.md
│ ├── 1759-count-number-of-homogenous-substrings.md
│ ├── 1760-minimum-limit-of-balls-in-a-bag.md
│ ├── 1762-buildings-with-an-ocean-view.md
│ ├── 1765-map-of-highest-peak.md
│ ├── 1768-merge-strings-alternately.md
│ ├── 1769-minimum-number-of-operations-to-move-all-balls-to-each-box.md
│ ├── 1770-maximum-score-from-performing-multiplication-operations.md
│ ├── 1780-check-if-number-is-a-sum-of-powers-of-three.md
│ ├── 1785-minimum-elements-to-add-to-form-a-given-sum.md
│ ├── 1790-check-if-one-string-swap-can-make-strings-equal.md
│ ├── 1791-find-center-of-star-graph.md
│ ├── 1792-maximum-average-pass-ratio.md
│ ├── 1793-maximum-score-of-a-good-subarray.md
│ ├── 1797-design-authentication-manager.md
│ ├── 1800-maximum-ascending-subarray-sum.md
│ ├── 1802-maximum-value-at-a-given-index-in-a-bounded-array.md
│ ├── 1804-implement-trie-ii-prefix-tree.md
│ ├── 1806-minimum-number-of-operations-to-reinitialize-a-permutation.md
│ ├── 1807-evaluate-the-bracket-pairs-of-a-string.md
│ ├── 1813-sentence-similarity-iii.md
│ ├── 1814-count-nice-pairs-in-an-array.md
│ ├── 1817-finding-the-users-active-minutes.md
│ ├── 1823-find-the-winner-of-the-circular-game.md
│ ├── 1828-queries-on-number-of-points-inside-a-circle.md
│ ├── 1829-maximum-xor-for-each-query.md
│ ├── 1833-maximum-ice-cream-bars.md
│ ├── 1834-single-threaded-cpu.md
│ ├── 1836-remove-duplicates-from-an-unsorted-linked-list.md
│ ├── 1838-frequency-of-the-most-frequent-element.md
│ ├── 1842-next-palindrome-using-same-digits.md
│ ├── 1845-seat-reservation-manager.md
│ ├── 1846-maximum-element-after-decreasing-and-rearranging.md
│ ├── 1851-minimum-interval-to-include-each-query.md
│ ├── 1852-distinct-numbers-in-each-subarray.md
│ ├── 1855-maximum-distance-between-a-pair-of-values.md
│ ├── 1857-largest-color-value-in-a-directed-graph.md
│ ├── 1858-longest-word-with-all-prefixes.md
│ ├── 1860-incremental-memory-leak.md
│ ├── 1861-rotating-the-box.md
│ ├── 1863-sum-of-all-subset-xor-totals.md
│ ├── 1865-finding-pairs-with-a-certain-sum.md
│ ├── 1870-minimum-speed-to-arrive-on-time.md
│ ├── 1874-minimize-product-sum-of-two-arrays.md
│ ├── 1877-minimize-maximum-pair-sum-in-array.md
│ ├── 1881-maximum-value-after-insertion.md
│ ├── 1885-count-pairs-in-two-arrays.md
│ ├── 1887-reduction-operations-to-make-the-array-elements-equal.md
│ ├── 1888-minimum-number-of-flips-to-make-the-binary-string-alternating.md
│ ├── 1891-cutting-ribbons.md
│ ├── 1894-find-the-student-that-will-replace-the-chalk.md
│ ├── 1895-largest-magic-square.md
│ ├── 1897-redistribute-characters-to-make-all-strings-equal.md
│ ├── 1898-maximum-number-of-removable-characters.md
│ ├── 1899-merge-triplets-to-form-target-triplet.md
│ ├── 1900-the-earliest-and-latest-rounds-where-players-compete.md
│ ├── 1903-largest-odd-number-in-string.md
│ ├── 1904-the-number-of-full-rounds-you-have-played.md
│ ├── 1905-count-sub-islands.md
│ ├── 1910-remove-all-occurrences-of-a-substring.md
│ ├── 1912-design-movie-rental-system.md
│ ├── 1913-maximum-product-difference-between-two-pairs.md
│ ├── 1915-number-of-wonderful-substrings.md
│ ├── 1920-build-array-from-permutation.md
│ ├── 1921-eliminate-maximum-number-of-monsters.md
│ ├── 1922-count-good-numbers.md
│ ├── 1925-count-square-sum-triples.md
│ ├── 1926-nearest-exit-from-entrance-in-maze.md
│ ├── 1929-concatenation-of-array.md
│ ├── 1930-unique-length-3-palindromic-subsequences.md
│ ├── 1931-painting-a-grid-with-three-different-colors.md
│ ├── 1934-confirmation-rate.md
│ ├── 1935-maximum-number-of-words-you-can-type.md
│ ├── 1936-add-minimum-number-of-rungs.md
│ ├── 1937-maximum-number-of-points-with-cost.md
│ ├── 1940-longest-common-subsequence-between-sorted-arrays.md
│ ├── 1942-the-number-of-the-smallest-unoccupied-chair.md
│ ├── 1945-sum-of-digits-of-string-after-convert.md
│ ├── 1946-largest-number-after-mutating-substring.md
│ ├── 1948-delete-duplicate-folders-in-system.md
│ ├── 1957-delete-characters-to-make-fancy-string.md
│ ├── 1962-remove-stones-to-minimize-the-total.md
│ ├── 1963-minimum-number-of-swaps-to-make-the-string-balanced.md
│ ├── 1968-array-with-elements-not-equal-to-average-of-neighbors.md
│ ├── 1970-last-day-where-you-can-still-cross.md
│ ├── 1971-find-if-path-exists-in-graph.md
│ ├── 1973-count-nodes-equal-to-sum-of-descendants.md
│ ├── 1975-maximum-matrix-sum.md
│ ├── 1976-number-of-ways-to-arrive-at-destination.md
│ ├── 1980-find-unique-binary-string.md
│ ├── 1984-minimum-difference-between-highest-and-lowest-of-k-scores.md
│ ├── 1985-find-the-kth-largest-integer-in-the-array.md
│ ├── 1992-find-all-groups-of-farmland.md
│ ├── 2000-reverse-prefix-of-word.md
│ ├── 2001-number-of-pairs-of-interchangeable-rectangles.md
│ ├── 2002-maximum-product-of-the-length-of-two-palindromic-subsequences.md
│ ├── 2007-find-original-array-from-doubled-array.md
│ ├── 2009-minimum-number-of-operations-to-make-array-continuous.md
│ ├── 2011-final-value-of-variable-after-performing-operations.md
│ ├── 2012-sum-of-beauty-in-the-array.md
│ ├── 2013-detect-squares.md
│ ├── 2014-longest-subsequence-repeated-k-times.md
│ ├── 2016-maximum-difference-between-increasing-elements.md
│ ├── 2017-grid-game.md
│ ├── 2022-convert-1d-array-into-2d-array.md
│ ├── 2023-number-of-pairs-of-strings-with-concatenation-equal-to-target.md
│ ├── 2028-find-missing-observations.md
│ ├── 2033-minimum-operations-to-make-a-uni-value-grid.md
│ ├── 2034-stock-price-fluctuation.md
│ ├── 2035-partition-array-into-two-arrays-to-minimize-sum-difference.md
│ ├── 2037-minimum-number-of-moves-to-seat-everyone.md
│ ├── 2038-remove-colored-pieces-if-both-neighbors-are-the-same-color.md
│ ├── 2040-kth-smallest-product-of-two-sorted-arrays.md
│ ├── 2043-simple-bank-system.md
│ ├── 2044-count-number-of-maximum-bitwise-or-subsets.md
│ ├── 2045-second-minimum-time-to-reach-destination.md
│ ├── 2048-next-greater-numerically-balanced-number.md
│ ├── 2050-parallel-courses-iii.md
│ ├── 2053-kth-distinct-string-in-an-array.md
│ ├── 2054-two-best-non-overlapping-events.md
│ ├── 2055-plates-between-candles.md
│ ├── 2058-find-the-minimum-and-maximum-number-of-nodes-between-critical-points.md
│ ├── 2061-number-of-spaces-cleaning-robot-cleaned.md
│ ├── 2062-count-vowel-substrings-of-a-string.md
│ ├── 2064-minimized-maximum-of-products-distributed-to-any-store.md
│ ├── 2070-most-beautiful-item-for-each-query.md
│ ├── 2071-maximum-number-of-tasks-you-can-assign.md
│ ├── 2073-time-needed-to-buy-tickets.md
│ ├── 2074-reverse-nodes-in-even-length-groups.md
│ ├── 2077-paths-in-maze-that-lead-to-same-room.md
│ ├── 2079-watering-plants.md
│ ├── 2081-sum-of-k-mirror-numbers.md
│ ├── 2083-substrings-that-begin-and-end-with-the-same-letter.md
│ ├── 2089-find-target-indices-after-sorting-array.md
│ ├── 2090-k-radius-subarray-averages.md
│ ├── 2091-removing-minimum-and-maximum-from-array.md
│ ├── 2092-find-all-people-with-secret.md
│ ├── 2094-finding-3-digit-even-numbers.md
│ ├── 2095-delete-the-middle-node-of-a-linked-list.md
│ ├── 2097-valid-arrangement-of-pairs.md
│ ├── 2099-find-subsequence-of-length-k-with-the-largest-sum.md
│ ├── 2101-detonate-the-maximum-bombs.md
│ ├── 2104-total-characters-in-string-after-transformations-i.md
│ ├── 2105-watering-plants-ii.md
│ ├── 2106-maximum-fruits-harvested-after-at-most-k-steps.md
│ ├── 2107-number-of-unique-flavors-after-sharing-k-candies.md
│ ├── 2108-find-first-palindromic-string-in-the-array.md
│ ├── 2109-adding-spaces-to-a-string.md
│ ├── 2110-number-of-smooth-descent-periods-of-a-stock.md
│ ├── 2115-find-all-possible-recipes-from-given-supplies.md
│ ├── 2116-check-if-a-parentheses-string-can-be-valid.md
│ ├── 2120-execution-of-all-suffix-instructions-staying-in-a-grid.md
│ ├── 2125-number-of-laser-beams-in-a-bank.md
│ ├── 2127-maximum-employees-to-be-invited-to-a-meeting.md
│ ├── 2130-maximum-twin-sum-of-a-linked-list.md
│ ├── 2131-longest-palindrome-by-concatenating-two-letter-words.md
│ ├── 2134-minimum-swaps-to-group-all-1s-together-ii.md
│ ├── 2138-divide-a-string-into-groups-of-size-k.md
│ ├── 2139-detect-squares.md
│ ├── 2139-minimum-moves-to-reach-target-score.md
│ ├── 2140-solving-questions-with-brainpower.md
│ ├── 2141-maximum-running-time-of-n-computers.md
│ ├── 2145-count-the-hidden-sequences.md
│ ├── 2147-number-of-ways-to-divide-a-long-corridor.md
│ ├── 2149-rearrange-array-elements-by-sign.md
│ ├── 2150-find-all-lonely-numbers-in-the-array.md
│ ├── 2154-keep-multiplying-found-values-by-two.md
│ ├── 2155-all-divisions-with-the-highest-score-of-a-binary-array.md
│ ├── 2161-partition-array-according-to-given-pivot.md
│ ├── 2163-minimum-difference-in-sums-after-removal-of-elements.md
│ ├── 2165-smallest-value-of-the-rearranged-number.md
│ ├── 2168-unique-substrings-with-equal-digit-frequency.md
│ ├── 2169-count-operations-to-obtain-zero.md
│ ├── 2176-count-equal-and-divisible-pairs-in-an-array.md
│ ├── 2177-find-three-consecutive-integers-that-sum-to-a-given-number.md
│ ├── 2178-maximum-split-of-positive-even-integers.md
│ ├── 2179-count-good-triplets-in-an-array.md
│ ├── 2181-merge-nodes-in-between-zeros.md
│ ├── 2182-construct-string-with-repeat-limit.md
│ ├── 2185-counting-words-with-a-given-prefix.md
│ ├── 2186-minimum-number-of-steps-to-make-two-strings-anagram-ii.md
│ ├── 2191-sort-the-jumbled-numbers.md
│ ├── 2192-all-ancestors-of-a-node-in-a-directed-acyclic-graph.md
│ ├── 2193-minimum-number-of-moves-to-make-palindrome.md
│ ├── 2196-create-binary-tree-from-descriptions.md
│ ├── 2197-replace-non-coprime-numbers-in-array.md
│ ├── 2200-find-all-k-distant-indices-in-an-array.md
│ ├── 2201-zero-array-transformation-i.md
│ ├── 2204-distance-to-a-cycle-in-undirected-graph.md
│ ├── 2206-divide-array-into-equal-pairs.md
│ ├── 2207-maximize-number-of-subsequences-in-a-string.md
│ ├── 2208-minimum-operations-to-halve-array-sum.md
│ ├── 2210-count-hills-and-valleys-in-an-array.md
│ ├── 2211-count-collisions-on-a-road.md
│ ├── 2214-minimum-health-to-beat-game.md
│ ├── 2215-find-the-difference-of-two-arrays.md
│ ├── 2216-minimum-deletions-to-make-array-beautiful.md
│ ├── 2220-minimum-bit-flips-to-convert-number.md
│ ├── 2221-find-triangular-sum-of-an-array.md
│ ├── 2225-find-players-with-zero-or-one-losses.md
│ ├── 2226-maximum-candies-allocated-to-k-children.md
│ ├── 2231-largest-number-after-digit-swaps-by-parity.md
│ ├── 2235-add-two-integers.md
│ ├── 2240-number-of-ways-to-buy-pens-and-pencils.md
│ ├── 2244-minimum-rounds-to-complete-all-tasks.md
│ ├── 2246-longest-path-with-different-adjacent-characters.md
│ ├── 2251-number-of-flowers-in-full-bloom.md
│ ├── 2256-minimum-average-difference.md
│ ├── 2257-count-unguarded-cells-in-the-grid.md
│ ├── 2260-minimum-consecutive-cards-to-pick-up.md
│ ├── 2262-total-appeal-of-a-string.md
│ ├── 2264-largest-3-same-digit-number-in-string.md
│ ├── 2265-count-nodes-equal-to-average-of-subtree.md
│ ├── 2270-number-of-ways-to-split-array.md
│ ├── 2273-find-resultant-array-after-removing-anagrams.md
│ ├── 2274-maximum-consecutive-floors-without-special-floors.md
│ ├── 2275-largest-combination-with-bitwise-and-greater-than-zero.md
│ ├── 2279-maximum-bags-with-full-capacity-of-rocks.md
│ ├── 2284-sender-with-largest-word-count.md
│ ├── 2290-minimum-obstacle-removal-to-reach-corner.md
│ ├── 2291-maximum-profit-from-trading-stocks.md
│ ├── 2294-partition-array-such-that-maximum-difference-is-k.md
│ ├── 2295-replace-elements-in-an-array.md
│ ├── 23-merge-k-sorted-lists.md
│ ├── 2300-successful-pairs-of-spells-and-potions.md
│ ├── 2302-count-subarrays-with-score-less-than-k.md
│ ├── 2303-calculate-amount-paid-in-taxes.md
│ ├── 2310-sum-of-numbers-with-units-digit-k.md
│ ├── 2311-longest-binary-subsequence-less-than-or-equal-to-k.md
│ ├── 2322-minimum-score-after-removals-on-a-tree.md
│ ├── 2326-spiral-matrix-iv.md
│ ├── 2327-number-of-people-aware-of-a-secret.md
│ ├── 2331-evaluate-boolean-binary-tree.md
│ ├── 2334-subarray-with-elements-greater-than-varying-threshold.md
│ ├── 2336-smallest-number-in-infinite-set.md
│ ├── 2337-move-pieces-to-obtain-a-string.md
│ ├── 2338-count-the-number-of-ideal-arrays.md
│ ├── 2342-max-sum-of-a-pair-with-equal-sum-of-digits.md
│ ├── 2348-number-of-zero-filled-subarrays.md
│ ├── 2349-design-a-number-container-system.md
│ ├── 2352-equal-row-and-column-pairs.md
│ ├── 2353-design-a-food-rating-system.md
│ ├── 2355-maximum-number-of-books-you-can-take.md
│ ├── 2357-make-array-zero-by-subtracting-equal-amounts.md
│ ├── 2358-maximum-number-of-groups-entering-a-competition.md
│ ├── 2359-find-closest-node-to-given-two-nodes.md
│ ├── 2361-minimum-costs-using-the-train-line.md
│ ├── 2364-count-number-of-bad-pairs.md
│ ├── 2366-minimum-replacements-to-sort-the-array.md
│ ├── 2368-reachable-nodes-with-restrictions.md
│ ├── 2369-check-if-there-is-a-valid-partition-for-the-array.md
│ ├── 2370-longest-ideal-subsequence.md
│ ├── 2371-minimize-maximum-value-in-a-grid.md
│ ├── 2373-largest-local-values-in-a-matrix.md
│ ├── 2374-node-with-highest-edge-score.md
│ ├── 2375-construct-smallest-number-from-di-string.md
│ ├── 2379-minimum-recolors-to-get-k-consecutive-black-blocks.md
│ ├── 2380-time-needed-to-rearrange-a-binary-string.md
│ ├── 2381-shifting-letters-ii.md
│ ├── 2384-largest-palindromic-number.md
│ ├── 2385-amount-of-time-for-binary-tree-to-be-infected.md
│ ├── 2389-longest-subsequence-with-limited-sum.md
│ ├── 2390-removing-stars-from-a-string.md
│ ├── 2391-minimum-amount-of-time-to-collect-garbage.md
│ ├── 2392-build-a-matrix-with-conditions.md
│ ├── 2393-count-strictly-increasing-subarrays.md
│ ├── 2396-strictly-palindromic-number.md
│ ├── 2401-longest-nice-subarray.md
│ ├── 2402-meeting-rooms-iii.md
│ ├── 2405-optimal-partition-of-string.md
│ ├── 2406-divide-intervals-into-minimum-number-of-groups.md
│ ├── 2408-design-sql.md
│ ├── 2410-maximum-matching-of-players-with-trainers.md
│ ├── 2411-smallest-subarrays-with-maximum-bitwise-or.md
│ ├── 2414-length-of-the-longest-alphabetical-continuous-substring.md
│ ├── 2415-reverse-odd-levels-of-binary-tree.md
│ ├── 2416-sum-of-prefix-scores-of-strings.md
│ ├── 2418-sort-the-people.md
│ ├── 2419-longest-subarray-with-maximum-bitwise-and.md
│ ├── 2425-bitwise-xor-of-all-pairings.md
│ ├── 2428-maximum-sum-of-an-hourglass.md
│ ├── 2429-minimize-xor.md
│ ├── 2433-find-the-original-array-of-prefix-xor.md
│ ├── 2434-using-a-robot-to-print-the-lexicographically-smallest-string.md
│ ├── 2435-paths-in-matrix-whose-sum-is-divisible-by-k.md
│ ├── 2438-range-product-queries-of-powers.md
│ ├── 2439-minimize-maximum-of-array.md
│ ├── 2441-largest-positive-integer-that-exists-with-its-negative.md
│ ├── 2442-count-number-of-distinct-integers-after-reverse-operations.md
│ ├── 2443-sum-of-number-and-its-reverse.md
│ ├── 2444-count-subarrays-with-fixed-bounds.md
│ ├── 2452-words-within-two-edits-of-dictionary.md
│ ├── 2456-most-popular-video-creator.md
│ ├── 2458-height-of-binary-tree-after-subtree-removal-queries.md
│ ├── 2460-apply-operations-to-an-array.md
│ ├── 2461-maximum-sum-of-distinct-subarrays-with-length-k.md
│ ├── 2462-total-cost-to-hire-k-workers.md
│ ├── 2463-minimum-total-distance-traveled.md
│ ├── 2464-minimum-subarrays-in-a-valid-split.md
│ ├── 2466-count-ways-to-build-good-strings.md
│ ├── 2467-most-profitable-path-in-a-tree.md
│ ├── 2470-number-of-subarrays-with-lcm-equal-to-k.md
│ ├── 2471-minimum-number-of-operations-to-sort-a-binary-tree-by-level.md
│ ├── 2473-minimum-cost-to-buy-apples.md
│ ├── 2482-difference-between-ones-and-zeros-in-row-and-column.md
│ ├── 2483-minimum-penalty-for-a-shop.md
│ ├── 2485-find-the-pivot-integer.md
│ ├── 2486-append-characters-to-string-to-make-subsequence.md
│ ├── 2490-circular-sentence.md
│ ├── 2491-divide-players-into-teams-of-equal-skill.md
│ ├── 2492-minimum-score-of-a-path-between-two-cities.md
│ ├── 2493-divide-nodes-into-the-maximum-number-of-groups.md
│ ├── 2501-longest-square-streak-in-an-array.md
│ ├── 2503-maximum-number-of-points-from-grid-queries.md
│ ├── 2505-bitwise-or-of-all-subsequence-sums.md
│ ├── 2507-smallest-value-after-replacing-with-sum-of-prime-factors.md
│ ├── 2516-take-k-of-each-character-from-left-and-right.md
│ ├── 2521-distinct-prime-factors-of-product-of-array.md
│ ├── 2523-closest-prime-numbers-in-range.md
│ ├── 2526-find-consecutive-integers-from-a-data-stream.md
│ ├── 2527-find-xor-beauty-of-array.md
│ ├── 2528-maximize-the-minimum-powered-city.md
│ ├── 2529-maximum-count-of-positive-integer-and-negative-integer.md
│ ├── 2530-maximal-score-after-applying-k-operations.md
│ ├── 2536-increment-submatrices-by-one.md
│ ├── 2537-count-the-number-of-good-subarrays.md
│ ├── 2539-count-the-number-of-good-subsequences.md
│ ├── 2542-maximum-subsequence-score.md
│ ├── 2545-sort-the-students-by-their-kth-score.md
│ ├── 2551-put-marbles-in-bags.md
│ ├── 2554-maximum-number-of-integers-to-choose-from-a-range-i.md
│ ├── 2558-take-gifts-from-the-richest-pile.md
│ ├── 2559-count-vowel-strings-in-ranges.md
│ ├── 2560-house-robber-iv.md
│ ├── 2561-rearranging-fruits.md
│ ├── 2563-count-the-number-of-fair-pairs.md
│ ├── 2566-maximum-difference-by-remapping-a-digit.md
│ ├── 2570-merge-two-2d-arrays-by-summing-values.md
│ ├── 2575-find-the-divisibility-array-of-a-string.md
│ ├── 2577-minimum-time-to-visit-a-cell-in-a-grid.md
│ ├── 2579-count-total-number-of-colored-cells.md
│ ├── 2582-pass-the-pillow.md
│ ├── 2583-kth-largest-sum-in-a-binary-tree.md
│ ├── 2587-rearrange-array-to-maximize-prefix-score.md
│ ├── 2592-maximize-greatness-of-an-array.md
│ ├── 2593-find-score-of-an-array-after-marking-all-elements.md
│ ├── 2594-minimum-time-to-repair-cars.md
│ ├── 2596-check-knight-tour-configuration.md
│ ├── 2597-the-number-of-beautiful-subsets.md
│ ├── 2598-smallest-missing-non-negative-integer-after-operations.md
│ ├── 2599-make-the-prefix-sum-non-negative.md
│ ├── 2601-prime-subtraction-operation.md
│ ├── 2602-minimum-operations-to-make-all-array-elements-equal.md
│ ├── 2606-find-the-substring-with-maximum-cost.md
│ ├── 2610-convert-an-array-into-a-2d-array-with-conditions.md
│ ├── 2616-minimize-the-maximum-difference-of-pairs.md
│ ├── 2618-check-if-object-instance-of-class.md
│ ├── 2619-array-prototype-last.md
│ ├── 2620-counter.md
│ ├── 2621-sleep.md
│ ├── 2622-cache-with-time-limit.md
│ ├── 2623-memoize.md
│ ├── 2624-snail-traversal.md
│ ├── 2625-flatten-deeply-nested-array.md
│ ├── 2626-array-reduce-transformation.md
│ ├── 2627-debounce.md
│ ├── 2628-json-deep-equal.md
│ ├── 2629-function-composition.md
│ ├── 2630-memoize-ii.md
│ ├── 2631-group-by.md
│ ├── 2632-curry.md
│ ├── 2633-convert-object-to-json-string.md
│ ├── 2634-filter-elements-from-array.md
│ ├── 2635-apply-transform-over-each-element-in-array.md
│ ├── 2636-promise-pool.md
│ ├── 2637-promise-time-limit.md
│ ├── 2640-find-the-score-of-all-prefixes-of-an-array.md
│ ├── 2641-cousins-in-binary-tree-ii.md
│ ├── 2642-design-graph-with-shortest-path-calculator.md
│ ├── 2645-minimum-additions-to-make-valid-string.md
│ ├── 2648-generate-fibonacci-sequence.md
│ ├── 2649-nested-array-generator.md
│ ├── 2650-design-cancellable-function.md
│ ├── 2654-minimum-number-of-operations-to-make-all-array-elements-equal-to-1.md
│ ├── 2657-find-the-prefix-common-array-of-two-arrays.md
│ ├── 2658-maximum-number-of-fish-in-a-grid.md
│ ├── 2661-first-completely-painted-row-or-column.md
│ ├── 2664-the-knights-tour.md
│ ├── 2665-counter-ii.md
│ ├── 2666-allow-one-function-call.md
│ ├── 2667-create-hello-world-function.md
│ ├── 2671-frequency-tracker.md
│ ├── 2674-split-a-circular-linked-list.md
│ ├── 2675-array-of-objects-to-matrix.md
│ ├── 2676-throttle.md
│ ├── 2677-chunk-array.md
│ ├── 2678-number-of-senior-citizens.md
│ ├── 2679-sum-in-a-matrix.md
│ ├── 2683-neighboring-bitwise-xor.md
│ ├── 2684-maximum-number-of-moves-in-a-grid.md
│ ├── 2685-count-the-number-of-complete-components.md
│ ├── 2690-infinite-method-object.md
│ ├── 2692-make-object-immutable.md
│ ├── 2694-event-emitter.md
│ ├── 2695-array-wrapper.md
│ ├── 2696-minimum-string-length-after-removing-substrings.md
│ ├── 2698-find-the-punishment-number-of-an-integer.md
│ ├── 2699-modify-graph-edge-weights.md
│ ├── 2703-return-length-of-arguments-passed.md
│ ├── 2704-to-be-or-not-to-be.md
│ ├── 2705-compact-object.md
│ ├── 2706-buy-two-chocolates.md
│ ├── 2707-extra-characters-in-a-string.md
│ ├── 2708-maximum-strength-of-a-group.md
│ ├── 2709-greatest-common-divisor-traversal.md
│ ├── 2711-difference-of-number-of-distinct-values-on-diagonals.md
│ ├── 2715-execute-cancellable-function-with-delay.md
│ ├── 2721-execute-asynchronous-functions-in-parallel.md
│ ├── 2722-join-two-arrays-by-id.md
│ ├── 2723-add-two-promises.md
│ ├── 2724-sort-by.md
│ ├── 2725-interval-cancellation.md
│ ├── 2726-calculator-with-method-chaining.md
│ ├── 2727-is-object-empty.md
│ ├── 2730-find-the-longest-semi-repetitive-substring.md
│ ├── 2734-lexicographically-smallest-string-after-substring-operation.md
│ ├── 2737-find-the-closest-marked-node.md
│ ├── 2740-find-the-value-of-the-partition.md
│ ├── 2742-painting-the-walls.md
│ ├── 2743-count-substrings-without-repeating-character.md
│ ├── 2749-minimum-operations-to-make-the-integer-zero.md
│ ├── 2751-robot-collisions.md
│ ├── 2761-prime-pairs-with-target-sum.md
│ ├── 2762-continuous-subarrays.md
│ ├── 2770-maximum-number-of-jumps-to-reach-the-last-index.md
│ ├── 2771-longest-non-decreasing-subarray-from-two-arrays.md
│ ├── 2772-apply-operations-to-make-all-array-elements-equal-to-zero.md
│ ├── 2778-sum-of-squares-of-special-elements.md
│ ├── 2779-maximum-beauty-of-an-array-after-applying-operation.md
│ ├── 2780-minimum-index-of-a-valid-split.md
│ ├── 2784-check-if-array-is-good.md
│ ├── 2785-sort-vowels-in-a-string.md
│ ├── 2787-ways-to-express-an-integer-as-sum-of-powers.md
│ ├── 2788-split-strings-by-separator.md
│ ├── 2789-largest-element-in-an-array-after-merge-operations.md
│ ├── 2798-number-of-employees-who-met-the-target.md
│ ├── 2799-count-complete-subarrays-in-an-array.md
│ ├── 2802-find-the-k-th-lucky-number.md
│ ├── 2806-account-balance-after-rounded-purchase.md
│ ├── 2807-insert-greatest-common-divisors-in-linked-list.md
│ ├── 2810-faulty-keyboard.md
│ ├── 2811-check-if-it-is-possible-to-split-array.md
│ ├── 2812-find-the-safest-path-in-a-grid.md
│ ├── 2814-minimum-time-takes-to-reach-destination-without-drowning.md
│ ├── 2816-double-a-number-represented-as-a-linked-list.md
│ ├── 2818-apply-operations-to-maximize-score.md
│ ├── 2824-count-pairs-whose-sum-is-less-than-target.md
│ ├── 2825-make-string-a-subsequence-using-cyclic-increments.md
│ ├── 2829-determine-the-minimum-sum-of-a-k-avoiding-array.md
│ ├── 2832-maximal-range-that-each-element-is-maximum-in-it.md
│ ├── 2833-furthest-point-from-origin.md
│ ├── 2834-find-the-minimum-possible-sum-of-a-beautiful-array.md
│ ├── 2838-maximum-coins-heroes-can-collect.md
│ ├── 2840-check-if-strings-can-be-made-equal-with-operations-ii.md
│ ├── 2841-maximum-sum-of-almost-unique-subarray.md
│ ├── 2843-count-symmetric-integers.md
│ ├── 2845-count-of-interesting-subarrays.md
│ ├── 2849-determine-if-a-cell-is-reachable-at-a-given-time.md
│ ├── 2850-minimum-moves-to-spread-stones-over-grid.md
│ ├── 2852-sum-of-remoteness-of-all-cells.md
│ ├── 2856-minimum-array-length-after-pair-removals.md
│ ├── 2864-maximum-odd-binary-number.md
│ ├── 2865-beautiful-towers-i.md
│ ├── 2870-minimum-number-of-operations-to-make-array-empty.md
│ ├── 2872-maximum-number-of-k-divisible-components.md
│ ├── 2873-maximum-value-of-an-ordered-triplet-i.md
│ ├── 2874-maximum-value-of-an-ordered-triplet-ii.md
│ ├── 2894-divisible-and-non-divisible-sums-difference.md
│ ├── 2895-minimum-processing-time.md
│ ├── 2900-longest-unequal-adjacent-groups-subsequence-i.md
│ ├── 2901-longest-unequal-adjacent-groups-subsequence-ii.md
│ ├── 2904-shortest-and-lexicographically-smallest-beautiful-string.md
│ ├── 2909-minimum-sum-of-mountain-triplets-ii.md
│ ├── 2914-minimum-number-of-changes-to-make-binary-string-beautiful.md
│ ├── 2918-minimum-equal-sum-of-two-arrays-after-replacing-zeros.md
│ ├── 2923-find-champion-i.md
│ ├── 2924-find-champion-ii.md
│ ├── 2927-distribute-candies-among-children-iii.md
│ ├── 2929-distribute-candies-among-children-ii.md
│ ├── 2933-high-access-employees.md
│ ├── 2938-separate-black-and-white-balls.md
│ ├── 2940-find-building-where-alice-and-bob-can-meet.md
│ ├── 2942-find-words-containing-character.md
│ ├── 2943-maximize-area-of-square-hole-in-grid.md
│ ├── 2947-count-beautiful-substrings-i.md
│ ├── 2948-make-lexicographically-smallest-array-by-swapping-elements.md
│ ├── 2955-number-of-same-end-substrings.md
│ ├── 2957-remove-adjacent-almost-equal-characters.md
│ ├── 2958-length-of-longest-subarray-with-at-most-k-frequency.md
│ ├── 2961-double-modular-exponentiation.md
│ ├── 2962-count-subarrays-where-max-element-appears-at-least-k-times.md
│ ├── 2965-find-missing-and-repeated-values.md
│ ├── 2966-divide-array-into-arrays-with-max-difference.md
│ ├── 2971-find-polygon-with-the-largest-perimeter.md
│ ├── 2975-maximum-square-area-by-removing-fences-from-a-field.md
│ ├── 2976-minimum-cost-to-convert-string-i.md
│ ├── 2977-minimum-cost-to-convert-string-ii.md
│ ├── 2981-find-longest-special-substring-that-occurs-thrice-i.md
│ ├── 2985-calculate-compressed-mean.md
│ ├── 2997-minimum-number-of-operations-to-make-array-xor-equal-to-k.md
│ ├── 2999-count-the-number-of-powerful-integers.md
│ ├── 3000-maximum-area-of-longest-diagonal-rectangle.md
│ ├── 3003-maximize-the-number-of-partitions-after-operations.md
│ ├── 3005-count-elements-with-maximum-frequency.md
│ ├── 3006-find-beautiful-indices-in-the-given-array-i.md
│ ├── 3010-divide-an-array-into-subarrays-with-minimum-cost-i.md
│ ├── 3011-find-if-array-can-be-sorted.md
│ ├── 3013-divide-an-array-into-subarrays-with-minimum-cost-ii.md
│ ├── 3016-minimum-number-of-pushes-to-type-word-ii.md
│ ├── 3020-find-the-maximum-number-of-elements-in-subset.md
│ ├── 3021-alice-and-bob-playing-flower-game.md
│ ├── 3024-type-of-triangle.md
│ ├── 3025-find-the-number-of-ways-to-place-people-i.md
│ ├── 3026-maximum-good-subarray-sum.md
│ ├── 3027-find-the-number-of-ways-to-place-people-ii.md
│ ├── 3034-number-of-subarrays-that-match-a-pattern-i.md
│ ├── 3039-apply-operations-to-make-string-empty.md
│ ├── 3042-count-prefix-and-suffix-pairs-i.md
│ ├── 3043-find-the-length-of-the-longest-common-prefix.md
│ ├── 3047-find-the-largest-area-of-square-inside-two-rectangles.md
│ ├── 3062-winner-of-the-linked-list-game.md
│ ├── 3063-linked-list-frequency.md
│ ├── 3066-minimum-operations-to-exceed-threshold-value-ii.md
│ ├── 3068-find-the-maximum-sum-of-node-values.md
│ ├── 3070-count-submatrices-with-top-left-element-and-sum-less-than-k.md
│ ├── 3074-apple-redistribution-into-boxes.md
│ ├── 3075-maximize-happiness-of-selected-children.md
│ ├── 3084-count-substrings-starting-and-ending-with-given-character.md
│ ├── 3085-minimum-deletions-to-make-string-k-special.md
│ ├── 3091-apply-operations-to-make-sum-of-array-greater-than-or-equal-to-k.md
│ ├── 3095-shortest-subarray-with-or-at-least-k-i.md
│ ├── 3096-minimum-levels-to-gain-more-points.md
│ ├── 3097-shortest-subarray-with-or-at-least-k-ii.md
│ ├── 3100-water-bottles-ii.md
│ ├── 3101-count-alternating-subarrays.md
│ ├── 3105-longest-strictly-increasing-or-strictly-decreasing-subarray.md
│ ├── 3106-lexicographically-smallest-string-after-operations-with-constraint.md
│ ├── 3108-minimum-cost-walk-in-weighted-graph.md
│ ├── 3110-score-of-a-string.md
│ ├── 3111-minimum-rectangles-to-cover-points.md
│ ├── 3115-maximum-prime-difference.md
│ ├── 3121-count-the-number-of-special-characters-ii.md
│ ├── 3128-right-triangles.md
│ ├── 3133-minimum-array-end.md
│ ├── 3136-valid-word.md
│ ├── 3137-minimum-number-of-operations-to-make-word-k-periodic.md
│ ├── 3147-taking-maximum-energy-from-the-mystic-dungeon.md
│ ├── 3151-special-array-i.md
│ ├── 3152-special-array-ii.md
│ ├── 3155-maximum-number-of-upgradable-servers.md
│ ├── 3159-find-occurrences-of-an-element-in-an-array.md
│ ├── 3160-find-the-number-of-distinct-colors-among-the-balls.md
│ ├── 3163-string-compression-iii.md
│ ├── 3169-count-days-without-meetings.md
│ ├── 3170-lexicographically-minimum-string-after-removing-stars.md
│ ├── 3174-clear-digits.md
│ ├── 3175-find-the-first-player-to-win-k-games-in-a-row.md
│ ├── 3176-find-the-maximum-length-of-a-good-subsequence-i.md
│ ├── 3177-find-the-maximum-length-of-a-good-subsequence-ii.md
│ ├── 3179-find-the-n-th-value-after-k-seconds.md
│ ├── 3186-maximum-total-damage-with-spell-casting.md
│ ├── 3189-minimum-moves-to-get-a-peaceful-board.md
│ ├── 3190-find-minimum-operations-to-make-all-elements-divisible-by-three.md
│ ├── 3191-minimum-operations-to-make-binary-array-elements-equal-to-one-i.md
│ ├── 3192-minimum-operations-to-make-binary-array-elements-equal-to-one-ii.md
│ ├── 3195-find-the-minimum-area-to-cover-all-ones-i.md
│ ├── 3197-find-the-minimum-area-to-cover-all-ones-ii.md
│ ├── 3201-find-the-maximum-length-of-valid-subsequence-i.md
│ ├── 3202-find-the-maximum-length-of-valid-subsequence-ii.md
│ ├── 3203-find-minimum-diameter-after-merging-two-trees.md
│ ├── 3208-alternating-groups-ii.md
│ ├── 3211-generate-binary-strings-without-adjacent-zeros.md
│ ├── 3217-delete-nodes-from-linked-list-present-in-array.md
│ ├── 3223-minimum-length-of-string-after-operations.md
│ ├── 3227-vowels-game-in-a-string.md
│ ├── 3228-maximum-number-of-operations-to-move-ones-to-the-end.md
│ ├── 3233-find-the-count-of-numbers-which-are-not-special.md
│ ├── 3234-count-the-number-of-substrings-with-dominant-ones.md
│ ├── 3239-minimum-number-of-flips-to-make-binary-grid-palindromic-i.md
│ ├── 3243-shortest-distance-after-road-addition-queries-i.md
│ ├── 3249-count-the-number-of-good-nodes.md
│ ├── 3254-find-the-power-of-k-size-subarrays-i.md
│ ├── 3259-maximum-energy-boost-from-two-drinks.md
│ ├── 3264-final-array-state-after-k-multiplication-operations-i.md
│ ├── 3271-hash-divided-string.md
│ ├── 3272-find-the-count-of-good-integers.md
│ ├── 3275-k-th-nearest-obstacle-queries.md
│ ├── 3280-convert-date-to-binary.md
│ ├── 3281-maximize-score-of-numbers-in-ranges.md
│ ├── 3282-reach-end-of-array-with-max-score.md
│ ├── 3285-find-indices-of-stable-mountains.md
│ ├── 3286-find-a-safe-walk-through-a-grid.md
│ ├── 3289-the-two-sneaky-numbers-of-digitville.md
│ ├── 3290-maximum-multiplication-score.md
│ ├── 3295-report-spam-message.md
│ ├── 3296-minimum-number-of-seconds-to-make-mountain-height-zero.md
│ ├── 3300-minimum-element-after-replacement-with-digit-sum.md
│ ├── 3301-maximize-the-total-height-of-unique-towers.md
│ ├── 3304-find-the-k-th-character-in-string-game-i.md
│ ├── 3305-count-of-substrings-containing-every-vowel-and-k-consonants-i.md
│ ├── 3306-count-of-substrings-containing-every-vowel-and-k-consonants-ii.md
│ ├── 3307-find-the-k-th-character-in-string-game-ii.md
│ ├── 3309-maximum-possible-number-by-binary-concatenation.md
│ ├── 3310-remove-methods-from-project.md
│ ├── 3314-construct-the-minimum-bitwise-array-i.md
│ ├── 3315-construct-the-minimum-bitwise-array-ii.md
│ ├── 3318-find-x-sum-of-all-k-long-subarrays-i.md
│ ├── 3319-k-th-largest-perfect-subtree-size-in-binary-tree.md
│ ├── 3321-find-x-sum-of-all-k-long-subarrays-ii.md
│ ├── 3324-find-the-sequence-of-strings-appeared-on-the-screen.md
│ ├── 3325-count-substrings-with-k-frequency-characters-i.md
│ ├── 3330-find-the-original-typed-string-i.md
│ ├── 3331-find-subtree-sizes-after-changes.md
│ ├── 3333-find-the-original-typed-string-ii.md
│ ├── 3334-find-the-maximum-factor-score-of-array.md
│ ├── 3335-total-characters-in-string-after-transformations-i.md
│ ├── 3337-total-characters-in-string-after-transformations-ii.md
│ ├── 3340-check-balanced-string.md
│ ├── 3341-find-minimum-time-to-reach-last-room-i.md
│ ├── 3342-find-minimum-time-to-reach-last-room-ii.md
│ ├── 3343-count-number-of-balanced-permutations.md
│ ├── 3345-smallest-divisible-digit-product-i.md
│ ├── 3346-maximum-frequency-of-an-element-after-performing-operations-i.md
│ ├── 3347-maximum-frequency-of-an-element-after-performing-operations-ii.md
│ ├── 3349-adjacent-increasing-subarrays-detection-i.md
│ ├── 3350-adjacent-increasing-subarrays-detection-ii.md
│ ├── 3354-make-array-elements-equal-to-zero.md
│ ├── 3355-zero-array-transformation-i.md
│ ├── 3356-zero-array-transformation-ii.md
│ ├── 3360-stone-removal-game.md
│ ├── 3361-shift-distance-between-two-strings.md
│ ├── 3362-zero-array-transformation-iii.md
│ ├── 3363-find-the-maximum-number-of-fruits-collected.md
│ ├── 3364-minimum-positive-sum-subarray.md
│ ├── 3365-rearrange-k-substrings-to-form-target-string.md
│ ├── 3370-smallest-number-with-all-set-bits.md
│ ├── 3371-identify-the-largest-outlier-in-an-array.md
│ ├── 3372-maximize-the-number-of-target-nodes-after-connecting-trees-i.md
│ ├── 3373-maximize-the-number-of-target-nodes-after-connecting-trees-ii.md
│ ├── 3375-minimum-operations-to-make-array-values-equal-to-k.md
│ ├── 3379-transformed-array.md
│ ├── 3380-maximum-area-rectangle-with-point-constraints-i.md
│ ├── 3381-maximum-subarray-sum-with-length-divisible-by-k.md
│ ├── 3386-button-with-longest-push-time.md
│ ├── 3387-maximize-amount-after-two-days-of-conversions.md
│ ├── 3392-count-subarrays-of-length-three-with-a-condition.md
│ ├── 3393-count-paths-with-the-given-xor-value.md
│ ├── 3394-check-if-grid-can-be-cut-into-sections.md
│ ├── 3396-minimum-number-of-operations-to-make-elements-in-array-distinct.md
│ ├── 3397-maximum-number-of-distinct-elements-after-operations.md
│ ├── 3402-minimum-operations-to-make-columns-strictly-increasing.md
│ ├── 3403-find-the-lexicographically-largest-string-from-the-box-i.md
│ ├── 3405-count-the-number-of-arrays-with-k-matching-adjacent-elements.md
│ ├── 3407-substring-matching-pattern.md
│ ├── 3408-design-task-manager.md
│ ├── 3411-maximum-subarray-with-equal-products.md
│ ├── 3412-find-mirror-score-of-a-string.md
│ ├── 3417-zigzag-grid-traversal-with-skip.md
│ ├── 3418-maximum-amount-of-money-robot-can-earn.md
│ ├── 3423-maximum-difference-between-adjacent-elements-in-a-circular-array.md
│ ├── 3424-minimum-cost-to-make-arrays-identical.md
│ ├── 3427-sum-of-variable-length-subarrays.md
│ ├── 3428-maximum-and-minimum-sums-of-at-most-size-k-subsequences.md
│ ├── 3432-count-partitions-with-even-sum-difference.md
│ ├── 3433-count-mentions-per-user.md
│ ├── 3434-maximum-frequency-after-subarray-operation.md
│ ├── 3438-find-valid-pair-of-adjacent-digits-in-string.md
│ ├── 3439-reschedule-meetings-for-maximum-free-time-i.md
│ ├── 3440-reschedule-meetings-for-maximum-free-time-i.md
│ ├── 3442-maximum-difference-between-even-and-odd-frequency-i.md
│ ├── 3443-maximum-manhattan-distance-after-k-changes.md
│ ├── 3445-maximum-difference-between-even-and-odd-frequency-ii.md
│ ├── 3446-sort-matrix-by-diagonals.md
│ ├── 3447-assign-elements-to-groups-with-constraints.md
│ ├── 3452-sum-of-good-numbers.md
│ ├── 3453-separate-squares-i.md
│ ├── 3454-separate-squares-ii.md
│ ├── 3456-find-special-substring-of-length-k.md
│ ├── 3457-eat-pizzas.md
│ ├── 3459-length-of-longest-v-shaped-diagonal-segment.md
│ ├── 3461-check-if-digits-are-equal-in-string-after-operations-i.md
│ ├── 3462-maximum-sum-with-at-most-k-elements.md
│ ├── 3467-transform-array-by-parity.md
│ ├── 3468-find-the-number-of-copy-arrays.md
│ ├── 3471-find-the-largest-almost-missing-integer.md
│ ├── 3473-sum-of-k-subarrays-with-length-at-least-m.md
│ ├── 3477-fruits-into-baskets-ii.md
│ ├── 3478-choose-k-elements-with-maximum-sum.md
│ ├── 3479-fruits-into-baskets-iii.md
│ ├── 3483-unique-3-digit-even-numbers.md
│ ├── 3484-design-spreadsheet.md
│ ├── 3487-maximum-unique-subarray-sum-after-deletion.md
│ ├── 3488-closest-equal-element-queries.md
│ ├── 3489-zero-array-transformation-iv.md
│ ├── 3492-maximum-containers-on-a-ship.md
│ ├── 3493-properties-graph.md
│ ├── 3494-find-the-minimum-amount-of-time-to-brew-potions.md
│ ├── 3495-minimum-operations-to-make-array-elements-zero.md
│ ├── 3498-reverse-degree-of-a-string.md
│ ├── 3499-maximize-active-section-with-trade-i.md
│ ├── 3502-minimum-cost-to-reach-every-position.md
│ ├── 3503-longest-palindrome-after-substring-concatenation-i.md
│ ├── 3507-minimum-pair-removal-to-sort-array-i.md
│ ├── 3508-implement-router.md
│ ├── 3510-minimum-pair-removal-to-sort-array-ii.md
│ ├── 3512-minimum-operations-to-make-array-sum-divisible-by-k.md
│ ├── 3513-number-of-unique-xor-triplets-i.md
│ ├── 3514-number-of-unique-xor-triplets-ii.md
│ ├── 3516-find-closest-person.md
│ ├── 3517-smallest-palindromic-rearrangement-i.md
│ ├── 3519-count-numbers-with-non-decreasing-digits.md
│ ├── 3522-calculate-score-after-performing-instructions.md
│ ├── 3523-make-array-non-decreasing.md
│ ├── 3524-find-x-value-of-array-i.md
│ ├── 3527-find-the-most-common-response.md
│ ├── 3528-unit-conversion-i.md
│ ├── 3531-count-covered-buildings.md
│ ├── 3532-path-existence-queries-in-a-graph-i.md
│ ├── 3536-maximum-product-of-two-digits.md
│ ├── 3537-fill-a-special-grid.md
│ ├── 3539-find-sum-of-array-product-of-magical-sequences.md
│ ├── 3541-find-most-frequent-vowel-and-consonant.md
│ ├── 3542-minimum-operations-to-convert-all-elements-to-zero.md
│ ├── 3545-minimum-deletions-for-at-most-k-distinct-characters.md
│ ├── 3546-equal-sum-grid-partition-i.md
│ ├── 3550-minimum-swaps-to-sort-by-digit-sum.md
│ ├── 3551-smallest-index-with-digit-sum-equal-to-index.md
│ ├── 3556-sum-of-largest-prime-substrings.md
│ ├── 3558-number-of-ways-to-assign-edge-weights-i.md
│ ├── 3560-find-minimum-log-transportation-cost.md
│ ├── 3561-resulting-string-after-adjacent-removals.md
│ ├── 3562-maximum-profit-from-trading-stocks-with-discounts.md
│ ├── 3566-partition-array-into-two-equal-product-subsets.md
│ ├── 3567-minimum-moves-to-clean-the-classroom.md
│ ├── 3568-maximize-count-of-distinct-primes-after-split.md
│ ├── 3569-minimum-absolute-difference-in-sliding-submatrix.md
│ ├── 3573-best-time-to-buy-and-sell-stock-v.md
│ ├── 3574-maximize-ysum-by-picking-a-triplet-of-distinct-xvalues.md
│ ├── 3576-transform-array-to-all-equal-elements.md
│ ├── 3577-count-the-number-of-computer-unlocking-permutations.md
│ ├── 3578-count-partitions-with-max-min-difference-at-most-k.md
│ ├── 3582-generate-tag-for-video-caption.md
│ ├── 3583-count-special-triplets.md
│ ├── 3584-maximum-product-of-first-and-last-elements-of-a-subsequence.md
│ ├── 3587-minimum-adjacent-swaps-to-alternate-parity.md
│ ├── 3588-find-maximum-area-of-a-triangle.md
│ ├── 3591-check-if-any-element-has-prime-frequency.md
│ ├── 3592-inverse-coin-change.md
│ ├── 3593-minimum-increments-to-equalize-leaf-paths.md
│ ├── 3597-partition-string.md
│ ├── 3599-partition-array-to-minimize-xor.md
│ ├── 3602-hexadecimal-and-hexatrigesimal-conversion.md
│ ├── 3603-minimum-cost-path-with-alternating-directions-ii.md
│ ├── 3604-minimum-time-to-reach-destination-in-directed-graph.md
│ ├── 3606-coupon-code-validator.md
│ ├── 3607-power-grid-maintenance.md
│ ├── 3608-minimum-time-for-k-connected-components.md
│ ├── 3612-process-string-with-special-operations-i.md
│ ├── 3613-minimize-maximum-component-cost.md
│ ├── 3614-process-string-with-special-operations-ii.md
│ ├── 3622-check-divisibility-by-digit-sum-and-product.md
│ ├── 3623-count-number-of-trapezoids-i.md
│ ├── 3624-number-of-integers-with-popcount-depth-equal-to-k-ii.md
│ ├── 3625-count-number-of-trapezoids-ii.md
│ ├── 3627-maximum-median-sum-of-subsequences-of-size-3.md
│ ├── 3628-maximum-number-of-subsequences-after-one-inserting.md
│ ├── 3633-earliest-finish-time-for-land-and-water-rides-i.md
│ ├── 3634-minimum-removals-to-balance-array.md
│ ├── 3635-earliest-finish-time-for-land-and-water-rides-ii.md
│ ├── 3637-trionic-array-i.md
│ ├── 3638-maximum-balanced-shipments.md
│ ├── 3640-trionic-array-ii.md
│ ├── 3643-flip-square-submatrix-vertically.md
│ ├── 3644-maximum-k-to-sort-a-permutation.md
│ ├── 3646-next-special-palindrome-number.md
│ ├── 3648-minimum-sensors-to-cover-grid.md
│ ├── 3649-number-of-perfect-pairs.md
│ ├── 3650-minimum-cost-path-with-edge-reversals.md
│ ├── 3651-minimum-cost-path-with-teleportations.md
│ ├── 3652-best-time-to-buy-and-sell-stock-using-strategy.md
│ ├── 3653-xor-after-range-multiplication-queries-i.md
│ ├── 3654-minimum-sum-after-divisible-sum-deletions.md
│ ├── 3658-gcd-of-odd-and-even-sums.md
│ ├── 3659-partition-array-into-k-distinct-groups.md
│ ├── 3663-find-the-least-frequent-digit.md
│ ├── 3665-twisted-mirror-path-count.md
│ ├── 3668-restore-finishing-order.md
│ ├── 3669-balanced-k-factor-decomposition.md
│ ├── 3674-minimum-operations-to-equalize-array.md
│ ├── 3675-minimum-operations-to-transform-string.md
│ ├── 3676-count-bowl-subarrays.md
│ ├── 3678-smallest-absent-positive-greater-than-average.md
│ ├── 3679-minimum-discards-to-balance-inventory.md
│ ├── 3681-maximum-xor-of-subsequences.md
│ ├── 3688-bitwise-or-of-even-numbers-in-an-array.md
│ ├── 3689-maximum-total-subarray-value-i.md
│ ├── 3690-split-and-merge-array-transformation.md
│ ├── 3692-majority-frequency-characters.md
│ ├── 3693-climbing-stairs-ii.md
│ ├── 3694-distinct-points-reachable-after-substring-removal.md
│ ├── 3697-compute-decimal-representation.md
│ ├── 3698-split-array-with-minimum-difference.md
│ ├── 3701-compute-alternating-sum.md
│ ├── 3702-longest-subsequence-with-non-zero-bitwise-xor.md
│ ├── 3703-remove-k-balanced-substrings.md
│ ├── 3707-equal-score-substrings.md
│ ├── 3708-longest-fibonacci-subarray.md
│ ├── 3709-design-exam-scores-tracker.md
│ ├── 3712-sum-of-elements-with-frequency-divisible-by-k.md
│ ├── 3713-longest-balanced-substring-i.md
│ ├── 3715-sum-of-perfect-square-ancestors.md
│ ├── 3718-smallest-missing-multiple-of-k.md
│ ├── 3719-longest-balanced-subarray-i.md
│ ├── 3720-lexicographically-smallest-permutation-greater-than-target.md
│ ├── 3721-longest-balanced-subarray-ii.md
│ ├── 373-find-k-pairs-with-smallest-sums.md
│ ├── 3731-find-missing-elements.md
│ ├── 3732-maximum-product-of-three-elements-after-one-replacement.md
│ ├── 3733-minimum-time-to-complete-all-deliveries.md
│ ├── 3740-minimum-distance-between-three-equal-elements-i.md
│ ├── 3741-minimum-distance-between-three-equal-elements-ii.md
│ ├── 3742-maximum-path-score-in-a-grid.md
│ ├── 3745-maximize-expression-of-three-elements.md
│ ├── 3746-minimum-string-length-after-balanced-removals.md
│ ├── 3747-count-distinct-integers-after-removing-zeros.md
│ ├── 3748-sort-matrix-by-diagonals.md
│ ├── 3750-minimum-number-of-flips-to-reverse-binary-string.md
│ ├── 3751-total-waviness-of-numbers-in-range-i.md
│ ├── 3752-lexicographically-smallest-negated-permutation-that-sums-to-target.md
│ ├── 3765-complete-prime-number.md
│ ├── 3766-minimum-operations-to-make-binary-palindrome.md
│ ├── 3767-maximize-points-after-choosing-k-tasks.md
│ ├── 3769-sort-integers-by-binary-reflection.md
│ ├── 3770-largest-prime-from-consecutive-prime-sum.md
│ ├── 3771-total-score-of-dungeon-runs.md
│ ├── 3774-absolute-difference-between-maximum-and-minimum-k-elements.md
│ ├── 3775-reverse-words-with-same-vowel-count.md
│ ├── 3776-minimum-moves-to-balance-circular-array.md
│ ├── 3779-minimum-number-of-operations-to-have-distinct-elements.md
│ ├── 3780-maximum-sum-of-three-numbers-divisible-by-three.md
│ ├── 3781-maximum-score-after-binary-swaps.md
│ ├── 3783-mirror-distance-of-an-integer.md
│ ├── 3784-minimum-deletion-cost-to-make-all-characters-equal.md
│ ├── 3785-minimum-swaps-to-avoid-forbidden-values.md
│ ├── 401-binary-watch.md
│ ├── 480-sliding-window-median.md
│ └── 661-49-group-anagrams.md
├── SQL/
│ ├── 0197-rising-temperature.sql
│ ├── 0570-managers-with-at-least-5-direct-reports.sql
│ ├── 0577-employee-bonus.sql
│ ├── 0584-find-customer-referee.sql
│ ├── 0595-big-countries.sql
│ ├── 0620-not-boring-movies.sql
│ ├── 1068-product-sales-analysis-i.sql
│ ├── 1075-project-employees-i.sql
│ ├── 1148-article-views-i.sql
│ ├── 1251-average-selling-price.sql
│ ├── 1280-students-and-examinations.sql
│ ├── 1378-replace-employee-id-with-the-unique-identifier.sql
│ ├── 1581-customer-who-visited-but-did-not-make-any-transactions.sql
│ ├── 1633-percentage-of-users-attended-a-contest.sql
│ ├── 1661-average-time-of-process-per-machine.sql
│ ├── 1683-invalid-tweets.sql
│ ├── 1757-recyclable-and-low-fat-products.sql
│ ├── 1934-confirmation-rate.sql
│ └── 2985-calculate-compressed-mean.sql
├── TypeScript/
│ ├── 0001-two-sum.ts
│ ├── 2618-check-if-object-instance-of-class.ts
│ ├── 2619-array-prototype-last.ts
│ ├── 2620-counter.ts
│ ├── 2621-sleep.ts
│ ├── 2622-cache-with-time-limit.ts
│ ├── 2623-memoize.ts
│ ├── 2624-snail-traversal.ts
│ ├── 2625-flatten-deeply-nested-array.ts
│ ├── 2626-array-reduce-transformation.ts
│ ├── 2627-debounce.ts
│ ├── 2628-json-deep-equal.ts
│ ├── 2629-function-composition.ts
│ ├── 2630-memoize-ii.ts
│ ├── 2631-group-by.ts
│ ├── 2632-curry.ts
│ ├── 2633-convert-object-to-json-string.ts
│ ├── 2634-filter-elements-from-array.ts
│ ├── 2635-apply-transform-over-each-element-in-array.ts
│ ├── 2636-promise-pool.ts
│ ├── 2637-promise-time-limit.ts
│ ├── 2648-generate-fibonacci-sequence.ts
│ ├── 2649-nested-array-generator.ts
│ ├── 2650-design-cancellable-function.ts
│ ├── 2665-counter-ii.ts
│ ├── 2666-allow-one-function-call.ts
│ ├── 2667-create-hello-world-function.ts
│ ├── 2675-array-of-objects-to-matrix.ts
│ ├── 2676-throttle.ts
│ ├── 2677-chunk-array.ts
│ ├── 2690-infinite-method-object.ts
│ └── 2692-make-object-immutable.ts
├── organize.py
├── organize_and_clean.sh
├── package.json
└── stats.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/FUNDING.yml
================================================
custom: https://www.buymeacoffee.com/hogan.tech
================================================
FILE: .github/scripts/update_leetcode.cjs
================================================
const fs = require("fs");
const fetch = require("node-fetch");
const username = "hogantech";
const url = `https://leetcard.jacoblin.cool/${username}?ext=heatmap`;
const outputPath = "./assets/leetcode.svg";
async function updateLeetCodeCard() {
try {
const response = await fetch(url);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const svg = await response.text();
fs.writeFileSync(outputPath, svg);
console.log("LeetCode stats card updated successfully!");
} catch (err) {
console.error("Failed to update LeetCode stats:", err);
process.exit(1);
}
}
updateLeetCodeCard();
================================================
FILE: .github/test.txt
================================================
3721-longest-balanced-subarray-ii python hard
================================================
FILE: .github/workflows/python-publish.yml
================================================
name: Update Stats
on:
workflow_dispatch:
schedule:
# Runs every 12 hours
- cron: "0 */12 * * *"
permissions:
contents: write
jobs:
update-leetcode:
name: Update local LeetCode stats card
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: true
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm install node-fetch@2
- name: Generate latest LeetCode SVG
run: |
mkdir -p assets
node .github/scripts/update_leetcode.cjs
- name: Commit and push updated LeetCode card
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add assets/leetcode.svg
git commit -m "chore: update LeetCode stats" || echo "No changes to commit"
git push
================================================
FILE: .vscode/settings.json
================================================
{
"files.associations": {
"*.js": "javascript",
"*.css": "css",
"*.cpp": "cpp",
"*.ros": "php",
"*.inc": "php",
"iostream": "cpp"
}
}
================================================
FILE: C++/0002-add-two-numbers.cpp
================================================
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
int sum=0;
ListNode *l3=NULL;
ListNode **node=&l3;
while(l1!=NULL||l2!=NULL||sum>0)
{
if(l1!=NULL)
{
sum+=l1->val;
l1=l1->next;
}
if(l2!=NULL)
{
sum+=l2->val;
l2=l2->next;
}
(*node)=new ListNode(sum%10);
sum/=10;
node=&((*node)->next);
}
return l3;
}
};
================================================
FILE: C++/0003-longest-substring-without-repeating-characters.cpp
================================================
class Solution {
public:
int lengthOfLongestSubstring(string s) {
vector<int> chars(128);
int left = 0, right = 0, res = 0;
while (right < s.length()) {
chars[s[right]]++;
while (chars[s[right]] > 1) {
chars[s[left]]--;
left++;
}
res = max(res, right - left + 1);
right++;
}
return res;
}
};
================================================
FILE: C++/0009-palindrome-number.cpp
================================================
class Solution
{
public:
bool isPalindrome(int x)
{
int revert = 0;
if (x < 0 || (!(x % 10) && x != 0))
{
return false;
}
while (x > revert)
{
revert = revert * 10 + x % 10;
x /= 10;
}
return x == revert || (revert / 10) == x;
}
};
================================================
FILE: C++/0013-roman-to-integer.cpp
================================================
class Solution
{
public:
int romanToInt(string s)
{
int i, ans = 0;
for (i = 0; i < s.length(); i++)
{
switch (s[i])
{
case 'I':
if (s[i + 1] == 'V')
{
ans += 4;
i++;
break;
}
if (s[i + 1] == 'X')
{
ans += 9;
i++;
break;
}
ans += 1;
break;
case 'V':
ans += 5;
break;
case 'X':
if (s[i + 1] == 'L')
{
ans += 40;
i++;
break;
}
if (s[i + 1] == 'C')
{
ans += 90;
i++;
break;
}
ans += 10;
break;
case 'L':
ans += 50;
break;
case 'C':
if (s[i + 1] == 'D')
{
ans += 400;
i++;
break;
}
if (s[i + 1] == 'M')
{
ans += 900;
i++;
break;
}
ans += 100;
break;
case 'D':
ans += 500;
break;
case 'M':
ans += 1000;
break;
default:
break;
}
}
return ans;
}
};
================================================
FILE: C++/0014-longest-common-prefix.cpp
================================================
class Solution
{
public:
string longestCommonPrefix(vector<string> &strs)
{
if (strs.empty())
return "";
if (strs.size() == 1)
return strs[0];
string ans = "";
int min_len = 200;
for (int i = 0; i < strs.size(); i++)
if (strs[i].size() < min_len)
min_len = strs[i].size();
for (int i = 0; i < min_len; i++)
{
for (int j = 0; j < strs.size()-1; j++)
{
if (strs[j][i] != strs[j + 1][i])
{
return ans;
}
}
ans += strs[0][i];
}
return ans;
}
};
================================================
FILE: C++/0015-3sum.cpp
================================================
class Solution {
void twoSumII(vector<int>& nums, int i, vector<vector<int>>& res) {
int lo = i + 1, hi = nums.size() - 1;
while (lo < hi) {
int sum = nums[i] + nums[lo] + nums[hi];
if (sum < 0) {
++lo;
} else if (sum > 0) {
--hi;
} else {
res.push_back({nums[i], nums[lo++], nums[hi--]});
while (lo < hi && nums[lo] == nums[lo - 1]) ++lo;
}
}
}
public:
vector<vector<int>> threeSum(vector<int>& nums) {
vector<vector<int>> output;
sort(nums.begin(), nums.end());
for (int i = 0; i < nums.size() && nums[i] <= 0; i++) {
if (i == 0 || nums[i - 1] != nums[i]) {
twoSumII(nums, i, output);
}
}
return output;
}
};
================================================
FILE: C++/0019-remove-nth-node-from-end-of-list.cpp
================================================
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode *removeNthFromEnd(ListNode *head, int n) {
ListNode *ptr;
ptr = head;
int total = 0;
while (ptr != NULL) {
ptr = ptr->next;
total++;
}
int delete_index = total - n - 1;
if (delete_index < 0) {
head = head->next;
return head;
}
ptr = head;
while (delete_index--) {
ptr = ptr->next;
}
if ((ptr->next)->next) {
ptr->next = (ptr->next)->next;
} else {
ptr->next = NULL;
}
return head;
}
};
================================================
FILE: C++/0020-valid-parentheses.cpp
================================================
class Solution
{
public:
bool isValid(string s)
{
int stack_top = 10;
char stack[10000];
int sum = 0;
for (int i = 0; i < s.size(); i++)
{
switch (s[i])
{
case '(':
case '[':
case '{':
stack[stack_top] = s[i];
stack_top++;
sum++;
break;
case ')':
if (stack[stack_top - 1] == '(')
{
stack[stack_top] = '\0';
stack_top--;
sum--;
}
else
{
return false;
}
break;
case ']':
if (stack[stack_top - 1] == '[')
{
stack[stack_top] = '\0';
stack_top--;
sum--;
}
else
{
return false;
}
break;
case '}':
if (stack[stack_top - 1] == '{')
{
stack[stack_top] = '\0';
stack_top--;
sum--;
}
else
{
return false;
}
break;
}
}
if (sum != 0)
return false;
return true;
}
};
================================================
FILE: C++/0021-merge-two-sorted-lists.cpp
================================================
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* mergeTwoLists(ListNode* list1, ListNode* list2) {
ListNode* prehead = new ListNode(-1);
ListNode* prev = prehead;
while (list1 != NULL && list2 != NULL) {
if (list1->val <= list2->val) {
prev->next = list1;
list1 = list1->next;
} else {
prev->next = list2;
list2 = list2->next;
}
prev = prev->next;
}
prev->next = (list1 == NULL) ? list2 : list1;
return prehead->next;
}
};
================================================
FILE: C++/0035-search-insert-position.cpp
================================================
class Solution
{
public:
int searchInsert(vector<int> &nums, int target)
{
int index = 0;
if (nums.size() == 1)
return (nums[0] < target ? 1 : 0);
for (int i = 0; i < nums.size(); i++)
{
if (nums[i] == target)
return i;
if (nums[i] < target && nums[i + 1] > target)
return i + 1;
if (nums[nums.size() - 1] < target)
return nums.size();
}
return index;
}
};
================================================
FILE: C++/0036-valid-sudoku.cpp
================================================
class Solution {
bool checkRow(vector<vector<char>> &board, int row) {
unordered_set<char> set;
for (int i = 0; i < 9; ++i) {
if (board[row][i] != '.') {
if (set.count(board[row][i])) {
return false;
}
set.insert(board[row][i]);
}
}
return true;
}
bool checkCol(vector<vector<char>> &board, int col) {
unordered_set<char> set;
for (int i = 0; i < 9; ++i) {
if (board[i][col] != '.') {
if (set.count(board[i][col])) {
return false;
}
set.insert(board[i][col]);
}
}
return true;
}
bool checkBox(vector<vector<char>> &board, int row, int col) {
unordered_set<char> set;
for (int i = row; i < row + 3; ++i) {
for (int j = col; j < col + 3; ++j) {
if (board[i][j] != '.') {
if (set.count(board[i][j])) {
return false;
}
set.insert(board[i][j]);
}
}
}
return true;
}
public:
bool isValidSudoku(vector<vector<char>> &board) {
bool output = true;
for (int i = 0; i < 9; i++) {
output = checkRow(board, i);
if (!output) {
return output;
}
}
for (int i = 0; i < 9; i++) {
output = checkCol(board, i);
if (!output) {
return output;
}
}
for (int i = 0; i < 9; i += 3) {
for (int j = 0; j < 9; j += 3) {
output = checkBox(board, i, j);
if (!output) {
return output;
}
}
}
return true;
}
};
================================================
FILE: C++/0045-jump-game-ii.cpp
================================================
class Solution {
public:
int jump(vector<int>& nums) {
int jumps = 0, currentJumpEnd = 0, farthest = 0;
for (int i = 0; i < nums.size() - 1; i++) {
farthest = max(farthest, i + nums[i]);
if (i == currentJumpEnd) {
jumps++;
currentJumpEnd = farthest;
}
}
return jumps;
}
};
================================================
FILE: C++/0046-permutations.cpp
================================================
class Solution {
public:
vector<vector<int>> permute(vector<int>& num) {
vector<vector<int>> res;
vector<int> out, visited(num.size(), 0);
permuteDFS(num, 0, visited, out, res);
return res;
}
void permuteDFS(vector<int>& num, int level, vector<int>& visited,
vector<int>& out, vector<vector<int>>& res) {
if (level == num.size()) {
res.push_back(out);
return;
}
for (int i = 0; i < num.size(); ++i) {
if (visited[i] == 1) continue;
visited[i] = 1;
out.push_back(num[i]);
permuteDFS(num, level + 1, visited, out, res);
out.pop_back();
visited[i] = 0;
}
}
};
================================================
FILE: C++/0048-rotate-image.cpp
================================================
class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
transpose(matrix);
reflect(matrix);
}
void transpose(vector<vector<int>>& matrix) {
int n = matrix.size();
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
int tmp = matrix[j][i];
matrix[j][i] = matrix[i][j];
matrix[i][j] = tmp;
}
}
}
void reflect(vector<vector<int>>& matrix) {
int n = matrix.size();
for (int i = 0; i < n; i++) {
for (int j = 0; j < n / 2; j++) {
int tmp = matrix[i][j];
matrix[i][j] = matrix[i][n - j - 1];
matrix[i][n - j - 1] = tmp;
}
}
}
};
================================================
FILE: C++/0054-spiral-matrix.cpp
================================================
class Solution {
public:
vector<int> spiralOrder(vector<vector<int>>& matrix) {
vector<int> list;
int rows = matrix.size();
int cols = matrix[0].size();
int top = 0;
int bottom = rows - 1;
int left = 0;
int right = cols - 1;
while (list.size() < rows * cols) {
for (int i = left; i <= right; i++) {
list.push_back(matrix[top][i]);
}
for (int i = top + 1; i <= bottom; i++) {
list.push_back(matrix[i][right]);
}
if (top != bottom) {
for (int i = right - 1; i >= left; i--) {
list.push_back(matrix[bottom][i]);
}
}
if (left != right) {
for (int i = bottom - 1; i > top; i--) {
list.push_back(matrix[i][left]);
}
}
left++;
top++;
right--;
bottom--;
}
return list;
}
};
================================================
FILE: C++/0055-jump-game.cpp
================================================
class Solution {
public:
bool canJump(vector<int>& nums) {
int last_pos = nums.size()-1;
for(int i = nums.size()-1;i >=0;i --){
if(nums[i] + i >= last_pos){
last_pos = i;
}
}
return last_pos == 0;
}
};
================================================
FILE: C++/0056-merge-intervals.cpp
================================================
class Solution {
public:
vector<vector<int>> merge(vector<vector<int>>& intervals) {
sort(intervals.begin(), intervals.end());
vector<vector<int>> merged;
for (auto interval : intervals) {
if (merged.empty() || merged.back()[1] < interval[0]) {
merged.push_back(interval);
} else {
merged.back()[1] = max(merged.back()[1], interval[1]);
}
}
return merged;
}
};
================================================
FILE: C++/0059-spiral-matrix-ii.cpp
================================================
class Solution {
public:
vector<vector<int>> generateMatrix(int n) {
vector<vector<int>> result(n, vector<int>(n));
int cnt = 1;
for (int layer = 0; layer < (n + 1) / 2; layer++) {
// direction 1 - traverse from left to right
for (int ptr = layer; ptr < n - layer; ptr++) {
result[layer][ptr] = cnt++;
}
// direction 2 - traverse from top to bottom
for (int ptr = layer + 1; ptr < n - layer; ptr++) {
result[ptr][n - layer - 1] = cnt++;
}
// direction 3 - traverse from right to left
for (int ptr = n - layer - 2; ptr >= layer; ptr--) {
result[n - layer - 1][ptr] = cnt++;
}
// direction 4 - traverse from bottom to top
for (int ptr = n - layer - 2; ptr > layer; ptr--) {
result[ptr][layer] = cnt++;
}
}
return result;
}
};
================================================
FILE: C++/0070-climbing-stairs.cpp
================================================
class Solution {
public:
int climbStairs(int n) {
if (n == 0 || n == 1) {
return 1;
}
vector<int> dp(n+1);
dp[1] = 1;
dp[2] = 2;
for (int i = 3; i <= n; i++) {
dp[i] = dp[i - 1] + dp[i - 2];
}
return dp[n];
}
};
================================================
FILE: C++/0074-search-a-2d-matrix.cpp
================================================
class Solution {
public:
bool searchMatrix(vector<vector<int>> &matrix, int target) {
int row = matrix.size();
if (row == 0) return false;
int col = matrix[0].size();
int left = 0;
int right = row * col - 1;
int pivot, pivot_element;
while (left <= right) {
pivot = (left + right) / 2;
pivot_element = matrix[pivot / col][pivot % col];
if (target == pivot_element) {
return true;
}
if (target < pivot_element) {
right = pivot - 1;
} else {
left = pivot + 1;
}
}
return false;
}
};
================================================
FILE: C++/0075-sort-colors.cpp
================================================
class Solution {
void swap(int *a, int *b) {
int temp = *a;
*a = *b;
*b = temp;
}
int Partition(vector<int> & arr, int front, int end) {
int pivot = arr[end];
int i = front - 1;
for (int j = front; j < end; j++) {
if (arr[j] < pivot) {
i++;
swap(&arr[i], &arr[j]);
}
}
i++;
swap(&arr[i], &arr[end]);
return i;
}
void QuickSort(vector<int> &arr, int front, int end) {
if (front < end) {
int pivot = Partition(arr, front, end);
QuickSort(arr, front, pivot - 1);
QuickSort(arr, pivot + 1, end);
}
}
public:
void sortColors(vector<int> &nums) {
QuickSort(nums, 0, nums.size() - 1);
}
};
================================================
FILE: C++/0077-combinations.cpp
================================================
class Solution {
vector<vector<int>> ans;
// n = 4;k = 2;
int N, K;
void findCombination(int start, vector<int> &row) {
if (row.size() == K) {
ans.push_back(row);
return;
}
if (N - start + 1 + row.size() >= K) {
for (int i = start; i <= N; i++) {
row.push_back(i);
findCombination(i + 1, row);
row.pop_back();
}
}
}
public:
vector<vector<int>> combine(int n, int k) {
vector<int> row = vector<int>();
N = n;
K = k;
findCombination(1, row);
return ans;
}
};
================================================
FILE: C++/0083-remove-duplicates-from-sorted-list.cpp
================================================
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* deleteDuplicates(ListNode* head) {
ListNode* current;
current = head;
while (head != NULL && current->next != NULL) {
if (current->val == current->next->val) {
current->next = current->next->next;
} else {
current = current->next;
}
}
return head;
}
};
================================================
FILE: C++/0088-merge-sorted-array.cpp
================================================
class Solution
{
public:
void merge(vector<int> &nums1, int m, vector<int> &nums2, int n)
{
for (int i = 0; i < n; i++)
nums1[i + m] = nums2[i];
sort(nums1.begin(), nums1.end());
}
};
================================================
FILE: C++/0094-binary-tree-inorder-traversal.cpp
================================================
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
* };
*/
class Solution {
void inorderTraversal(TreeNode *root, vector<int> &ans) {
if (root == nullptr) return;
inorderTraversal(root->left, ans);
ans.push_back(root->val);
inorderTraversal(root->right, ans);
}
public:
vector<int> inorderTraversal(TreeNode *root) {
vector<int> ans;
inorderTraversal(root, ans);
return ans;
}
};
================================================
FILE: C++/0098-validate-binary-search-tree.cpp
================================================
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
* };
*/
class Solution {
public:
bool isValidBST(TreeNode *root, TreeNode *min = NULL, TreeNode *max = NULL) {
if (!root) return true;
if (min != NULL && root->val <= min->val) return false;
if (max != NULL && root->val >= max->val) return false;
return isValidBST(root->left, min, root) &&
isValidBST(root->right, root, max);
}
};
================================================
FILE: C++/0101-symmetric-tree.cpp
================================================
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
* };
*/
class Solution {
bool isMirror(TreeNode *t1, TreeNode *t2) {
if (t1 == NULL && t2 == NULL) return true;
if (t1 == NULL || t2 == NULL) return false;
return (t1->val == t2->val) && isMirror(t1->right, t2->left) &&
isMirror(t1->left, t2->right);
}
public:
bool isSymmetric(TreeNode *root) { return isMirror(root, root); }
};
================================================
FILE: C++/0102-binary-tree-level-order-traversal.cpp
================================================
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
* };
*/
class Solution {
public:
vector<vector<int>> levelOrder(TreeNode *root) {
vector<vector<int>> ans;
if (root == NULL) return ans;
queue<TreeNode *> q;
q.push(root);
int level = 0;
while (!q.empty()) {
int level_length = q.size();
vector<int> levels;
for (int i = 0; i < level_length; ++i) {
TreeNode *current = q.front();
q.pop();
levels.push_back(current->val);
if (current->left != NULL) q.push(current->left);
if (current->right != NULL) q.push(current->right);
}
for (int i = 0; i < levels.size(); i++) {
cout << levels[i] << " ";
}
ans.push_back(levels);
cout << endl;
level++;
}
return ans;
}
};
================================================
FILE: C++/0104-maximum-depth-of-binary-tree.cpp
================================================
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
* };
*/
class Solution {
public:
int maxDepth(TreeNode *root) {
if (root == NULL) return 0;
queue<TreeNode *> q;
q.push(root);
int level = 0;
while (!q.empty()) {
int level_length = q.size();
vector<int> levels;
for (int i = 0; i < level_length; ++i) {
TreeNode *current = q.front();
q.pop();
levels.push_back(current->val);
if (current->left != NULL) q.push(current->left);
if (current->right != NULL) q.push(current->right);
}
level++;
}
return level;
}
};
================================================
FILE: C++/0112-path-sum.cpp
================================================
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
* };
*/
class Solution {
public:
bool hasPathSum(TreeNode *root, int targetSum) {
if (root == NULL) return false;
targetSum -= root->val;
if (root->left == NULL && root->right == NULL) {
if (targetSum == 0)
return true;
else
return false;
}
return hasPathSum(root->left, targetSum) ||
hasPathSum(root->right, targetSum);
}
};
================================================
FILE: C++/0116-populating-next-right-pointers-in-each-node.cpp
================================================
/*
// Definition for a Node.
class Node {
public:
int val;
Node* left;
Node* right;
Node* next;
Node() : val(0), left(NULL), right(NULL), next(NULL) {}
Node(int _val) : val(_val), left(NULL), right(NULL), next(NULL) {}
Node(int _val, Node* _left, Node* _right, Node* _next)
: val(_val), left(_left), right(_right), next(_next) {}
};
*/
class Solution {
public:
Node* connect(Node* root) {
if (root == NULL) return root;
queue<Node*> q;
q.push(root);
int size = 0;
while (!q.empty()) {
size = q.size();
for (int i = 0; i < size; i++) {
Node* current = q.front();
q.pop();
cout << current->val << " ";
if (i < size - 1) {
current->next = q.front();
}
if (current->left != NULL) q.push(current->left);
if (current->right != NULL) q.push(current->right);
}
}
return root;
}
};
================================================
FILE: C++/0118-pascals-triangle.cpp
================================================
class Solution
{
public:
vector<vector<int> > generate(int numRows)
{
vector<vector<int> > ret;
ret.reserve(numRows);
for (int n = 0; n < numRows; n++)
{
vector<int> row;
row.push_back(1);
row.reserve(n + 1);
for (int k = 1; k <= n; k++)
{
row.push_back(row.back() * (n + 1 - k) / k);
}
ret.push_back(row);
}
return ret;
}
};
================================================
FILE: C++/0119-pascals-triangle-ii.cpp
================================================
class Solution {
public:
vector<int> getRow(int rowIndex) {
vector<int> curr, prev = {1};
for (int i = 1; i <= rowIndex; i++) {
curr.assign(i + 1, 1);
for (int j = 1; j < i; j++)
curr[j] = prev[j - 1] + prev[j];
prev = move(curr); // This is O(1)
}
return prev;
}
};
================================================
FILE: C++/0120-triangle.cpp
================================================
class Solution {
public:
int minimumTotal(vector<vector<int>>& triangle) {
for (int row = 1; row < triangle.size(); row++) {
for (int col = 0; col < triangle[row].size(); col++) {
int min_sum = INT_MAX;
if (col > 0) {
min_sum = triangle[row - 1][col - 1];
}
if (col < row) {
min_sum = min(min_sum, triangle[row - 1][col]);
}
int path = min_sum + triangle[row][col];
triangle[row][col] = path;
}
}
int smallest = INT_MAX;
int row_amount = triangle.size();
for (int j = 0; j < triangle[row_amount - 1].size(); j++) {
smallest = min(triangle[row_amount - 1][j], smallest);
}
return smallest;
}
};
================================================
FILE: C++/0121-best-time-to-buy-and-sell-stock.cpp
================================================
class Solution
{
public:
int maxProfit(vector<int> &prices)
{
int min = 10000;
int max_profit = 0;
for (int i = 0; i < prices.size(); i++)
{
if (min > prices[i])
{
min = prices[i];
}
else
{
max_profit = max(max_profit, prices[i] - min);
}
}
return max_profit;
}
};
================================================
FILE: C++/0136-single-number.cpp
================================================
class Solution {
public:
int singleNumber(vector<int>& nums) {
int output = 0;
for(int i = 0;i < nums.size();i ++){
output = output ^ nums[i];
}
return output;
}
};
================================================
FILE: C++/0141-linked-list-cycle.cpp
================================================
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
bool hasCycle(ListNode* head) {
ListNode* slow;
slow = head;
ListNode* fast;
fast = head;
while (fast != NULL && fast->next != NULL) {
slow = slow->next;
fast = fast->next->next;
if (slow == fast) return true;
}
return false;
}
};
================================================
FILE: C++/0144-binary-tree-preorder-traversal.cpp
================================================
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
* };
*/
class Solution {
void preorderTraversal(TreeNode *root, vector<int> &ans) {
if (root == nullptr) return;
ans.push_back(root->val);
preorderTraversal(root->left, ans);
preorderTraversal(root->right, ans);
}
public:
vector<int> preorderTraversal(TreeNode *root) {
vector<int> ans;
preorderTraversal(root, ans);
return ans;
}
};
================================================
FILE: C++/0145-binary-tree-postorder-traversal.cpp
================================================
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
* };
*/
class Solution {
void postorderTraversal(TreeNode *root, vector<int> &ans) {
if (root == nullptr) return;
postorderTraversal(root->left, ans);
postorderTraversal(root->right, ans);
ans.push_back(root->val);
}
public:
vector<int> postorderTraversal(TreeNode *root) {
vector<int> ans;
postorderTraversal(root, ans);
return ans;
}
};
================================================
FILE: C++/0167-two-sum-ii-input-array-is-sorted.cpp
================================================
class Solution
{
public:
vector<int> twoSum(vector<int> &nums, int target)
{
vector<int> twoSum;
int low = 0;
int high = nums.size() - 1;
while (low < high)
{
int sum = nums[low] + nums[high];
if (sum == target)
{
twoSum.push_back(low + 1);
twoSum.push_back(high + 1);
return twoSum;
}
if (sum > target)
--high;
if (sum < target)
++low;
}
twoSum.push_back(-1);
twoSum.push_back(-1);
return twoSum;
}
};
================================================
FILE: C++/0169-majority-element.cpp
================================================
class Solution {
public:
int majorityElement(vector<int>& nums) {
sort(nums.begin(),nums.end());
return nums[nums.size()/2];
}
};
================================================
FILE: C++/0189-rotate-array.cpp
================================================
class Solution
{
public:
void rotate(vector<int> &nums, int k)
{
vector<int> a = nums;
for (int i = 0; i < nums.size(); i++)
{
a[(k + i) % nums.size()] = nums[i];
}
for (int i = 0; i < nums.size(); i++)
{
nums[i] = a[i];
}
}
};
================================================
FILE: C++/0190-reverse-bits.cpp
================================================
class Solution {
public:
uint32_t reverseBits(uint32_t n) {
uint32_t ret = 0, power = 31;
while (n != 0) {
ret += (n & 1) << power;
n = n >> 1;
power -= 1;
}
return ret;
}
};
================================================
FILE: C++/0191-number-of-1-bits.cpp
================================================
class Solution {
public:
int hammingWeight(uint32_t n) {
int sum = 0, mask = 1;
for (int i = 0; i < 32; i++) {
if ((n & mask) != 0) sum++;
n >>= 1;
}
return sum;
}
};
================================================
FILE: C++/0198-house-robber.cpp
================================================
class Solution {
public:
int rob(vector<int>& nums) {
int total = nums.size();
if (total == 0) return 0;
vector<int> maxRobbedAmount(total + 1, 0);
maxRobbedAmount[total] = 0;
maxRobbedAmount[total - 1] = nums[total - 1];
for (int i = total - 2; i >= 0; i--) {
maxRobbedAmount[i] =
max(maxRobbedAmount[i + 1], maxRobbedAmount[i + 2] + nums[i]);
}
return maxRobbedAmount[0];
}
};
================================================
FILE: C++/0203-remove-linked-list-elements.cpp
================================================
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* removeElements(ListNode* head, int val) {
ListNode* temp;
ListNode* prehead = new ListNode(0);
ListNode* prev;
prehead->next = head;
prev = prehead;
temp = head;
while (temp != NULL) {
if (temp->val == val) {
prev->next = temp->next;
} else {
prev = temp;
}
temp = temp->next;
}
return prehead->next;
}
};
================================================
FILE: C++/0206-reverse-linked-list.cpp
================================================
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* reverseList(ListNode* head) {
ListNode* newHead = NULL;
while(head!=NULL)
{
ListNode* next = head->next;
head->next = newHead;
newHead = head;
head = next;
}
return newHead;
}
};
================================================
FILE: C++/0213-house-robber-ii.cpp
================================================
class Solution {
int rob_simple(vector<int>& nums, int start, int end) {
int t1 = 0;
int t2 = 0;
for (int i = start; i <= end; i++) {
int current = nums[i];
int temp = t1;
t1 = max(current + t2, t1);
t2 = temp;
}
return t1;
}
public:
int rob(vector<int>& nums) {
int total = nums.size();
if (total == 0) return 0;
if (total == 1) return nums[0];
if (total == 2) return max(nums[0], nums[1]);
int max1 = rob_simple(nums, 0, nums.size() - 2);
int max2 = rob_simple(nums, 1, nums.size() - 1);
return max(max1, max2);
}
};
================================================
FILE: C++/0217-contains-duplicate.cpp
================================================
class Solution
{
public:
bool containsDuplicate(vector<int> &nums)
{
sort(nums.begin(), nums.end());
for (int i = 1; i < nums.size(); i++)
{
if (nums[i-1] == nums[i])
{
return true;
}
}
return false;
}
};
================================================
FILE: C++/0231-power-of-two.cpp
================================================
class Solution {
public:
bool isPowerOfTwo(int n) {
if (n == 0) return false;
while (n % 2 == 0) n /= 2;
return n == 1;
}
};
================================================
FILE: C++/0232-implement-queue-using-stacks.cpp
================================================
class MyQueue {
stack<int> stack_q;
stack<int> buffer_q;
public:
void push(int x) { stack_q.push(x); }
int pop() {
if (buffer_q.empty()) {
while (!stack_q.empty()) {
buffer_q.push(stack_q.top());
stack_q.pop();
}
}
int temp = buffer_q.top();
buffer_q.pop();
return temp;
}
int peek() {
int temp = 0;
if (!buffer_q.empty()) {
temp = buffer_q.top();
} else {
while (!stack_q.empty()) {
buffer_q.push(stack_q.top());
stack_q.pop();
}
temp = buffer_q.top();
}
return temp;
}
bool empty() {
if (buffer_q.empty() && stack_q.empty())
return true;
else
return false;
}
};
/**
* Your MyQueue object will be instantiated and called as such:
* MyQueue* obj = new MyQueue();
* obj->push(x);
* int param_2 = obj->pop();
* int param_3 = obj->peek();
* bool param_4 = obj->empty();
*/
================================================
FILE: C++/0235-lowest-common-ancestor-of-a-binary-search-tree.cpp
================================================
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode *lowestCommonAncestor(TreeNode *root, TreeNode *p, TreeNode *q) {
if (p->val > root->val && q->val > root->val)
return lowestCommonAncestor(root->right, p, q);
if (p->val < root->val && q->val < root->val)
return lowestCommonAncestor(root->left, p, q);
else
return root;
}
};
================================================
FILE: C++/0242-valid-anagram.cpp
================================================
class Solution {
public:
bool isAnagram(string s, string t) {
sort(s.begin(), s.end());
sort(t.begin(), t.end());
if (s.compare(t) == 0)
return true;
else
return false;
}
};
================================================
FILE: C++/0278-first-bad-version.cpp
================================================
// The API isBadVersion is defined for you.
// bool isBadVersion(int version);
class Solution
{
public:
int firstBadVersion(int n)
{
int left = 1;
int right = n;
while (left < right)
{
int mid = left + (right - left) / 2;
if(isBadVersion(mid)){
right = mid;
}else{
left = mid+1;
}
}
return left;
}
};
================================================
FILE: C++/0283-move-zeroes.cpp
================================================
class Solution
{
public:
void moveZeroes(vector<int> &nums)
{
vector<int> output;
output.reserve(nums.size());
int count = 0;
for (int i = 0; i < nums.size(); i++)
{
if (nums[i] == 0)
count++;
if (nums[i])
output.push_back(nums[i]);
}
for (int i = 0; i < count; i++)
output.push_back(0);
nums = output;
}
};
================================================
FILE: C++/0344-reverse-string.cpp
================================================
class Solution {
public:
void reverseString(vector<char>& s) {
char temp = '\0';
for (int i = 0; i < (s.size() / 2); i++) {
temp = s[i];
s[i] = s[s.size() - i - 1];
s[s.size() - i - 1] = temp;
}
}
};
================================================
FILE: C++/0350-intersection-of-two-arrays-ii.cpp
================================================
class Solution
{
public:
vector<int> intersect(vector<int> &nums1, vector<int> &nums2)
{
sort(begin(nums1), end(nums1));
sort(begin(nums2), end(nums2));
nums1.erase(set_intersection(begin(nums1), end(nums1),
begin(nums2), end(nums2), begin(nums1)),
end(nums1));
return nums1;
}
};
================================================
FILE: C++/0383-ransom-note.cpp
================================================
class Solution {
public:
bool canConstruct(string ransomNote, string magazine) {
int map[26] = {0};
for (int i = 0; i < magazine.length(); i++) {
map[magazine[i] - 'a']++;
}
for (int i = 0; i < ransomNote.length(); i++) {
int value = map[ransomNote[i] - 'a'];
if (value <= 0) return false;
map[ransomNote[i] - 'a']--;
}
return true;
}
};
================================================
FILE: C++/0387-first-unique-character-in-a-string.cpp
================================================
class Solution {
public:
int firstUniqChar(string s) {
int count[26] = {0};
int n = s.length();
for (int i = 0; i < n; i++) {
int index = s[i] - 'a';
count[index]++;
}
for (int i = 0; i < n; i++) {
int index = s[i] - 'a';
if (count[index] == 1) {
return i;
}
}
return -1;
}
};
================================================
FILE: C++/0509-fibonacci-number.cpp
================================================
class Solution {
public:
int fib(int n) {
if(n == 0)return 0;
if(n == 1)return 1;
return fib(n-1)+fib(n-2);
}
};
================================================
FILE: C++/0542-01-matrix.cpp
================================================
class Solution {
public:
vector<vector<int>> updateMatrix(vector<vector<int>>& matrix) {
int row = matrix.size();
if (row == 0) return matrix;
int col = matrix[0].size();
vector<vector<int>> dist(row, vector<int>(col, INT_MAX));
queue<pair<int, int>> q;
for (int i = 0; i < row; i++) {
for (int j = 0; j < col; j++) {
if (matrix[i][j] == 0) {
dist[i][j] = 0;
q.push({i, j});
}
}
}
int dir[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
while (!q.empty()) {
pair<int, int> curr;
curr = q.front();
q.pop();
for (int i = 0; i < 4; i++) {
int new_r = curr.first + dir[i][0];
int new_c = curr.second + dir[i][1];
if (new_r >= 0 && new_c >= 0 && new_r < row && new_c < col) {
if (dist[new_r][new_c] > dist[curr.first][curr.second] + 1) {
dist[new_r][new_c] = dist[curr.first][curr.second] + 1;
q.push({new_r, new_c});
}
}
}
}
return dist;
}
};
================================================
FILE: C++/0557-reverse-words-in-a-string-iii.cpp
================================================
class Solution {
void reverseString(vector<char>& s) {
char temp = '\0';
for (int i = 0; i < (s.size() / 2); i++) {
temp = s[i];
s[i] = s[s.size() - i - 1];
s[s.size() - i - 1] = temp;
}
}
public:
string reverseWords(string s) {
vector<char> words;
string output;
for (int i = 0; i < s.size(); i++) {
if (s[i] != ' ') {
words.push_back(s[i]);
}
if (s[i] == ' ') {
reverseString(words);
output.insert(output.end(), words.begin(), words.end());
output.insert(output.end(), ' ');
words.clear();
}
if (i == s.size() - 1) {
reverseString(words);
output.insert(output.end(), words.begin(), words.end());
}
}
return output;
}
};
================================================
FILE: C++/0566-reshape-the-matrix.cpp
================================================
class Solution
{
public:
vector<vector<int> > matrixReshape(vector<vector<int> > &nums, int r, int c)
{
vector<vector<int> > newMatrix(r, vector<int>(c, 0));
int originalRaw = nums.size();
int originalColumn = nums[0].size();
if (originalRaw * originalColumn != r * c)
return nums;
int newRaw = 0, newColumn = 0;
for (int i = 0; i < originalRaw; i++)
{
for (int j = 0; j < originalColumn; j++)
{
newMatrix[newRaw][newColumn] = nums[i][j];
newColumn++;
if (newColumn == c)
{
newColumn = 0;
newRaw++;
}
}
}
return newMatrix;
}
};
================================================
FILE: C++/0567-permutation-in-string.cpp
================================================
class Solution {
bool matches(int map1[],int map2[]){
for(int i = 0;i < 26;i ++){
if(map1[i] != map2[i]){
return false;
}
}
return true;
}
public:
bool checkInclusion(string s1, string s2) {
if (s1.length() > s2.length()) return false;
int map1[26] = {0};
for (int i = 0; i < s1.length(); i++) {
map1[s1[i] - 'a']++;
}
for (int i = 0; i <= s2.length() - s1.length(); i++) {
int map2[26] = {0};
for (int j = 0; j < s1.length(); j++) {
map2[s2[i+j] - 'a']++;
}
if(matches(map1,map2)){
return true;
}
}
return false;
}
};
================================================
FILE: C++/0617-merge-two-binary-trees.cpp
================================================
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
* };
*/
class Solution {
public:
TreeNode *mergeTrees(TreeNode *root1, TreeNode *root2) {
if (!root1) return root2;
if (!root2) return root1;
root1->val += root2->val;
root1->left = mergeTrees(root1->left, root2->left);
root1->right = mergeTrees(root1->right, root2->right);
return root1;
}
};
================================================
FILE: C++/0653-two-sum-iv-input-is-a-bst.cpp
================================================
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
* };
*/
class Solution {
void Inorder(TreeNode *current, vector<int> &output) {
if (current) {
Inorder(current->left, output);
// cout << current->val << " ";
output.push_back(current->val);
Inorder(current->right, output);
}
}
public:
bool findTarget(TreeNode *root, int k) {
vector<int> output;
Inorder(root, output);
int r = output.size() - 1;
int l = 0;
int sum = 0;
while (l < r) {
sum = output[l] + output[r];
if (sum == k) return true;
if (sum > k) {
r--;
} else {
l++;
}
}
return false;
}
};
================================================
FILE: C++/0695-max-area-of-island.cpp
================================================
class Solution {
int findPath(vector<vector<int>>& grid, int x, int y) {
int counter = 0;
if (grid[x][y] == 1) {
counter++;
grid[x][y] = 0;
if (grid[x + 1][y] == 1) {
counter += findPath(grid, x + 1, y);
}
if (grid[x - 1][y] == 1) {
counter += findPath(grid, x - 1, y);
}
if (grid[x][y + 1] == 1) {
counter += findPath(grid, x, y + 1);
}
if (grid[x][y - 1] == 1) {
counter += findPath(grid, x, y - 1);
}
}
return counter;
}
public:
int maxAreaOfIsland(vector<vector<int>>& grid) {
int sum = 0;
vector<vector<int>> big_grid(grid.size() + 2,
vector<int>(grid[0].size() + 2, 0));
for (int i = 0; i < grid.size(); i++) {
for (int j = 0; j < grid[0].size(); j++) {
big_grid[i + 1][j + 1] = grid[i][j];
}
}
for (int i = 0; i < big_grid.size(); i++) {
for (int j = 0; j < big_grid[0].size(); j++) {
sum = max(findPath(big_grid, i, j), sum);
}
}
return sum;
}
};
================================================
FILE: C++/0700-search-in-a-binary-search-tree.cpp
================================================
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
* };
*/
class Solution {
public:
TreeNode *searchBST(TreeNode *root, int val) {
TreeNode *temp;
if (root) {
if (root->val == val) return root;
if (root->val < val) {
return searchBST(root->right, val);
} else {
return searchBST(root->left, val);
}
}
return root;
}
};
================================================
FILE: C++/0701-insert-into-a-binary-search-tree.cpp
================================================
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
* };
*/
class Solution {
public:
TreeNode *insertIntoBST(TreeNode *root, int val) {
if (root == NULL) return new TreeNode(val);
if (root) {
if (root->val < val) {
root->right = insertIntoBST(root->right, val);
} else {
root->left = insertIntoBST(root->left, val);
}
}
return root;
}
};
================================================
FILE: C++/0704-binary-search.cpp
================================================
class Solution
{
public:
int search(vector<int> &nums, int target)
{
int left = 0,mid;
int right = nums.size() - 1;
while (left <= right)
{
mid = left + (right - left) / 2;
if (nums[mid] == target)
return mid;
if (nums[mid] < target)
left = mid + 1;
else
right = mid - 1;
}
return -1;
}
};
================================================
FILE: C++/0706-design-hashmap.cpp
================================================
class MyHashMap {
int size = 173;
int hash(int key) { return key % size; }
vector<list<pair<int, int>>> myhashmap;
list<pair<int, int>>::iterator myFind(int index, int key) {
return find_if(myhashmap[index].begin(), myhashmap[index].end(),
[key](pair<int, int> tmp) { return tmp.first == key; });
}
public:
MyHashMap() : myhashmap(size, list<pair<int,int>>()) {}
void put(int key, int value) {
int index = hash(key);
list<pair<int, int>>::iterator iter = myFind(index, key);
if (iter == myhashmap[index].end()) {
myhashmap[index].push_front({key,value});
} else {
iter->second = value;
}
}
int get(int key) {
int index = hash(key);
list<pair<int, int>>::iterator iter = myFind(index, key);
if (iter == myhashmap[index].end()) {
return -1;
} else {
return iter->second;
}
}
void remove(int key) {
int index = hash(key);
list<pair<int, int>>::iterator iter = myFind(index, key);
if (iter == myhashmap[index].end()) {
return;
} else {
myhashmap[index].erase(iter);
}
}
};
/**
* Your MyHashMap object will be instantiated and called as such:
* MyHashMap* obj = new MyHashMap();
* obj->put(key,value);
* int param_2 = obj->get(key);
* obj->remove(key);
*/
================================================
FILE: C++/0733-flood-fill.cpp
================================================
class Solution {
public:
vector<vector<int>> floodFill(vector<vector<int>>& image, int sr, int sc, int newColor) {
int m = image.size();
int n = image[0].size();
queue<pair<int, int>> q;
q.push(make_pair(sr, sc));
int startColor = image[sr][sc];
if (startColor == newColor) return image;
int e[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
image[sr][sc] = newColor;
while (!q.empty()) {
int r = q.front().first;
int c = q.front().second;
q.pop();
for (int k = 0; k < 4; k++) {
int x = r + e[k][0];
int y = c + e[k][1];
if (x >= 0 && y >= 0 && x < m && y < n && image[x][y] == startColor) {
image[x][y] = newColor;
q.push(make_pair(x, y));
}
}
}
return image;
}
};
================================================
FILE: C++/0746-min-cost-climbing-stairs.cpp
================================================
class Solution {
public:
int minCostClimbingStairs(vector<int>& cost) {
vector<int> min_sum(cost.size() + 1);
for (int i = 2; i < min_sum.size(); i++) {
min_sum[i] =
min(min_sum[i - 1] + cost[i - 1], min_sum[i - 2] + cost[i - 2]);
}
return min_sum[min_sum.size() - 1];
}
};
================================================
FILE: C++/0784-letter-case-permutation.cpp
================================================
class Solution {
public:
vector<string> letterCasePermutation(string S) {
vector<string> output;
output.push_back("");
for (int i = 0; i < S.length(); i++) {
if (isalpha(S[i])) {
vector<string> temp;
for (auto o : output) {
temp.push_back(o + (char)toupper(S[i]));
temp.push_back(o + (char)tolower(S[i]));
}
output = temp;
} else {
for (auto &o : output) {
o += S[i];
}
}
}
return output;
}
};
================================================
FILE: C++/0876-middle-of-the-linked-list.cpp
================================================
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* middleNode(ListNode* head) {
ListNode *p = head;
int counter = 0;
cout << endl;
while(p != NULL){
p = p->next;
counter ++;
}
counter /= 2;
while(counter -- > 0){
head = head->next;
}
return head;
}
};
================================================
FILE: C++/0977-squares-of-a-sorted-array.cpp
================================================
class Solution
{
public:
vector<int> sortedSquares(vector<int> &nums)
{
vector<int> ans(nums.size());
for (int i = 0; i < nums.size(); i++)
ans[i] = nums[i] * nums[i];
sort(ans.begin(), ans.end());
return ans;
}
};
================================================
FILE: C++/0994-rotting-oranges.cpp
================================================
class Solution {
public:
int orangesRotting(vector<vector<int>>& grid) {
queue<pair<int, int>> q;
int freshOrange = 0;
int rows = grid.size();
int cols = grid[0].size();
for (int r = 0; r < rows; r++) {
for (int c = 0; c < cols; c++) {
if (grid[r][c] == 2) {
q.push({r, c});
} else {
if (grid[r][c] == 1) {
freshOrange++;
}
}
}
}
q.push({-1, -1});
int minutesElapsed = -1;
int dir[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
while (!q.empty()) {
pair<int, int> curr = q.front();
q.pop();
int cur_row = curr.first;
int cur_col = curr.second;
if (cur_row == -1) {
minutesElapsed++;
if (!q.empty()) {
q.push({-1, -1});
}
} else {
for (int i = 0; i < 4; i++) {
int new_row = cur_row + dir[i][0];
int new_col = cur_col + dir[i][1];
if (new_row >= 0 && new_col >= 0 && new_row < rows &&
new_col < cols) {
if (grid[new_row][new_col] == 1) {
grid[new_row][new_col] = 2;
freshOrange--;
q.push({new_row, new_col});
}
}
}
}
}
return (freshOrange == 0 ? minutesElapsed : -1);
}
};
================================================
FILE: C++/1137-n-th-tribonacci-number.cpp
================================================
class Solution {
public:
int tribonacci(int n) {
if (n == 0) return 0;
if (n == 1 || n == 2) return 1;
int temp = 0, a = 0, b = 1, c = 1;
for (int i = 3; i <= n; i++) {
temp = a + b + c;
a = b;
b = c;
c = temp;
}
return c;
}
};
================================================
FILE: C++/1265-print-immutable-linked-list-in-reverse.cpp
================================================
/**
* // This is the ImmutableListNode's API interface.
* // You should not implement it, or speculate about its implementation.
* class ImmutableListNode {
* public:
* void printValue(); // print the value of the node.
* ImmutableListNode* getNext(); // return the next node.
* };
*/
class Solution
{
public:
void printLinkedListInReverse(ImmutableListNode *head)
{
int count = 0;
ImmutableListNode *t_current = head;
// get Count
while (t_current != NULL)
{
count++;
t_current = t_current->getNext();
}
for (int i = count; i >= 1; i--)
{
ImmutableListNode *current = head;
for (int j = 0; j < i - 1 && current != NULL; j++)
{
current = current->getNext();
}
current->printValue();
}
}
};
================================================
FILE: C++/1920-build-array-from-permutation.cpp
================================================
class Solution
{
public:
vector<int> buildArray(vector<int> &nums)
{
vector<int> ans = nums;
for(int i = 0;i < nums.size();i ++){
ans[i] = nums[nums[i]];
}
return ans;
}
};
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
================================================
FILE: JavaScript/0020-valid-parentheses.js
================================================
/**
* @param {string} s
* @return {boolean}
* Time complexity: O(n)
* Space complexity: O(n)
*/
var isValid = function(s) {
const bracketMap = { "(": ")", "[": "]", "{": "}" };
const openSet = new Set(["(", "[", "{"]);
const stack = [];
for (let char of s) {
if (openSet.has(char)) {
stack.push(char);
} else if (stack.length > 0 && char === bracketMap[stack[stack.length - 1]]) {
stack.pop();
} else {
return false;
}
}
return stack.length === 0;
};
const input = "(())";
console.log(isValid(input)); // Output will be true or false based on the validity of the parentheses.
================================================
FILE: JavaScript/0021-merge-two-sorted-lists.js
================================================
/**
* Definition for singly-linked list.
* function ListNode(val, next) {
* this.val = (val===undefined ? 0 : val)
* this.next = (next===undefined ? null : next)
* }
*/
/**
* @param {ListNode} list1
* @param {ListNode} list2
* @return {ListNode}
*/
var mergeTwoLists = function (list1, list2) {
let dummy = new ListNode();
let current = dummy;
while (list1 && list2) {
if (list1.val <= list2.val) {
current.next = list1;
list1 = list1.next;
} else {
current.next = list2;
list2 = list2.next;
}
current = current.next;
}
current.next = list1 ? list1 : list2
return dummy.next;
};
================================================
FILE: JavaScript/0049-group-anagrams.js
================================================
/**
* @param {string[]} strs
* @return {string[][]}
*/
var groupAnagrams = function (strs) {
const ans = new Map();
for (const s of strs) {
const key = s.split("").sort().join("");
if (!ans.has(key)) {
ans.set(key, []);
}
ans.get(key).push(s);
}
return Array.from(ans.values());
};
var strs = ["eat", "tea", "tan", "ate", "nat", "bat"];
console.log(groupAnagrams(strs));
================================================
FILE: JavaScript/0074-search-a-2d-matrix.js
================================================
var searchMatrix = function (matrix, target) {
if (matrix.length === 0) return false;
const rows = matrix.length;
const cols = matrix[0].length;
let left = 0;
let right = rows * cols - 1;
while (left <= right) {
const mid = Math.floor(left + (right - left) / 2);
const value = matrix[Math.floor(mid / cols)][mid % cols];
if (value < target)
left = mid + 1;
else if (value > target)
right = mid - 1;
else
return true;
}
return false;
};
================================================
FILE: JavaScript/0078-subsets.js
================================================
var subsets = function (nums) {
let output = [[]];
for (let num of nums) {
let newSubsets = [];
for (let curr of output) {
let temp = curr.slice();
temp.push(num);
newSubsets.push(temp);
}
for (let curr of newSubsets) {
output.push(curr);
}
}
return output;
};
================================================
FILE: JavaScript/0094-binary-tree-inorder-traversal.js
================================================
/**
* Definition for a binary tree node.
* function TreeNode(val, left, right) {
* this.val = (val===undefined ? 0 : val);
* this.left = (left===undefined ? null : left);
* this.right = (right===undefined ? null : right);
* }
*/
/**
* @param {TreeNode} root
* @return {number[]}
*/
var inorderTraversal = function(root) {
const result = [];
function inorder(node) {
if (node) {
inorder(node.left);
result.push(node.val);
inorder(node.right);
}
}
inorder(root);
return result;
};
================================================
FILE: JavaScript/0100-same-tree.js
================================================
/**
* Definition for a binary tree node.
* function TreeNode(val, left, right) {
* this.val = (val===undefined ? 0 : val)
* this.left = (left===undefined ? null : left)
* this.right = (right===undefined ? null : right)
* }
*/
/**
* @param {TreeNode} p
* @param {TreeNode} q
* @return {boolean}
*/
var isSameTree = function (p, q) {
if (p === null && q === null)
return true;
if (p === null || q === null)
return false;
if (p.val !== q.val)
return false;
return isSameTree(p.left, q.left) && isSameTree(p.right, q.right);
};
// Example usage:
var p = new TreeNode(1);
p.left = new TreeNode(2);
p.right = new TreeNode(2);
var q = new TreeNode(1);
q.left = new TreeNode(2);
q.right = new TreeNode(2);
console.log(isSameTree(p, q));
================================================
FILE: JavaScript/0104-maximum-depth-of-binary-tree.js
================================================
/**
* Definition for a binary tree node.
* function TreeNode(val, left, right) {
* this.val = (val===undefined ? 0 : val)
* this.left = (left===undefined ? null : left)
* this.right = (right===undefined ? null : right)
* }
*/
/**
* @param {TreeNode} root
* @return {number}
*/
var maxDepth = function(root) {
function longestPath(node) {
if (!node) {
return 0;
}
var leftPath = longestPath(node.left);
var rightPath = longestPath(node.right);
return Math.max(leftPath, rightPath) + 1;
}
return longestPath(root);
};
================================================
FILE: JavaScript/0121-best-time-to-buy-and-sell-stock.js
================================================
/**
* @param {number[]} prices
* @return {number}
*/
var maxProfit = function (prices) {
profit = 0;
smallestProfit = 99999;
for (let i = 0; i < prices.length; i++) {
if (prices[i] < smallestProfit) {
smallestProfit = prices[i];
} else {
profit = Math.max(profit, prices[i] - smallestProfit);
}
}
return profit;
};
PriceList = [7, 1, 5, 3, 6, 4];
console.log(maxProfit(PriceList));
================================================
FILE: JavaScript/0141-linked-list-cycle.js
================================================
/**
* Definition for singly-linked list.
* function ListNode(val) {
* this.val = val;
* this.next = null;
* }
*/
/**
* @param {ListNode} head
* @return {boolean}
*/
var hasCycle = function(head) {
if (!head) {
return false;
}
let slow = head;
let fast = head.next;
while (slow !== fast) {
if (fast === null || fast.next === null) {
return false;
}
fast = fast.next.next;
slow = slow.next;
}
return true;
};
================================================
FILE: JavaScript/0144-binary-tree-preorder-traversal.js
================================================
/**
* Definition for a binary tree node.
* function TreeNode(val, left, right) {
* this.val = (val===undefined ? 0 : val)
* this.left = (left===undefined ? null : left)
* this.right = (right===undefined ? null : right)
* }
*/
/**
* @param {TreeNode} root
* @return {number[]}
*/
var preorderTraversal = function(root) {
const result = [];
function preorder(node) {
if (node) {
result.push(node.val);
preorder(node.left);
preorder(node.right);
}
}
preorder(root);
return result;
};
================================================
FILE: JavaScript/0145-binary-tree-postorder-traversal.js
================================================
/**
* Definition for a binary tree node.
* function TreeNode(val, left, right) {
* this.val = (val===undefined ? 0 : val)
* this.left = (left===undefined ? null : left)
* this.right = (right===undefined ? null : right)
* }
*/
/**
* @param {TreeNode} root
* @return {number[]}
*/
var postorderTraversal = function(root) {
const result = [];
function postorder(node) {
if (node) {
postorder(node.left);
postorder(node.right);
result.push(node.val);
}
}
postorder(root);
return result;
};
================================================
FILE: JavaScript/0153-find-minimum-in-rotated-sorted-array.js
================================================
/**
* @param {number[]} nums
* @return {number}
*/
var findMin = function (nums) {
if (nums.length === 1) return nums[0];
let left = 0;
let right = nums.length - 1;
if (nums[right] > nums[0]) return nums[0];
while (left <= right) {
let mid = Math.floor(left + (right - left) / 2);
if (nums[mid] > nums[mid + 1]) return nums[mid + 1];
if (nums[mid] < nums[mid - 1]) return nums[mid];
if (nums[mid] > nums[right]) {
left = mid + 1;
} else {
right = mid - 1;
}
}
return nums[mid];
};
let nums = [11, 13, 15, 17];
console.log(findMin(nums));
================================================
FILE: JavaScript/0206-reverse-linked-list.js
================================================
/**
* Definition for singly-linked list.
* function ListNode(val, next) {
* this.val = (val===undefined ? 0 : val)
* this.next = (next===undefined ? null : next)
* }
*/
/**
* @param {ListNode} head
* @return {ListNode}
*/
var reverseList = function (head) {
let prevNode = null;
let currNode = head;
while (currNode !== null) {
let nextNode = currNode.next;
currNode.next = prevNode;
prevNode = currNode;
currNode = nextNode;
}
return prevNode;
};
================================================
FILE: JavaScript/0217-contains-duplicate.js
================================================
/**
* @param {number[]} nums
* @return {boolean}
*/
var containsDuplicate = function(nums) {
let set = new Set(nums);
return set.size < nums.length;
};
================================================
FILE: JavaScript/0226-invert-binary-tree.js
================================================
// Definition for a binary tree node.
function TreeNode(val, left, right) {
this.val = val === undefined ? 0 : val;
this.left = left === undefined ? null : left;
this.right = right === undefined ? null : right;
}
/**
* Inverts a binary tree.
* @param {TreeNode} root
* @return {TreeNode}
*/
var invertTree = function (root) {
if (!root) {
return null;
}
// Swap the left and right children
var temp = root.left;
root.left = invertTree(root.right);
root.right = invertTree(temp);
return root;
};
/**
* Prints the values of a binary tree in an inorder traversal.
* @param {TreeNode} root
* @return {string[]}
*/
function printBinaryTree(root) {
if (root === null) {
return [];
}
// Inorder traversal: left -> root -> right
var result = [];
result.push(root.val.toString());
result = result.concat(printBinaryTree(root.left));
result = result.concat(printBinaryTree(root.right));
return result;
}
// Example usage:
var root = new TreeNode(4);
root.left = new TreeNode(2, new TreeNode(1), new TreeNode(3));
root.right = new TreeNode(7, new TreeNode(6), new TreeNode(9));
var result = invertTree(root);
var treeValues = printBinaryTree(result);
console.log(treeValues.join(" "));
================================================
FILE: JavaScript/0242-valid-anagram.js
================================================
/**
* @param {string} s
* @param {string} t
* @return {boolean}
*/
var isAnagram = function(s, t) {
// Helper function to create a character counter
const getCharacterCount = (str) => {
const counter = new Map();
for (const char of str) {
counter.set(char, (counter.get(char) || 0) + 1);
}
return counter;
};
// Helper function to check if two counters are equal
const isCounterEqual = (counter1, counter2) => {
if (counter1.size !== counter2.size) {
return false;
}
for (const [key, value] of counter1) {
if (counter2.get(key) !== value) {
return false;
}
}
return true;
};
// Use the Counter approach to check if s and t are anagrams
const counterS = getCharacterCount(s);
const counterT = getCharacterCount(t);
return isCounterEqual(counterS, counterT);
};
// Example usage:
console.log(isAnagram("anagram", "nagaram")); // Output: true
console.log(isAnagram("rat", "car")); // Output: false
================================================
FILE: JavaScript/0506-relative-ranks.js
================================================
/**
* @param {number[]} score
* @return {string[]}
*/
var findRelativeRanks = function (score) {
const N = score.length;
const heap = [];
for (let index = 0; index < N; index++) {
heap.push([score[index], index]);
}
heap.sort((a, b) => b[0] - a[0]);
const rank = new Array(N);
for (let place = 0; place < N; place++) {
const originalIndex = heap[place][1];
if (place === 0) {
rank[originalIndex] = "Gold Medal";
} else if (place === 1) {
rank[originalIndex] = "Silver Medal";
} else if (place === 2) {
rank[originalIndex] = "Bronze Medal";
} else {
rank[originalIndex] = (place + 1).toString();
}
}
return rank;
};
================================================
FILE: JavaScript/0572-subtree-of-another-tree.js
================================================
/**
* Definition for a binary tree node.
* function TreeNode(val, left, right) {
* this.val = (val === undefined ? 0 : val)
* this.left = (left === undefined ? null : left)
* this.right = (right === undefined ? null : right)
* }
*/
/**
* @param {TreeNode} root
* @param {TreeNode} subRoot
* @return {boolean}
*/
var isSubtree = function (root, subRoot) {
function isSameTree(root1, root2) {
if (!root1 && !root2) {
return true;
}
if (!root1 || !root2) {
return false;
}
if (root1.val !== root2.val) {
return false;
}
return isSameTree(root1.left, root2.left) && isSameTree(root1.right, root2.right);
}
function dfs(node) {
if (!node) {
return false;
} else if (isSameTree(node, subRoot)) {
return true;
}
return dfs(node.left) || dfs(node.right);
}
return dfs(root);
};
// Example usage:
var root = new TreeNode(3);
root.left = new TreeNode(4);
root.left.left = new TreeNode(1);
root.left.right = new TreeNode(2);
root.right = new TreeNode(5);
var subRoot = new TreeNode(4);
subRoot.left = new TreeNode(1);
subRoot.right = new TreeNode(2);
console.log(isSubtree(root, subRoot));
================================================
FILE: JavaScript/0704-binary-search.js
================================================
/**
* @param {number[]} nums
* @param {number} target
* @return {number}
*/
var search = function(nums, target) {
let left = 0, right = nums.length - 1;
while (left <= right) {
let mid = left + Math.floor((right - left) / 2);
if (nums[mid] > target) {
right = mid - 1;
} else if (nums[mid] < target) {
left = mid + 1;
} else {
return mid;
}
}
return -1;
};
let numbers = [5];
let target = 5;
console.log(search(numbers, target));
================================================
FILE: JavaScript/0994-rotting-oranges.js
================================================
/**
* @param {number[][]} grid
* @return {number}
*/
var orangesRotting = function(grid) {
let queue = [];
let rows = grid.length;
let cols = grid[0].length;
let freshOranges = 0;
// Populate queue with initial rotten oranges and count fresh oranges
for (let r = 0; r < rows; r++) {
for (let c = 0; c < cols; c++) {
if (grid[r][c] === 2) {
queue.push([r, c]); // Add rotten orange to the queue
} else if (grid[r][c] === 1) {
freshOranges += 1; // Count fresh oranges
}
}
}
queue.push([-1, -1]); // Marker to indicate minute elapsed
let minutesElapsed = -1;
const directions = [[1, 0], [-1, 0], [0, -1], [0, 1]]; // Direction vectors for adjacent cells
// BFS traversal using the queue
while (queue.length > 0) {
let [row, col] = queue.shift();
if (row === -1) {
// Increment time when marker is encountered
minutesElapsed += 1;
if (queue.length > 0) {
queue.push([-1, -1]); // Add marker back if there are still oranges to process
}
} else {
// Process adjacent cells
for (let d of directions) {
let nextRow = row + d[0];
let nextCol = col + d[1];
// Check bounds and if adjacent cell contains a fresh orange
if (nextRow >= 0 && nextRow < rows && nextCol >= 0 && nextCol < cols && grid[nextRow][nextCol] === 1) {
grid[nextRow][nextCol] = 2; // Mark orange as rotten
freshOranges -= 1; // Decrease fresh orange count
queue.push([nextRow, nextCol]); // Add newly rotten orange to the queue
}
}
}
}
// If there are still fresh oranges, return -1, otherwise return the time elapsed
return freshOranges === 0 ? minutesElapsed : -1;
};
// Example usage
let grid = [[2,1,1],[1,1,0],[0,1,1]];
console.log(orangesRotting(grid)); // Output: 4
================================================
FILE: JavaScript/2619-array-prototype-last.js
================================================
Array.prototype.last = function () {
return this.length ? this[this.length - 1] : -1;
};
/**
* const arr = [1, 2, 3];
* arr.last(); // 3
*/
================================================
FILE: JavaScript/2620-counter.js
================================================
var createCounter = function(n) {
return function() {
return n++
};
};
================================================
FILE: JavaScript/2621-sleep.js
================================================
/**
* @param {number} millis
*/
async function sleep(millis) {
return new Promise((resolve, reject) => {
setTimeout(() => {
try {
return resolve(millis);
} catch (err) {
reject(err);
}
}, millis);
});
}
/**
* let t = Date.now()
* sleep(100).then(() => console.log(Date.now() - t)) // 100
*/
================================================
FILE: JavaScript/2622-cache-with-time-limit.js
================================================
var TimeLimitedCache = function() {
this.cache = new Map();
};
/**
* @param {number} key
* @param {number} value
* @param {number} duration time until expiration in ms
* @return {boolean} if un-expired key already existed
*/
TimeLimitedCache.prototype.set = function(key, value, duration) {
const valueInCache = this.cache.get(key);
if (valueInCache) {
clearTimeout(valueInCache.timeout);
}
const timeout = setTimeout(() => this.cache.delete(key), duration);
this.cache.set(key, { value, timeout });
return Boolean(valueInCache);
};
/**
* @param {number} key
* @return {number} value associated with key
*/
TimeLimitedCache.prototype.get = function(key) {
return this.cache.has(key) ? this.cache.get(key).value : -1;
};
/**
* @return {number} count of non-expired keys
*/
TimeLimitedCache.prototype.count = function() {
return this.cache.size;
};
/**
* Your TimeLimitedCache object will be instantiated and called as such:
* var obj = new TimeLimitedCache()
* obj.set(1, 42, 1000); // false
* obj.get(1) // 42
* obj.count() // 1
*/
================================================
FILE: JavaScript/2623-memoize.js
================================================
/**
* @param {Function} fn
*/
function memoize(fn) {
const cache = {};
return function(...args) {
const key = JSON.stringify(args);
if (key in cache) {
return cache[key];
}
const functionOutput = fn(...args);
cache[key] = functionOutput;
return functionOutput;
}
}
/**
* let callCount = 0;
* const memoizedFn = memoize(function (a, b) {
* callCount += 1;
* return a + b;
* })
* memoizedFn(2, 3) // 5
* memoizedFn(2, 3) // 5
* console.log(callCount) // 1
*/
================================================
FILE: JavaScript/2625-flatten-deeply-nested-array.js
================================================
/**
* @param {any[]} arr
* @param {number} depth
* @return {any[]}
*/
var flat = function (arr, n) {
const result = [];
const flattening = (arr, n) => {
for (item of arr) {
if (Array.isArray(item) && n > 0) {
flattening(item, n - 1);
} else {
result.push(item);
}
}
};
flattening(arr,n)
return result;
};
================================================
FILE: JavaScript/2626-array-reduce-transformation.js
================================================
/**
* @param {number[]} nums
* @param {Function} fn
* @param {number} init
* @return {number}
*/
var reduce = function (nums, fn, init) {
nums.forEach((num, i) => {
init = fn(init, num);
});
return init;
};
================================================
FILE: JavaScript/2627-debounce.js
================================================
/**
* @param {Function} fn
* @param {number} t milliseconds
* @return {Function}
*/
var debounce = function (fn, t) {
let timeout;
return function (...args) {
clearTimeout(timeout);
timeout = setTimeout(() => {
fn(...args);
}, t);
};
};
/**
* const log = debounce(console.log, 100);
* log('Hello'); // cancelled
* log('Hello'); // cancelled
* log('Hello'); // Logged at t=100ms
*/
================================================
FILE: JavaScript/2628-json-deep-equal.js
================================================
/**
* @param {any} o1
* @param {any} o2
* @return {boolean}
*/
const helper = (key,value) => {
return (value && !Array.isArray(value) && typeof value === "object")
? Object.fromEntries(Object.entries(value).sort())
: value;
};
let areDeeplyEqual = function (o1, o2) {
console.log(JSON.stringify(o1, helper))
console.log(JSON.stringify(o2, helper))
return JSON.stringify(o1, helper) === JSON.stringify(o2, helper);
};
================================================
FILE: JavaScript/2629-function-composition.js
================================================
/**
* @param {Function[]} functions
* @return {Function}
*/
var compose = function (functions) {
return function (x) {
functions.reverse();
functions.forEach((fun)=>{
x = fun(x)
})
return x
};
};
================================================
FILE: JavaScript/2631-group-by.js
================================================
/**
* @param {Function} fn
* @return {Array}
*/
Array.prototype.groupBy = function (fn) {
let result = {}
for(item of this){
const key = fn(item)
if(key in result){
result[key].push(item)
}else{
result[key] = [item]
}
}
return result
};
/**
* [1,2,3].groupBy(String) // {"1":[1],"2":[2],"3":[3]}
*/
================================================
FILE: JavaScript/2632-curry.js
================================================
/**
* @param {Function} fn
* @return {Function}
*/
var curry = function (fn) {
return function curried(...args) {
if (args.length >= fn.length) {
return fn(...args);
}
return (...nextArgs) => {
return curried(...args, ...nextArgs);
};
};
};
/**
* function sum(a, b) { return a + b; }
* const csum = curry(sum);
* csum(1)(2) // 3
*/
================================================
FILE: JavaScript/2633-convert-object-to-json-string.js
================================================
/**
* @param {any} object
* @return {string}
*/
var jsonStringify = function (object) {
switch (typeof object) {
case "object":
if (Array.isArray(object)) {
const elements = object.map((element) => jsonStringify(element));
return `[${elements.join(",")}]`;
} else if (object) {
const keys = Object.keys(object);
const keyValuePairs = keys.map((key) => {
return `"${key}":${jsonStringify(object[key])}`;
});
return `{${keyValuePairs.join(",")}}`;
} else {
return "null";
}
case "boolean":
case "number":
return `${object}`;
case "string":
return `"${object}"`;
default:
return "";
}
};
================================================
FILE: JavaScript/2634-filter-elements-from-array.js
================================================
/**
* @param {number[]} arr
* @param {Function} fn
* @return {number[]}
*/
var filter = function (arr, fn) {
result = [];
arr.forEach((num, i) => {
if (fn(num, i)) {
result.push(num);
}
});
return result;
};
================================================
FILE: JavaScript/2635-apply-transform-over-each-element-in-array.js
================================================
/**
* @param {number[]} arr
* @param {Function} fn
* @return {number[]}
*/
var map = function (arr, fn) {
arr = arr.map((num, i) => {
return fn(num, i);
});
return arr;
};
================================================
FILE: JavaScript/2636-promise-pool.js
================================================
/**
* @param {Function[]} functions
* @param {number} n
* @return {Promise<any>}
*/
var promisePool = async function (functions, n) {
return new Promise((resolve, reject) => {
let inProgressCount = 0;
let functionIndex = 0;
function helper() {
if (functionIndex >= functions.length) {
if (inProgressCount === 0) resolve();
return;
}
while (inProgressCount < n && functionIndex < functions.length) {
inProgressCount++;
const promise = functions[functionIndex]();
functionIndex++;
promise.then(() => {
inProgressCount--;
helper();
});
}
}
helper();
});
};
/**
* const sleep = (t) => new Promise(res => setTimeout(res, t));
* promisePool([() => sleep(500), () => sleep(400)], 1)
* .then(console.log) // After 900ms
*/
================================================
FILE: JavaScript/2637-promise-time-limit.js
================================================
/**
* @param {Function} fn
* @param {number} t
* @return {Function}
*/
var timeLimit = function (fn, t) {
return async function (...args) {
return new Promise((resolve, reject) => {
setTimeout(() => {
reject("Time Limit Exceeded");
}, t);
fn(...args)
.then(resolve)
.catch(reject);
});
};
};
/**
* const limited = timeLimit((t) => new Promise(res => setTimeout(res, t)), 100);
* limited(150).catch(console.log) // "Time Limit Exceeded" at t=100ms
*/
================================================
FILE: JavaScript/2665-counter-ii.js
================================================
var createCounter = function (init) {
const original_number = init;
return {
increment: () => {
return ++init;
},
decrement: () => {
return --init;
},
reset: () => {
init = original_number;
return init;
},
};
};
================================================
FILE: JavaScript/2666-allow-one-function-call.js
================================================
/**
* @param {Function} fn
* @return {Function}
*/
var once = function (fn) {
let first = false;
return function (...args) {
if (!first) {
first = true;
return fn(...args);
}
return undefined;
};
};
/**
* let fn = (a,b,c) => (a + b + c)
* let onceFn = once(fn)
*
* onceFn(1,2,3); // 6
* onceFn(2,3,6); // returns undefined without calling fn
*/
================================================
FILE: JavaScript/2667-create-hello-world-function.js
================================================
var createHelloWorld = function () {
return function (...args) {
return "Hello World"
};
};
================================================
FILE: JavaScript/2676-throttle.js
================================================
/**
* @param {Function} fn
* @param {number} t
* @return {Function}
*/
var throttle = function (fn, t) {
let timeOut;
let nextTimeToCall = 0;
return function (...args) {
let delay = Math.max(0, nextTimeToCall - Date.now());
clearTimeout(timeOut);
timeOut = setTimeout(() => {
fn(...args);
nextTimeToCall = Date.now() + t;
}, delay);
};
};
/**
* const throttled = throttle(console.log, 100);
* throttled("log"); // logged immediately.
* throttled("log"); // logged at t=100ms.
*/
================================================
FILE: JavaScript/2677-chunk-array.js
================================================
/**
* @param {Array} arr
* @param {number} size
* @return {Array[]}
*/
var chunk = function (arr, size) {
return arr.reduce((resultArray, item, index) => {
const chunkIndex = Math.floor(index / size);
if (!resultArray[chunkIndex]) {
resultArray[chunkIndex] = [];
}
resultArray[chunkIndex].push(item);
return resultArray;
}, []);
};
================================================
FILE: JavaScript/2694-event-emitter.js
================================================
class EventEmitter {
constructor() {
this.events = {};
}
subscribe(event, cb) {
this.events[event] = this.events[event] ?? [];
this.events[event].push(cb);
return {
unsubscribe: () => {
this.events[event] = this.events[event].filter((f) => f !== cb);
//To avoid memory leaks adding a cleanup condition
if (this.events[event].length === 0) {
delete this.events[event];
}
},
};
}
emit(event, args = []) {
if (!(event in this.events)) return [];
return this.events[event].map((f) => f(...args));
}
}
/**
* const emitter = new EventEmitter();
*
* // Subscribe to the onClick event with onClickCallback
* function onClickCallback() { return 99 }
* const sub = emitter.subscribe('onClick', onClickCallback);
*
* emitter.emit('onClick'); // [99]
* sub.unsubscribe(); // undefined
* emitter.emit('onClick'); // []
*/
================================================
FILE: JavaScript/2695-array-wrapper.js
================================================
/**
* @param {number[]} nums
*/
var ArrayWrapper = function (nums) {
this.nums = nums;
};
ArrayWrapper.prototype.valueOf = function () {
return this.nums.reduce((accumulator, a) => accumulator + a, 0);
};
ArrayWrapper.prototype.toString = function () {
return JSON.stringify(this.nums);
};
/**
* const obj1 = new ArrayWrapper([1,2]);
* const obj2 = new ArrayWrapper([3,4]);
* obj1 + obj2; // 10
* String(obj1); // "[1,2]"
* String(obj2); // "[3,4]"
*/
================================================
FILE: JavaScript/2703-return-length-of-arguments-passed.js
================================================
/**
* @return {number}
*/
var argumentsLength = function (...args) {
return args.length;
};
/**
* argumentsLength(1, 2, 3); // 3
*/
================================================
FILE: JavaScript/2704-to-be-or-not-to-be.js
================================================
var expect = function (val) {
return {
toBe: function (expected) {
if (expected !== val) throw new Error("Not Equal");
return true;
},
notToBe: function (expected) {
if (expected === val) throw new Error("Equal");
return true;
},
};
};
================================================
FILE: JavaScript/2705-compact-object.js
================================================
var compactObject = function (obj) {
function dfs(obj) {
if (!obj) return;
if (typeof obj !== "object") {
return obj;
}
if (Array.isArray(obj)) {
const newArray = [];
for (let i = 0; i < obj.length; i++) {
const subRes = dfs(obj[i]);
if (subRes) newArray.push(subRes);
}
return newArray;
}
const newObj = {};
for (const key in obj) {
const subRes = dfs(obj[key]);
if (subRes) {
newObj[key] = subRes;
}
}
return newObj
}
return dfs(obj);
};
================================================
FILE: JavaScript/2715-execute-cancellable-function-with-delay.js
================================================
/**
* @param {Function} fn
* @param {Array} args
* @param {number} t
* @return {Function}
*/
var cancellable = function (fn, args, t) {
const timer = setTimeout(() => {
fn(...args);
}, t);
const cancelFn = () => clearTimeout(timer);
return cancelFn;
};
/**
* const result = []
*
* const fn = (x) => x * 5
* const args = [2], t = 20, cancelT = 50
*
* const start = performance.now()
*
* const log = (...argsArr) => {
* const diff = Math.floor(performance.now() - start);
* result.push({"time": diff, "returned": fn(...argsArr))
* }
*
* const cancel = cancellable(log, args, t);
*
* const maxT = Math.max(t, cancelT)
*
* setTimeout(() => {
* cancel()
* }, cancelT)
*
* setTimeout(() => {
* console.log(result) // [{"time":20,"returned":10}]
* }, maxT + 15)
*/
================================================
FILE: JavaScript/2721-execute-asynchronous-functions-in-parallel.js
================================================
/**
* @param {Array<Function>} functions
* @return {Promise<any>}
*/
var promiseAll = async function (functions) {
return new Promise((resolve, reject) => {
if (functions.length == 0) {
resolve([]);
return;
}
const res = Array(functions.length).fill(null);
let resolvedCount = 0;
functions.forEach(async (item, idx) => {
try {
const subRes = await item();
res[idx] = subRes;
resolvedCount++;
if (resolvedCount === functions.length) return resolve(res);
} catch (err) {
reject(err);
}
});
});
};
/**
* const promise = promiseAll([() => new Promise(res => res(42))])
* promise.then(console.log); // [42]
*/
================================================
FILE: JavaScript/2722-join-two-arrays-by-id.js
================================================
/**
* @param {Array} arr1
* @param {Array} arr2
* @return {Array}
*/
var join = function (arr1, arr2) {
const merge = {};
for (item of arr1.concat(arr2)) {
merge[item.id] = merge[item.id]
? { ...merge[item.id], ...item }
: { ...item };
}
return Object.values(merge);
};
================================================
FILE: JavaScript/2723-add-two-promises.js
================================================
/**
* @param {Promise} promise1
* @param {Promise} promise2
* @return {Promise}
*/
var addTwoPromises = async function (promise1, promise2) {
return await promise1 + await promise2
};
/**
* addTwoPromises(Promise.resolve(2), Promise.resolve(2))
* .then(console.log); // 4
*/
================================================
FILE: JavaScript/2724-sort-by.js
================================================
/**
* @param {Array} arr
* @param {Function} fn
* @return {Array}
*/
var sortBy = function (arr, fn) {
return arr.sort((itemA, itemB) => {
return fn(itemA) - fn(itemB);
});
};
================================================
FILE: JavaScript/2725-interval-cancellation.js
================================================
/**
* @param {Function} fn
* @param {Array} args
* @param {number} t
* @return {Function}
*/
var cancellable = function (fn, args, t) {
fn(...args);
const timer = setInterval(() => {
fn(...args);
}, t);
const cancelFn = () => clearInterval(timer);
return cancelFn;
};
/**
* const result = []
*
* const fn = (x) => x * 2
* const args = [4], t = 20, cancelT = 110
*
* const start = performance.now()
*
* const log = (...argsArr) => {
* const diff = Math.floor(performance.now() - start)
* result.push({"time": diff, "returned": fn(...argsArr)})
* }
*
* const cancel = cancellable(log, args, t);
*
* setTimeout(() => {
* cancel()
* }, cancelT)
*
* setTimeout(() => {
* console.log(result) // [
* // {"time":0,"returned":8},
* // {"time":20,"returned":8},
* // {"time":40,"returned":8},
* // {"time":60,"returned":8},
* // {"time":80,"returned":8},
* // {"time":100,"returned":8}
* // ]
* }, cancelT + t + 15)
*/
================================================
FILE: JavaScript/2726-calculator-with-method-chaining.js
================================================
class Calculator {
constructor(value) {
this.result = value;
}
add(value) {
this.result += value;
return this;
}
subtract(value) {
this.result -= value;
return this;
}
multiply(value) {
this.result *= value;
return this;
}
divide(value) {
if (value === 0) throw "Division by zero is not allowed";
this.result /= value;
return this;
}
power(value) {
this.result **= value;
return this;
}
getResult() {
return this.result;
}
}
================================================
FILE: JavaScript/2727-is-object-empty.js
================================================
/**
* @param {Object | Array} obj
* @return {boolean}
*/
var isEmpty = function (obj) {
for ( _ in obj) return false;
return true;
};
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2024 Hogan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: Python/0001-two-sum.py
================================================
from typing import List
# brute force
# time complexity: O(n^2)
# space complexity: O(1)
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
for i in range(len(nums)):
for j in range(i + 1, len(nums)):
if nums[j] == target - nums[i]:
return [i, j]
# hashMap
# time complexity: O(n)
# space complexity: O(1)
class Solution(object):
def twoSum(self, nums: List[int], target: int) -> List[int]:
numMap = {}
for i, num in enumerate(nums):
complement = target - num
if complement in numMap:
return [numMap[complement], i]
numMap[num] = i
return []
# two pointer
# time complexity: O(n)
# space complexity: O(1)
class Solution(object):
def twoSum(self, nums: List[int], target: int) -> List[List[int]]:
res = []
left, right = 0, len(nums) - 1
while (left < right):
currSum = nums[left] + nums[right]
if currSum < target or (left > 0 and nums[left] == nums[left - 1]):
left += 1
elif currSum > target or (right < len(nums)-1 and nums[right] == nums[right + 1]):
right -= 1
else:
res.append([nums[left], nums[right]])
left += 1
right -= 1
return res
nums = [2, 7, 11, 15]
target = 9
solution = Solution()
result = solution.twoSum(nums, target)
print(result)
================================================
FILE: Python/0002-add-two-numbers.py
================================================
# time complexity: O(n)
# space complexity: O(n)
from typing import Optional
class Solution:
def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]:
curr = dummy = ListNode()
carry = 0
while l1 or l2 or carry:
val1 = l1.val if l1 else 0
val2 = l2.val if l2 else 0
currNum = val1 + val2 + carry
carry, currNum = divmod(currNum, 10)
curr.next = ListNode(currNum)
curr = curr.next
l1 = l1.next if l1 else None
l2 = l2.next if l2 else None
return dummy.next
l1 = ListNode(0)
l2 = ListNode(0)
print(Solution().addTwoNumbers(l1, l2))
================================================
FILE: Python/0003-longest-substring-without-repeating-characters.py
================================================
# time complexity: O(n)
# space complexity: O(min(m,n))
from collections import Counter
class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
chars = Counter()
left = right = 0
res = 0
while right < len(s):
r = s[right]
chars[r] += 1
while chars[r] > 1:
l = s[left]
chars[l] -= 1
left += 1
res = max(res, right - left + 1)
right += 1
return res
Input = "abcabcbb"
print(Solution().lengthOfLongestSubstring(Input))
================================================
FILE: Python/0004-median-of-two-sorted-arrays.py
================================================
# time complexity: O(log(min(m, n)))
# space complexity: O(1)
from typing import List
class Solution:
def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float:
n1, n2 = len(nums1), len(nums2)
n = n1 + n2
def binaryCut(targetIdx, aStart, aEnd, bStart, bEnd):
if aStart > aEnd:
return nums2[targetIdx - aStart]
if bStart > bEnd:
return nums1[targetIdx - bStart]
aMid, bMid = (aStart + aEnd) // 2, (bStart + bEnd) // 2
aVal, bVal = nums1[aMid], nums2[bMid]
if aMid + bMid < targetIdx:
if aVal > bVal:
return binaryCut(targetIdx, aStart, aEnd, bMid + 1, bEnd)
else:
return binaryCut(targetIdx, aMid + 1, aEnd, bStart, bEnd)
else:
if aVal > bVal:
return binaryCut(targetIdx, aStart, aMid - 1, bStart, bEnd)
else:
return binaryCut(targetIdx, aStart, aEnd, bStart, bMid - 1)
if n % 2:
return binaryCut(n // 2, 0, n1 - 1, 0, n2 - 1)
else:
return (binaryCut(n // 2 - 1, 0, n1 - 1, 0, n2 - 1) + binaryCut(n // 2, 0, n1 - 1, 0, n2 - 1)) / 2
# time complexity: O(n)
# space complexity: O(1)
class Solution:
def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float:
n1, n2 = len(nums1), len(nums2)
idx1, idx2 = 0, 0
def getMin():
nonlocal idx1, idx2
if idx1 < n1 and idx2 < n2:
if nums1[idx1] < nums2[idx2]:
ans = nums1[idx1]
idx1 += 1
else:
ans = nums2[idx2]
idx2 += 1
elif idx2 == n2:
ans = nums1[idx1]
idx1 += 1
else:
ans = nums2[idx2]
idx2 += 1
return ans
total = n1 + n2
mid = total // 2
if total % 2 == 0:
for _ in range(mid - 1):
getMin()
first = getMin()
second = getMin()
return (first + second) / 2
else:
for _ in range(mid):
getMin()
return getMin()
nums1 = [1, 3]
nums2 = [2]
print(Solution().findMedianSortedArrays(nums1, nums2))
nums1 = [1, 3]
nums2 = [2, 4]
print(Solution().findMedianSortedArrays(nums1, nums2))
================================================
FILE: Python/0005-longest-palindromic-substring.py
================================================
# time complexity: O(n)
# space complexity: O(n)
# Manacher's Algorithm
class Solution:
def longestPalindrome(self, s: str) -> str:
sPrime = "#" + "#".join(s) + "#"
n = len(sPrime)
palindromeRadii = [0] * n
center = radius = 0
for i in range(n):
mirror = 2 * center - i
if i < radius:
palindromeRadii[i] = min(radius - i, palindromeRadii[mirror])
while (
i + 1 + palindromeRadii[i] < n
and i - 1 - palindromeRadii[i] >= 0
and sPrime[i + 1 + palindromeRadii[i]]
== sPrime[i - 1 - palindromeRadii[i]]
):
palindromeRadii[i] += 1
if i + palindromeRadii[i] > radius:
center = i
radius = i + palindromeRadii[i]
maxLength = max(palindromeRadii)
centerIndex = palindromeRadii.index(maxLength)
startIndex = (centerIndex - maxLength) // 2
longestPalindrome = s[startIndex: startIndex + maxLength]
return longestPalindrome
# Brute Force
# time complexity: O(n^3)
# space complexity: O(n^3)
class Solution:
def longestPalindrome(self, s: str) -> str:
def check(i, j):
left = i
right = j - 1
while left < right:
if s[left] != s[right]:
return False
left += 1
right -= 1
return True
for length in range(len(s), 0, -1):
for start in range(len(s) - length + 1):
if check(start, start + length):
return s[start: start + length]
return ""
# time complexity: O(n^2)
# space complexity: O(n^2)
# Dynamic Programming
class Solution:
def longestPalindrome(self, s: str) -> str:
n = len(s)
dp = [[False for _ in range(n)] for _ in range(n)]
if n < 1:
return s
maxLen = 1
maxStr = s[0]
for right in range(n):
dp[right][right] = True
for left in range(right):
if s[left] == s[right] and (right - left <= 2 or dp[left + 1][right - 1]):
dp[left][right] = True
if right - left + 1 > maxLen:
maxLen = right - left + 1
maxStr = s[left:right + 1]
return maxStr
s = "babad"
print(Solution().longestPalindrome(s))
s = "cbbd"
print(Solution().longestPalindrome(s))
================================================
FILE: Python/0006-zigzag-conversion.py
================================================
# time complexity: O(n)
# space complexity: O(1)
class Solution:
def convert(self, s: str, numRows: int) -> str:
if numRows == 1:
return s
rows = ["" for _ in range(numRows)]
backward = True
i = 0
for c in s:
rows[i] += c
if i == 0 or i == numRows - 1:
backward = not backward
if backward:
i -= 1
else:
i += 1
return "".join(rows)
s = "PAYPALISHIRING"
numRows = 3
print(Solution().convert(s, numRows))
s = "PAYPALISHIRING"
numRows = 4
print(Solution().convert(s, numRows))
s = "A"
numRows = 1
print(Solution().convert(s, numRows))
================================================
FILE: Python/0007-reverse-integer.py
================================================
# time complexity: O(1)
# space complexity: O(1)
class Solution:
def reverse(self, x: int) -> int:
strX = str(x)
ans = 0
if x >= 2**31 or x <= -2 ** 31:
return 0
if x > 0:
ans = strX[::-1]
if x < 0:
temp = strX[1:]
temp2 = temp[::-1]
ans = "-" + temp2
if int(ans) >= 2**31 - 1 or int(ans) <= -2 ** 31:
return 0
return int(ans)
x = -1230
print(Solution().reverse(x))
================================================
FILE: Python/0008-string-to-integer-atoi.py
================================================
class Solution:
def myAtoi(self, s: str) -> int:
x = ""
y = ""
start = 0
nums = "0123456789"
for i in range(len(s)):
if s[i] != " ":
start = i
break
for i in range(start, len(s)):
if s[i] in "-+":
if x == "" and y == "":
x = s[i]
else:
break
elif s[i] in nums:
y += s[i]
else:
break
if y == "":
return 0
if x == "-":
if int(y) > 2**31:
return -2**31
else:
return -int(y)
else:
if int(y) > 2**31-1:
return 2**31-1
else:
return int(y)
================================================
FILE: Python/0010-regular-expression-matching.py
================================================
# time complexity: O((t + p) * 2 ^ (t + p/2))
# space complexity: O(t^2 + p ^ 2)
from functools import lru_cache
class Solution(object):
def isMatch(self, text: str, pattern: str) -> bool:
if not pattern:
return not text
firstMatch = bool(text) and pattern[0] in {text[0], '.'}
if len(pattern) >= 2 and pattern[1] == '*':
return self.isMatch(text, pattern[2:]) or firstMatch and self.isMatch(text[1:], pattern)
else:
return firstMatch and self.isMatch(text[1:], pattern[1:])
# time complexity: O(tp)
# space complexity: O(tp)
class Solution(object):
def isMatch(self, text: str, pattern: str) -> bool:
@lru_cache(None)
def dp(tIdx: int, pIdx: int) -> bool:
if pIdx == len(pattern):
result = tIdx == len(text)
else:
firstMatch = tIdx < len(text) and pattern[pIdx] in {
text[tIdx], "."}
if pIdx + 1 < len(pattern) and pattern[pIdx + 1] == "*":
result = dp(
tIdx, pIdx + 2) or firstMatch and dp(tIdx + 1, pIdx)
else:
result = firstMatch and dp(tIdx + 1, pIdx + 1)
return result
return dp(0, 0)
# time complexity: O(tp)
# space complexity: O(tp)
class Solution(object):
def isMatch(self, text: str, pattern: str) -> bool:
dp = [[False for _ in range(len(pattern) + 1)]
for _ in range(len(text) + 1)]
dp[-1][-1] = True
for tIdx in range(len(text), -1, -1):
for jIdx in range(len(pattern) - 1, -1, -1):
firstMatch = tIdx < len(text) and pattern[jIdx] in {text[tIdx], "."}
if jIdx + 1 < len(pattern) and pattern[jIdx + 1] == "*":
dp[tIdx][jIdx] = dp[tIdx][jIdx + 2] or firstMatch and dp[tIdx + 1][jIdx]
else:
dp[tIdx][jIdx] = firstMatch and dp[tIdx + 1][jIdx + 1]
return dp[0][0]
s = "aa"
p = "a"
print(Solution().isMatch(s, p))
s = "aa"
p = "a*"
print(Solution().isMatch(s, p))
s = "ab"
p = ".*"
print(Solution().isMatch(s, p))
================================================
FILE: Python/0011-container-with-most-water.py
================================================
# time complexity: O(n)
# space complexity: O(1)
from typing import List
class Solution:
def maxArea(self, height: List[int]) -> int:
maxSum = 0
left, right = 0, len(height) - 1
while left < right:
maxSum = max(maxSum, (right - left) *
min(height[left], height[right]))
if height[left] < height[right]:
left += 1
else:
right -= 1
return maxSum
Height = [1, 8, 6, 2, 5, 4, 8, 3, 7]
print(Solution().maxArea(Height))
================================================
FILE: Python/0012-integer-to-roman.py
================================================
# time complexity: O(1)
# space complexity: O(1)
class Solution:
def intToRoman(self, num: int) -> str:
thousands = ["", "M", "MM", "MMM"]
hundreds = ["", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"]
tens = ["", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"]
ones = ["", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"]
return (thousands[num // 1000] + hundreds[num % 1000 // 100]
+ tens[num % 100 // 10] + ones[num % 10])
num = 3
print(Solution().intToRoman(num))
================================================
FILE: Python/0013-roman-to-integer.py
================================================
# time complexity: O(1)
# space complexity: O(1)
class Solution:
def romanToInt(self, s: str) -> int:
total = 0
i = 0
values = {
"I": 1,
"V": 5,
"X": 10,
"L": 50,
"C": 100,
"D": 500,
"M": 1000,
}
while i < len(s):
if i + 1 < len(s) and values[s[i]] < values[s[i + 1]]:
total += values[s[i + 1]] - values[s[i]]
i += 2
else:
total += values[s[i]]
i += 1
return total
s = "III"
print(Solution().romanToInt(s))
s = "LVIII"
print(Solution().romanToInt(s))
s = "MCMXCIV"
print(Solution().romanToInt(s))
================================================
FILE: Python/0014-longest-common-prefix.py
================================================
# time complexity: O(s+m)
# space complexity: O(s)
from typing import List
class TrieNode:
def __init__(self, char=""):
self.children = {}
self.char = char
self.isEnd = False
class Trie:
def __init__(self):
self.root = TrieNode()
def insert(self, word):
node = self.root
for c in word:
if c not in node.children:
node.children[c] = TrieNode()
node = node.children[c]
node.isEnd = True
class Solution:
def longestCommonPrefix(self, strs: List[str]) -> str:
trie = Trie()
for word in strs:
trie.insert(word)
prefix = ""
node = trie.root
while node and not node.isEnd and len(node.children) == 1:
char, childNode = list(node.children.items())[0]
prefix += char
node = childNode
return prefix
strs = ["flower", "flow", "flight"]
print(Solution().longestCommonPrefix(strs))
strs = ["dog", "racecar", "car"]
print(Solution().longestCommonPrefix(strs))
================================================
FILE: Python/0015-3sum.py
================================================
# time complexity: O(n^2)
# space complexity: O(n)
from typing import List
class Solution:
def twoSumII(self, i: int, nums: List[int], result: List[List[int]]):
left, right = i+1, len(nums)-1
while left < right:
sum = nums[i] + nums[left] + nums[right]
if sum < 0:
left += 1
elif sum > 0:
right -= 1
else:
result.append([nums[i], nums[left], nums[right]])
left += 1
right -= 1
while left < right and nums[left] == nums[left - 1]:
left += 1
def twoSumI(self, nums: List[int], left: int, result: List[List[int]]):
numSet = set()
right = left + 1
while right < len(nums):
complement = -nums[left] - nums[right]
if complement in numSet:
result.append([nums[left], nums[right], complement])
while right + 1 < len(nums) and nums[right] == nums[right + 1]:
right += 1
numSet.add(nums[right])
right += 1
def threeSum(self, nums: List[int]) -> List[List[int]]:
nums.sort()
result = []
for i, item in enumerate(nums):
if item > 0:
break
if item != nums[i-1] or i == 0:
self.twoSumII(i, nums, result)
return result
# time complexity: O(n^2)
# space complexity: O(n)
class Solution:
def threeSum(self, nums: List[int]) -> List[List[int]]:
result, dups = set(), set()
numMap = {}
for i, num1 in enumerate(nums):
if num1 not in dups:
dups.add(num1)
for j, num2 in enumerate(nums[i + 1 :]):
complement = -num1 - num2
if complement in numMap and numMap[complement] == i:
result.add(tuple(sorted((num1, num2, complement))))
numMap[num2] = i
return [list(x) for x in result]
nums = [-1, 0, 1, 2, -1, -4]
print(Solution().threeSum(nums))
nums = [0, 1, 1]
print(Solution().threeSum(nums))
nums = [0, 0, 0]
print(Solution().threeSum(nums))
================================================
FILE: Python/0016-3sum-closest.py
================================================
# time complexity: O(n^2)
# space complexity: O(nlogn)
from typing import List
class Solution:
def threeSumClosest(self, nums: List[int], target: int) -> int:
diff = float('inf')
nums.sort()
for i in range(len(nums)):
left = i + 1
right = len(nums) - 1
while left < right:
sum = nums[i] + nums[left] + nums[right]
if abs(target - sum) < abs(diff):
diff = target - sum
if sum < target:
left += 1
else:
right -= 1
if diff == 0:
break
return target - diff
nums = [-1, 2, 1, -4]
target = 1
print(Solution().threeSumClosest(nums, target))
================================================
FILE: Python/0017-letter-combinations-of-a-phone-number.py
================================================
# time complexity: O(k^n*n)
# space complexity: O(n)
from typing import List
class Solution:
def letterCombinations(self, digits: str) -> List[str]:
if len(digits) == 0:
return []
numberMap = {}
numberMap["2"] = set("abc")
numberMap["3"] = set("def")
numberMap["4"] = set("ghi")
numberMap["5"] = set("jkl")
numberMap["6"] = set("mon")
numberMap["7"] = set("pqrs")
numberMap["8"] = set("tuv")
numberMap["9"] = set("wxyz")
def backtrack(index: int, path: List[str]):
if len(path) == len(digits):
result.append("".join(path))
return
letters = numberMap[digits[index]]
for letter in letters:
path.append(letter)
backtrack(index+1, path)
path.pop()
result = []
backtrack(0, [])
return result
digits = "23"
print(Solution().letterCombinations(digits))
digits = ""
print(Solution().letterCombinations(digits))
digits = "2"
print(Solution().letterCombinations(digits))
================================================
FILE: Python/0018-4sum.py
================================================
# time complexity: O(n^3)
# space complexity: O(n)
from typing import List
class Solution:
def fourSum(self, nums: List[int], target: int) -> List[List[int]]:
def kSum(nums: List[int], target: int, k: int) -> List[List[int]]:
result = []
if not nums:
return result
if k == 2:
return twoSum(nums, target)
for i in range(len(nums)):
if i == 0 or nums[i-1] != nums[i]:
for subset in kSum(nums[i+1:], target-nums[i], k-1):
result.append([nums[i]] + subset)
return result
def twoSum(nums: List[int], target: int) -> List[List[int]]:
result = []
left, right = 0, len(nums) - 1
while (left < right):
currSum = nums[left] + nums[right]
if currSum < target or (left > 0 and nums[left] == nums[left - 1]):
left += 1
elif currSum > target or (right < len(nums)-1 and nums[right] == nums[right + 1]):
right -= 1
else:
result.append([nums[left], nums[right]])
left += 1
right -= 1
return result
def twoSum(nums: List[int], target: int) -> List[List[int]]:
result = []
seen = {}
for i, num in enumerate(nums):
complement = target - num
if complement in seen and (not result or [complement, num] != result[-1]):
result.append([complement, num])
seen[num] = i
return result
nums.sort()
return kSum(nums, target, 4)
nums = [1, 0, -1, 0, -2, 2]
target = 0
print(Solution().fourSum(nums, target))
nums = [2, 2, 2, 2, 2]
target = 8
print(Solution().fourSum(nums, target))
================================================
FILE: Python/0019-remove-nth-node-from-end-of-list.py
================================================
# time complexity: O(n)
# space complexity: O(1)
from typing import Optional
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def removeNthFromEnd(self, head: Optional[ListNode], n: int) -> Optional[ListNode]:
dummy = ListNode(0)
dummy.next = head
fast = dummy
slow = dummy
for _ in range(n + 1):
fast = fast.next
while fast is not None:
fast = fast.next
slow = slow.next
slow.next = slow.next.next
return dummy.next
root = ListNode(1)
root.next = ListNode(2)
root.next.next = ListNode(3)
root.next.next.next = ListNode(4)
root.next.next.next.next = ListNode(5)
print(Solution().removeNthFromEnd(root, 2))
================================================
FILE: Python/0020-valid-parentheses.py
================================================
# time complexity: O(n)
# space complexity: O(n)
class Solution:
def isValid(self, s: str) -> bool:
bracketMap = {"(": ")", "[": "]", "{": "}"}
openSet = set(["(", "[", "{"])
stack = []
for char in s:
if char in openSet:
stack.append(char)
elif stack and char == bracketMap[stack[-1]]:
stack.pop()
else:
return False
return stack == []
class Solution:
def isValid(self, s: str) -> bool:
stack = []
for c in s:
if c in '{[(':
stack.append(c)
elif c == ')' and stack and stack[-1] == '(':
stack.pop()
elif c == ']' and stack and stack[-1] == '[':
stack.pop()
elif c == '}' and stack and stack[-1] == '{':
stack.pop()
else:
return False
return len(stack) == 0
s = "()"
print(Solution().isValid(s))
s = "()[]{}"
print(Solution().isValid(s))
s = "(]"
print(Solution().isValid(s))
s = "([])"
print(Solution().isValid(s))
s = "([)]"
print(Solution().isValid(s))
================================================
FILE: Python/0021-merge-two-sorted-lists.py
================================================
# Definition for singly-linked list.
class ListNode(object):
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution(object):
def mergeTwoLists(self, list1, list2):
dummy = ListNode()
current = dummy
while list1 and list2:
if list1.val <= list2.val:
current.next = list1
list1 = list1.next
else:
current.next = list2
list2 = list2.next
current = current.next
if list1:
current.next = list1
else:
current.next = list2
return dummy.next
================================================
FILE: Python/0022-generate-parentheses.py
================================================
# time complexity: O(4^n)
# space complexity: O(n)
from typing import List
class Solution:
def generateParenthesis(self, n: int) -> List[str]:
def backtrack(currString: str, leftCount: int, rightCount: int) -> None:
if len(currString) == 2*n:
result.append(currString)
return
if leftCount < n:
backtrack(currString + "(", leftCount + 1, rightCount)
if rightCount < leftCount:
backtrack(currString + ")", leftCount, rightCount + 1)
result = []
backtrack("", 0, 0)
return result
n = 3
print(Solution().generateParenthesis(n))
n = 1
print(Solution().generateParenthesis(n))
================================================
FILE: Python/0023-merge-k-sorted-lists.py
================================================
# Definition for singly-linked list.
from typing import List, Optional
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def mergeKLists(self, lists: List[Optional[ListNode]]) -> Optional[ListNode]:
nodes = []
head = point = ListNode(0)
for left in lists:
while left:
nodes.append(left.val)
left = left.next
for x in sorted(nodes):
point.next = ListNode(x)
point = point.next
return head.next
================================================
FILE: Python/0024-swap-nodes-in-pairs.py
================================================
# time complexity: O(n)
# space complexity: O(n)
from typing import Optional
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def swapPairs(self, head: Optional[ListNode]) -> Optional[ListNode]:
if head is None or head.next is None:
return head
firstNode = head
secondNode = head.next
firstNode.next = self.swapPairs(secondNode.next)
secondNode.next = firstNode
return secondNode
root = ListNode(1)
root.next = ListNode(2)
root.next.next = ListNode(3)
root.next.next.next = ListNode(4)
print(Solution().swapPairs(root))
================================================
FILE: Python/0025-reverse-nodes-in-k-group.py
================================================
# time complexity: O(n)
# space complexity: O(1)
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def reverseKGroup(self, head: ListNode, k: int) -> ListNode:
node = head
for _ in range(k):
if not node:
return head
node = node.next
prev = None
node = head
for _ in range(k):
nextNode = node.next
node.next = prev
prev = node
node = nextNode
head.next = self.reverseKGroup(node, k)
return prev
'''
k = 3
p n
|
1 2 3 4 5
|
'''
root = ListNode(1)
root.next = ListNode(2)
root.next.next = ListNode(3)
root.next.next.next = ListNode(4)
root.next.next.next.next = ListNode(5)
k = 2
print(Solution().reverseKGroup(root, k))
================================================
FILE: Python/0026-remove-duplicates-from-sorted-array.py
================================================
# time complexity: O(n)
# space complexity: O(1)
from typing import List
class Solution:
def removeDuplicates(self, nums: List[int]) -> int:
index = 1
for i in range(1, len(nums)):
if nums[i - 1] != nums[i]:
nums[index] = nums[i]
index += 1
return index
nums = [1, 1, 2]
print(Solution().removeDuplicates(nums))
nums = [0, 0, 1, 1, 1, 2, 2, 3, 3, 4]
print(Solution().removeDuplicates(nums))
================================================
FILE: Python/0027-remove-element.py
================================================
from typing import List
class Solution:
def removeElement(self, nums: List[int], val: int) -> int:
index = 0
for i in range(len(nums)):
if nums[i] != val:
nums[index] = nums[i]
index += 1
return index
nums = [3, 2, 2, 3]
val = 3
print(Solution().removeElement(nums,val))
================================================
FILE: Python/0028-find-the-index-of-the-first-occurrence-in-a-string.py
================================================
# time complexity: O(n)
# space complexity: O(1)
class Solution:
def strStr(self, haystack: str, needle: str) -> int:
if needle not in haystack:
return -1
return haystack.index(needle)
haystack = "sabdbutsad"
needle = "sad"
print(Solution().strStr(haystack, needle))
================================================
FILE: Python/0029-divide-two-integers.py
================================================
# time complexity: O(1)
# space complexity: O(1)
class Solution:
def divide(self, dividend: int, divisor: int) -> int:
sign = -1 if (dividend >= 0 and divisor <
0) or (dividend < 0 and divisor >= 0) else 1
dividend = abs(dividend)
divisor = abs(divisor)
result = len(range(0, dividend-divisor+1, divisor))
if sign == -1:
result = -result
minusLimit = -(2**31)
plusLimit = (2**31 - 1)
result = min(max(result, minusLimit), plusLimit)
return result
dividend = 7
divisor = -3
print(Solution().divide(dividend, divisor))
================================================
FILE: Python/0030-substring-with-concatenation-of-all-words.py
================================================
# time complexity: O(a + n*b)
# space complexity: O(a + b)
from collections import Counter, defaultdict
from typing import List
class Solution:
def findSubstring(self, s: str, words: List[str]) -> List[int]:
result = []
sSize = len(s)
wordLen = len(words[0])
wordCount = Counter(words)
def slidingWindow(left):
foundCount = defaultdict(lambda: 0)
totalMatched = 0
for right in range(left, len(s), wordLen):
if right + wordLen > sSize:
break
newWord = s[right: right + wordLen]
if newWord not in wordCount:
foundCount = defaultdict(lambda: 0)
totalMatched = 0
left = right + wordLen
else:
foundCount[newWord] += 1
if foundCount[newWord] > wordCount[newWord]:
while foundCount[newWord] > wordCount[newWord]:
leftMost = s[left: left + wordLen]
foundCount[leftMost] -= 1
left += wordLen
if leftMost != newWord:
totalMatched -= 1
else:
totalMatched += 1
if totalMatched == len(words):
result.append(left)
for i in range(wordLen):
slidingWindow(i)
return result
s = "barfoothefoobarman"
words = ["foo", "bar"]
print(Solution().findSubstring(s, words))
================================================
FILE: Python/0031-next-permutation.py
================================================
# time complexity: O(n^2)
# space complexity: O(1)
from typing import List
class Solution:
def nextPermutation(self, nums: List[int]) -> None:
if nums == sorted(nums, key=lambda x: -x):
nums.sort()
return
for i in range(len(nums) - 1, 0, -1):
if nums[i - 1] < nums[i]:
minIdx, minVal = len(nums), float('inf')
for j in range(len(nums) - 1, i - 1, -1):
if nums[j] > nums[i - 1] and nums[j] < minVal:
minVal = nums[j]
minIdx = j
nums[i - 1], nums[minIdx] = nums[minIdx], nums[i - 1]
while True:
swapped = False
for k in range(i, len(nums) - 1):
if nums[k] > nums[k + 1]:
swapped = True
nums[k], nums[k + 1] = nums[k + 1], nums[k]
if swapped == False:
break
return
nums = [1, 2, 3]
print(Solution().nextPermutation(nums))
nums = [3, 2, 1]
print(Solution().nextPermutation(nums))
nums = [1, 1, 5]
print(Solution().nextPermutation(nums))
================================================
FILE: Python/0032-longest-valid-parentheses.py
================================================
# time complexity; O(n)
# space complexity: O(n)
class Solution:
def longestValidParentheses(self, s: str) -> int:
stack = []
stack.append(-1)
count = 0
for i, c in enumerate(s):
if s[i] == "(":
stack.append(i)
else:
stack.pop()
if not stack:
stack.append(i)
else:
count = max(count, i - stack[-1])
return count
s = ")()())"
print(Solution().longestValidParentheses(s))
================================================
FILE: Python/0033-search-in-rotated-sorted-array.py
================================================
# time complexity: O(logn)
# space complexity: O(1)
from typing import List
class Solution:
def search(self, nums: List[int], target: int) -> int:
left = 0
right = len(nums) - 1
while left <= right:
mid = left + (right - left) // 2
if nums[mid] == target:
return mid
if nums[left] <= nums[mid]:
if nums[left] <= target < nums[mid]:
right = mid - 1
else:
left = mid + 1
else:
if nums[mid] < target <= nums[right]:
left = mid + 1
else:
right = mid - 1
return -1
nums = [4, 5, 6, 7, 0, 1, 2]
target = 0
print(Solution().search(nums, target))
nums = [4, 5, 6, 7, 0, 1, 2]
target = 3
print(Solution().search(nums, target))
nums = [3, 1]
target = 1
print(Solution().search(nums, target))
================================================
FILE: Python/0034-find-first-and-last-position-of-element-in-sorted-array.py
================================================
# time complexity: O(logn)
# space complexity: O(1)
from bisect import bisect
from typing import List
class Solution:
def searchRange(self, nums: List[int], target: int) -> List[int]:
def findFirst(nums, target):
left, right = 0, len(nums) - 1
first = -1
while left <= right:
mid = left + (right - left) // 2
if nums[mid] == target:
first = mid
right = mid - 1
elif nums[mid] < target:
left = mid + 1
else:
right = mid - 1
return first
def findLast(nums, target):
left, right = 0, len(nums) - 1
last = -1
while left <= right:
mid = left + (right - left) // 2
if nums[mid] == target:
last = mid
left = mid + 1
elif nums[mid] < target:
left = mid + 1
else:
right = mid - 1
return last
first = findFirst(nums, target)
last = findLast(nums, target)
return [first, last]
# time complexity: O(logn)
# space complexity: O(1)
class Solution:
def searchRange(self, nums: List[int], target: int) -> List[int]:
left = bisect.bisect_left(nums, target)
right = bisect.bisect_right(nums, target) - 1
if left < len(nums) and nums[left] == target:
return [left, right]
else:
return [-1, -1]
# time complexity: O(n)
# space complexity: O(1)
class Solution:
def searchRange(self, nums: List[int], target: int) -> List[int]:
left, right = 0, len(nums) - 1
first, last = -1, -1
while left <= right:
mid = left + (right - left) // 2
if nums[mid] == target:
first = mid
last = mid
while first > 0 and nums[first - 1] == target:
first -= 1
while last < len(nums) - 1 and nums[last + 1] == target:
last += 1
return [first, last]
elif nums[mid] < target:
left = mid + 1
else:
right = mid - 1
return [first, last]
nums = [5, 7, 7, 8, 8, 10]
target = 6
print(Solution().searchRange(nums, target))
nums = [5, 7, 7, 8, 8, 10]
target = 8
print(Solution().searchRange(nums, target))
nums = []
target = 0
print(Solution().searchRange(nums, target))
================================================
FILE: Python/0035-search-insert-position.py
================================================
# time complexity: O(logn)
# space complexity: O(1)
from typing import List
class Solution:
def searchInsert(self, nums: List[int], target: int) -> int:
left = 0
right = len(nums)
while left < right:
mid = left + (right - left) // 2
if nums[mid] > target:
right = mid
elif nums[mid] < target:
left = mid + 1
else:
return mid
return left
nums = [1, 3, 5, 6]
target = 2
print(Solution().searchInsert(nums, target))
================================================
FILE: Python/0036-valid-sudoku.py
================================================
# time complexity: O(n^2) -> O(1)
# space complexity: O(n^2) -> O(1)
from typing import List
class Solution:
def isValidSudoku(self, board: List[List[str]]) -> bool:
N = 9
rows = [set() for _ in range(N)]
cols = [set() for _ in range(N)]
boxes = [set() for _ in range(N)]
for r in range(N):
for c in range(N):
value = board[r][c]
if value == '.':
continue
if value in rows[r]:
return False
rows[r].add(value)
if value in cols[c]:
return False
cols[c].add(value)
idx = (r // 3) * 3 + c // 3
if value in boxes[idx]:
return False
boxes[idx].add(value)
return True
'''
0 0 0 1 1 1 2 2 2 <- c // 3
0 1 2 3 4 5 6 7 8 <- c
00 01 02 03 04 05 06 07 08
10 11 12 13 14 15 16 17 18
20 21 22 23 24 25 26 27 28
'''
board = [["5", "3", ".", ".", "7", ".", ".", ".", "."],
["6", ".", ".", "1", "9", "5", ".", ".", "."],
[".", "9", "8", ".", ".", ".", ".", "6", "."],
["8", ".", ".", ".", "6", ".", ".", ".", "3"],
["4", ".", ".", "8", ".", "3", ".", ".", "1"],
["7", ".", ".", ".", "2", ".", ".", ".", "6"],
[".", "6", ".", ".", ".", ".", "2", "8", "."],
[".", ".", ".", "4", "1", "9", ".", ".", "5"],
[".", ".", ".", ".", "8", ".", ".", "7", "9"]]
print(Solution().isValidSudoku(board))
board = [[".", ".", ".", ".", "5", ".", ".", "1", "."],
[".", "4", ".", "3", ".", ".", ".", ".", "."],
[".", ".", ".", ".", ".", "3", ".", ".", "1"],
["8", ".", ".", ".", ".", ".", ".", "2", "."],
[".", ".", "2", ".", "7", ".", ".", ".", "."],
[".", "1", "5", ".", ".", ".", ".", ".", "."],
[".", ".", ".", ".", ".", "2", ".", ".", "."],
[".", "2", ".", "9", ".", ".", ".", ".", "."],
[".", ".", "4", ".", ".", ".", ".", ".", "."]]
print(Solution().isValidSudoku(board))
================================================
FILE: Python/0037-sudoku-solver.py
================================================
# time complexity: O(9!^9)
# space complexity: O(1)
from collections import defaultdict
from typing import List
class Solution:
def solveSudoku(self, board: List[List[str]]) -> None:
n = len(board)
rows, cols, boxes = defaultdict(
set), defaultdict(set), defaultdict(set)
for r in range(n):
for c in range(n):
if board[r][c] == '.':
continue
digit = int(board[r][c])
rows[r].add(digit)
cols[c].add(digit)
boxes[(r // 3) * 3 + c // 3].add(digit)
def isValid(r: int, c: int, digit: int):
boxId = (r // 3) * 3 + c // 3
return digit not in rows[r] and digit not in cols[c] and digit not in boxes[boxId]
def backtrack(r: int, c: int):
if r == n - 1 and c == n:
return True
elif c == n:
c = 0
r += 1
if board[r][c] != '.':
return backtrack(r, c + 1)
boxId = (r // 3) * 3 + c // 3
for digit in range(1, n + 1):
if not isValid(r, c, digit):
continue
board[r][c] = str(digit)
rows[r].add(digit)
cols[c].add(digit)
boxes[boxId].add(digit)
if backtrack(r, c + 1):
return True
board[r][c] = '.'
rows[r].remove(digit)
cols[c].remove(digit)
boxes[boxId].remove(digit)
return False
backtrack(0, 0)
board = [
["5", "3", ".", ".", "7", ".", ".", ".", "."],
["6", ".", ".", "1", "9", "5", ".", ".", "."],
[".", "9", "8", ".", ".", ".", ".", "6", "."],
["8", ".", ".", ".", "6", ".", ".", ".", "3"],
["4", ".", ".", "8", ".", "3", ".", ".", "1"],
["7", ".", ".", ".", "2", ".", ".", ".", "6"],
[".", "6", ".", ".", ".", ".", "2", "8", "."],
[".", ".", ".", "4", "1", "9", ".", ".", "5"],
[".", ".", ".", ".", "8", ".", ".", "7", "9"]
]
print(Solution().solveSudoku(board))
================================================
FILE: Python/0038-count-and-say.py
================================================
# time compexity: O(2^n)
# space complexity: O(n)
from collections import defaultdict
from functools import lru_cache
class Solution:
def RLE(self, countString: str):
temp = ""
freqDict = defaultdict(int)
freqDict[countString[0]] += 1
for i in range(1, len(countString)):
if countString[i] != countString[i-1]:
key = countString[i-1]
freq = freqDict[countString[i-1]]
temp += str(freq) + key
del freqDict[countString[i-1]]
freqDict[countString[i]] += 1
else:
freqDict[countString[i]] += 1
for key, freq in freqDict.items():
temp += str(freq) + key
return temp
@lru_cache(None)
def countAndSay(self, n: int) -> str:
if n == 1:
return "1"
return self.RLE(self.countAndSay(n-1))
n = 4
print(Solution().countAndSay(n))
================================================
FILE: Python/0039-combination-sum.py
================================================
# time complexity: O(n^(t/m) + 1)
# space complexity: O(t/m)
from typing import List
# Backtrack
class Solution:
def combinationSum(self, candidates: List[int], target: int) -> List[List[int]]:
result = []
def backtrack(start: int, comb: List[int], remain: int):
if remain == 0:
result.append(list(comb))
return
elif remain < 0:
return
else:
for i in range(start, len(candidates)):
comb.append(candidates[i])
backtrack(i, comb, remain - candidates[i])
comb.pop()
backtrack(0, [], target)
return result
# time complexity: O(t*n*s^2log(s))
# space complexity: O(t*n*c)
# Bottom Up
class Solution:
def combinationSum(self, nums: List[int], target: int) -> List[List[int]]:
dp = [[] for _ in range(target + 1)]
dp[0].append([])
for i in range(1, target + 1):
for j in range(len(nums)):
if nums[j] <= i:
for prev in dp[i - nums[j]]:
temp = prev + [nums[j]]
temp.sort()
if temp not in dp[i]:
dp[i].append(temp)
return dp[target]
candidates = [2, 3, 6, 7]
target = 7
print(Solution().combinationSum(candidates, target))
candidates = [2, 3, 5]
target = 8
print(Solution().combinationSum(candidates, target))
candidates = [2]
target = 1
print(Solution().combinationSum(candidates, target))
================================================
FILE: Python/0040-combination-sum-ii.py
================================================
# time complexity: O(2^n)
# space complexity: O(n)
from typing import List
class Solution:
def combinationSum2(self, candidates: List[int], target: int) -> List[List[int]]:
answer = []
candidates.sort()
self.backtrack(candidates, target, 0, [], answer)
return answer
def backtrack(self, candidates, target: int, totalIdx: int, path: List[int], answer: List[int]):
if target < 0:
return
if target == 0:
answer.append(path)
return
for i in range(totalIdx, len(candidates)):
if i > totalIdx and candidates[i] == candidates[i - 1]:
continue
self.backtrack(
candidates,
target - candidates[i],
i + 1,
path + [candidates[i]],
answer,
)
candidates = [10, 1, 2, 7, 6, 1, 5]
target = 8
print(Solution().combinationSum2(candidates, target))
================================================
FILE: Python/0041-first-missing-positive.py
================================================
# time complexity: O(n)
# space complexity: O(1)
from typing import List
class Solution:
def firstMissingPositive(self, nums: List[int]) -> int:
n = len(nums)
i = 0
while i < n:
value = nums[i] - 1
if 0 <= value < n and nums[i] != nums[value]:
nums[value], nums[i] = nums[i], nums[value]
else:
i += 1
for i in range(n):
if nums[i] != i + 1:
return i + 1
return n + 1
nums = [1, 2, 0]
print(Solution().firstMissingPositive(nums))
nums = [3, 4, -1, 1]
print(Solution().firstMissingPositive(nums))
nums = [7, 8, 9, 11, 12]
print(Solution().firstMissingPositive(nums))
================================================
FILE: Python/0042-trapping-rain-water.py
================================================
# time complexity: O(n)
# space complexity: O(1)
from typing import List
class Solution:
def trap(self, height: List[int]) -> int:
ans = 0
left, right = 0, len(height) - 1
leftMax, rightMax = 0, 0
while left < right:
if height[left] < height[right]:
if height[left] >= leftMax:
leftMax = height[left]
else:
ans += leftMax - height[left]
left += 1
else:
if height[right] >= rightMax:
rightMax = height[right]
else:
ans += rightMax - height[right]
right -= 1
return ans
height = [0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1]
print(Solution().trap(height))
================================================
FILE: Python/0043-multiply-strings.py
================================================
# time complexity: O(m*n)
# space complexity: O(m+n)
class Solution:
def multiply(self, num1: str, num2: str) -> str:
if num1 == "0" or num2 == "0":
return "0"
N = len(num1) + len(num2)
result = [0] * N
firstNum = num1[::-1]
secondNum = num2[::-1]
for place1, digit1 in enumerate(firstNum):
for place2, digit2 in enumerate(secondNum):
currPos = place1 + place2
carry = result[currPos]
multiplication = int(digit1) * int(digit2) + carry
result[currPos] = multiplication % 10
result[currPos + 1] += multiplication // 10
if result[-1] == 0:
result.pop()
return "".join(str(digit) for digit in result[::-1])
num1 = "2"
num2 = "3"
print(Solution().multiply(num1, num2))
num1 = "123"
num2 = "456"
print(Solution().multiply(num1, num2))
================================================
FILE: Python/0044-wildcard-matching.py
================================================
# time complexity: O(s * p * (s + p))
# space complexity: O(s * p)
class Solution:
def isMatch(self, s: str, p: str) -> bool:
def removeDuplicateStarts(p: str) -> str:
newString = []
for char in p:
if not newString or char != "*":
newString.append(char)
elif newString[-1] != "*":
newString.append(char)
return "".join(newString)
def helper(s: str, p: str) -> bool:
if (s, p) in dp:
return dp[(s, p)]
if p == s or p == "*":
dp[(s, p)] = True
elif p == "" or s == "":
dp[(s, p)] = False
elif p[0] == s[0] or p[0] == "?":
dp[(s, p)] = helper(s[1:], p[1:])
elif p[0] == "*":
dp[(s, p)] = helper(s, p[1:]) or helper(s[1:], p)
else:
dp[(s, p)] = False
return dp[(s, p)]
dp = {}
p = removeDuplicateStarts(p)
return helper(s, p)
# time complexity: O(s * p)
# space complexity: O(s * p)
class Solution:
def isMatch(self, s: str, p: str) -> bool:
sLen = len(s)
pLen = len(p)
if p == s or set(p) == {"*"}:
return True
if p == "" or s == "":
return False
d = [[False for _ in range(sLen + 1)] for _ in range(pLen + 1)]
d[0][0] = True
for pIdx in range(1, pLen + 1):
if p[pIdx - 1] == "*":
sIdx = 1
while not d[pIdx - 1][sIdx - 1] and sIdx < sLen + 1:
sIdx += 1
d[pIdx][sIdx - 1] = d[pIdx - 1][sIdx - 1]
while sIdx < sLen + 1:
d[pIdx][sIdx] = True
sIdx += 1
elif p[pIdx - 1] == "?":
for sIdx in range(1, sLen + 1):
d[pIdx][sIdx] = d[pIdx - 1][sIdx - 1]
else:
for sIdx in range(1, sLen + 1):
d[pIdx][sIdx] = (d[pIdx - 1][sIdx - 1]
and p[pIdx - 1] == s[sIdx - 1])
return d[pLen][sLen]
# time complexity: O(min(s, p))
# space complexity: O(1)
class Solution:
def isMatch(self, s: str, p: str) -> bool:
sLen, pLen = len(s), len(p)
sIdx = pIdx = 0
starIdx = sTempIdx = -1
while sIdx < sLen:
if pIdx < pLen and p[pIdx] in ["?", s[sIdx]]:
sIdx += 1
pIdx += 1
elif pIdx < pLen and p[pIdx] == "*":
starIdx = pIdx
sTempIdx = sIdx
pIdx += 1
elif starIdx == -1:
return False
else:
pIdx = starIdx + 1
sIdx = sTempIdx + 1
sTempIdx = sIdx
return all(p[i] == "*" for i in range(pIdx, pLen))
s = "aa"
p = "a"
print(Solution().isMatch(s, p))
s = "aa"
p = "*"
print(Solution().isMatch(s, p))
s = "cb"
p = "?a"
print(Solution().isMatch(s, p))
================================================
FILE: Python/0045-jump-game-ii.py
================================================
from typing import List
# Backtracking
# O(2^n) - Times out
class Solution:
def jump(self, nums: List[int]) -> int:
result = float('inf')
def backtrack(candidate, end):
if candidate >= result:
return
if end <= 0:
result = candidate
for i in range(end)[::-1]:
if nums[i] + i >= end:
backtrack(candidate + 1, i)
backtrack(0, len(nums)-1)
return result
# Memoized backtracking (Top-down DP)
# O(n^2) - Times out
class Solution:
def jump(self, nums: List[int]) -> int:
result = float('inf')
memo = {}
def backtrack(candidate, end):
if (candidate, end) in memo:
return memo[candidate, end]
if candidate >= result:
return
if end <= 0:
result = candidate
for i in range(end)[::-1]:
if nums[i] + i >= end:
backtrack(candidate + 1, i)
memo[(candidate, end)] = result
return memo[(candidate, end)]
backtrack(0, len(nums)-1)
return result
# Bottom-Up DP
# O(nm)
class Solution:
def jump(self, nums: List[int]) -> int:
if len(nums) == 1:
return 0
dp = [0]
for i in range(len(nums)):
dp.append(max((nums[j] + j for j in range(dp[i] + 1))))
if dp[i + 1] >= len(nums)-1:
break
return len(dp) - 1
# Greedy
# time complexity: O(n)
# space complexity: O(1)
class Solution:
def jump(self, nums: List[int]) -> int:
if len(nums) == 1:
return 0
last = nextPlace = 0
count = 1
for _ in range(len(nums)):
temp = nextPlace
nextPlace = max(nums[j] + j for j in range(last, nextPlace + 1))
if nextPlace >= len(nums) - 1:
break
count += 1
last = temp
return count
# time complexity: O(n)
# space complexity: O(1)
class Solution:
def jump(self, nums: List[int]) -> int:
near = far = jumps = 0
while far < len(nums) - 1:
farthest = 0
for i in range(near, far + 1):
farthest = max(farthest, i + nums[i])
near = far + 1
far = farthest
jumps += 1
return jumps
nums = [2, 3, 1, 1, 4]
print(Solution().jump(nums))
nums = [2, 3, 0, 1, 4]
print(Solution().jump(nums))
================================================
FILE: Python/0046-permutations.py
================================================
# time complexity: O(n*n!)
# space complexity: O(n)
from itertools import permutations
from typing import List
class Solution:
def permute(self, nums: List[int]) -> List[List[int]]:
def backtrack(curr: List[int]):
if len(curr) == len(nums):
result.append(curr[:])
for num in nums:
if num not in curr:
curr.append(num)
backtrack(curr)
curr.pop()
result = []
backtrack([])
return result
# class Solution:
# def permute(self, nums: List[int]) -> List[List[int]]:
# result = []
# for _, item in enumerate(list(permutations(nums))):
# result.append(list(item))
# return result
# class Solution:
# def permute(self, nums: List[int]) -> List[List[int]]:
# out = []
# stack = [[]]
# while stack:
# curr = stack.pop()
# if len(curr) == len(nums):
# out.append(curr)
# continue
# for num in nums:
# if num not in curr:
# stack.append((curr + [num]))
# print(out)
# return []
nums = [1, 2, 3]
print(Solution().permute(nums))
================================================
FILE: Python/0047-permutations-ii.py
================================================
# time complexity: O(sigma*P(n,k))
# space complexity: O(n)
from collections import Counter
from itertools import permutations
from typing import List
class Solution:
def permuteUnique(self, nums: List[int]) -> List[List[int]]:
results = []
def backtrack(comb, counter):
if len(comb) == len(nums):
results.append(list(comb))
return
for num in counter:
if counter[num] > 0:
comb.append(num)
counter[num] -= 1
backtrack(comb, counter)
comb.pop()
counter[num] += 1
backtrack([], Counter(nums))
return results
class Solution:
def permuteUnique(self, nums: List[int]) -> List[List[int]]:
result = []
for _, item in enumerate(list(permutations(nums))):
temp = list(item)
if temp not in result:
result.append(temp)
return result
nums = [1, 1, 2]
print(Solution().permuteUnique(nums))
================================================
FILE: Python/0048-rotate-image.py
================================================
from typing import List
# time complexity: O(n^2)
# space complexity: O(n^2)
class Solution:
def rotate(self, matrix: List[List[int]]) -> None:
ROW = len(matrix)
COL = len(matrix[0])
newMatrix = [[0 for _ in range(COL)]
for _ in range(ROW)]
for r in range(ROW):
for c in range(COL):
newMatrix[c][ROW - r - 1] = matrix[r][c]
return
# time complexity: O(n^2)
# space complexity: O(1)
class Solution:
def rotate(self, matrix: List[List[int]]) -> None:
n = len(matrix)
for r in range(n // 2):
for c in range(r, n - r - 1):
matrix[r][c], matrix[c][n-1-r] = matrix[c][n-1-r], matrix[r][c]
matrix[r][c], matrix[n-1-r][n-1 -
c] = matrix[n-1-r][n-1-c], matrix[r][c]
matrix[r][c], matrix[n-1-c][r] = matrix[n-1-c][r], matrix[r][c]
return matrix
# time complexity: O(n^2)
# space complexity: O(1)
class Solution:
def rotate(self, matrix: List[List[int]]) -> None:
ROW = len(matrix)
COL = len(matrix[0])
for r in range(ROW):
for c in range(r + 1, COL):
matrix[r][c], matrix[c][r] = matrix[c][r], matrix[r][c]
for r in range(ROW):
for c in range(COL // 2):
matrix[r][c], matrix[r][-c -1] = matrix[r][-c - 1], matrix[r][c]
matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
print(Solution().rotate(matrix))
matrix = [[5, 1, 9, 11], [2, 4, 8, 10], [13, 3, 6, 7], [15, 14, 12, 16]]
print(Solution().rotate(matrix))
================================================
FILE: Python/0049-group-anagrams.py
================================================
# time complexity: O(nklogn)
# space complexity: O(nk)
from collections import defaultdict
from typing import List
class Solution:
def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
wordMap = defaultdict(list)
for word in strs:
key = ''.join(sorted(word))
wordMap[key].append(word)
return [row for row in wordMap.values()]
# time complexity: O(nk)
# space complexity: O(nk)
class Solution:
def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
result = defaultdict(list)
for s in strs:
count = [0] * 26
for c in s:
count[ord(c) - ord("a")] += 1
result[tuple(count)].append(s)
return list(result.values())
strs = ["eat", "tea", "tan", "ate", "nat", "bat"]
print(Solution().groupAnagrams(strs))
strs = [""]
print(Solution().groupAnagrams(strs))
strs = ["a"]
print(Solution().groupAnagrams(strs))
================================================
FILE: Python/0050-powx-n.py
================================================
# time complexity: O(logn)
# space complexity: O(logn)
from functools import lru_cache
class Solution:
def myPow(self, x: float, n: int) -> float:
@lru_cache(None)
def binaryExp(x, n):
if n == 0:
return 1
if n == 1:
return x
if n < 0:
return 1.0 / binaryExp(x, -n)
if n % 2:
return x * binaryExp(x * x, (n - 1) // 2)
else:
return binaryExp(x * x, n // 2)
return binaryExp(x, n)
# time complexity: O(logn)
# space complexity: O(1)
class Solution:
def myPow(self, x: float, n: int) -> float:
if n == 0:
return 1
if n < 0:
n = -1 * n
x = 1.0 / x
result = 1
while n != 0:
if n % 2 == 1:
result *= x
n -= 1
x *= x
n //= 2
return result
x = 2.00000
n = 10
print(Solution().myPow(x, n))
x = 2.10000
n = 3
print(Solution().myPow(x, n))
x = 2.00000
n = -2
print(Solution().myPow(x, n))
================================================
FILE: Python/0051-n-queens.py
================================================
# time complexity: O(n!)
# space complexity: O(n^2)
from typing import List
class Solution:
def solveNQueens(self, n: int) -> List[List[str]]:
result = []
board = [['.'] * n for _ in range(n)]
colSet = set()
posDiagonal = set()
negDiagonal = set()
def backtrack(r: int):
if r == n:
copy = ["".join(row) for row in board]
result.append(copy)
for c in range(n):
if c in colSet or (r + c) in posDiagonal or (r - c) in negDiagonal:
continue
colSet.add(c)
posDiagonal.add(r + c)
negDiagonal.add(r - c)
board[r][c] = 'Q'
backtrack(r+1)
colSet.remove(c)
posDiagonal.remove(r + c)
negDiagonal.remove(r - c)
board[r][c] = '.'
backtrack(0)
return result
n = 4
print(Solution().solveNQueens(n))
================================================
FILE: Python/0052-n-queens-ii.py
================================================
# time complexity: O(n!)
# space complexity: O(n)
from typing import List
class Solution:
def totalNQueens(self, n: int) -> int:
result = []
emptyBoard = [["."] * n for _ in range(n)]
def backtrack(r: int, diagonals: set, antiDiagonals: set, cols: set, state: List[str]):
if r == n:
board = []
for row in state:
board.append("".join(row))
result.append(board)
return
for c in range(n):
currDiagonal = r - c
currAntiDiagonal = r + c
if (
c in cols
or currDiagonal in diagonals
or currAntiDiagonal in antiDiagonals
):
continue
cols.add(c)
diagonals.add(currDiagonal)
antiDiagonals.add(currAntiDiagonal)
state[r][c] = "Q"
backtrack(r + 1, diagonals, antiDiagonals, cols, state)
cols.remove(c)
diagonals.remove(currDiagonal)
antiDiagonals.remove(currAntiDiagonal)
state[r][c] = "."
backtrack(0, set(), set(), set(), emptyBoard)
return len(result)
n = 4
print(Solution().totalNQueens(n))
n = 1
print(Solution().totalNQueens(n))
================================================
FILE: Python/0053-maximum-subarray.py
================================================
# time complexity: O(n)
# space complexity: O(1)
from typing import List
class Solution:
def maxSubArray(self, nums: List[int]) -> int:
result = float('-inf')
prefix = 0
for num in nums:
prefix += num
prefix = max(prefix, num)
result = max(result, prefix)
return result
# time complexity: O(nlogn)
# space complexity: O(logn)
class Solution:
def maxSubArray(self, nums: List[int]) -> int:
def findBestSubarray(nums, left, right):
if left > right:
return float('-inf')
mid = (left + right) // 2
curr = bestLeftSum = bestRightSum = 0
for i in range(mid - 1, left - 1, -1):
curr += nums[i]
bestLeftSum = max(bestLeftSum, curr)
curr = 0
for i in range(mid + 1, right + 1):
curr += nums[i]
bestRightSum = max(bestRightSum, curr)
bestCombinedSum = nums[mid] + bestLeftSum + bestRightSum
leftHalf = findBestSubarray(nums, left, mid - 1)
rightHalf = findBestSubarray(nums, mid + 1, right)
return max(bestCombinedSum, leftHalf, rightHalf)
return findBestSubarray(nums, 0, len(nums) - 1)
nums = [-2, 1, -3, 4, -1, 2, 1, -5, 4]
print(Solution().maxSubArray(nums))
nums = [1]
print(Solution().maxSubArray(nums))
nums = [5, 4, -1, 7, 8]
print(Solution().maxSubArray(nums))
================================================
FILE: Python/0054-spiral-matrix.py
================================================
# time complexity: O(m*n)
# space complexity: O(1)
from typing import List
class Solution:
def spiralOrder(self, matrix: List[List[int]]) -> List[int]:
ROW = len(matrix)
COL = len(matrix[0])
direction = 1
row = 0
col = -1
result = []
while ROW > 0 and COL > 0:
for _ in range(COL):
col += direction
result.append(matrix[row][col])
ROW -= 1
for _ in range(ROW):
row += direction
result.append(matrix[row][col])
COL -= 1
direction *= -1
return result
matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
print(Solution().spiralOrder(matrix))
matrix = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]
print(Solution().spiralOrder(matrix))
================================================
FILE: Python/0055-jump-game.py
================================================
# time complexity: O(n)
# space complexity: O(1)
from typing import List
class Solution:
def canJump(self, nums: List[int]) -> bool:
lastPos = len(nums) - 1
for i in range(len(nums) - 1, -1, -1):
if i + nums[i] >= lastPos:
lastPos = i
return lastPos == 0
# time complexity: O(n^2)
# space complexity: O(n)
class Solution:
def canJump(self, nums: List[int]) -> bool:
GOOD = 1
BAD = 0
UNKNOWN = -1
dp = [UNKNOWN for _ in range(len(nums))]
dp[-1] = GOOD
for i in range(len(nums) - 2, -1, -1):
lastPos = min(i + nums[i], len(nums) - 1)
for j in range(i + 1, lastPos + 1):
if dp[j] == GOOD:
dp[i] = GOOD
break
return dp[0] == GOOD
nums = [2, 3, 1, 1, 4]
print(Solution().canJump(nums))
nums = [3, 2, 1, 0, 4]
print(Solution().canJump(nums))
================================================
FILE: Python/0056-merge-intervals.py
================================================
# time complexity: O(nlogn)
# space complexity: O(n)
from typing import List
class Solution:
def merge(self, intervals: List[List[int]]) -> List[List[int]]:
intervals.sort()
stack = []
if intervals:
stack.append(intervals[0])
for i in range(1, len(intervals)):
currInterval = intervals[i]
prevInterval = stack[-1]
if prevInterval[1] < currInterval[0]:
stack.append(currInterval)
elif prevInterval[1] < currInterval[1]:
stack[-1][1] = currInterval[1]
return stack
'''
[1, 5] -> [2, 6] -> [1, 6]
[2, 4] -> [1, 5]
[6, 9] -> [1, 5] [6, 9]
'''
intervals = [[1, 3], [2, 6], [8, 10], [15, 18]]
print(Solution().merge(intervals))
intervals = [[1, 4], [4, 5]]
print(Solution().merge(intervals))
intervals = [[1, 4], [2, 3]]
print(Solution().merge(intervals))
intervals = [[1, 4], [1, 4]]
print(Solution().merge(intervals))
================================================
FILE: Python/0057-insert-interval.py
================================================
# time complexity: O(n)
# space complexity: O(n)
from typing import List
class Solution:
def insert(self, intervals: List[List[int]], newInterval: List[int]) -> List[List[int]]:
result = []
i = 0
while i < len(intervals) and newInterval[0] > intervals[i][1]:
result.append(intervals[i])
i += 1
while i < len(intervals) and newInterval[1] >= intervals[i][0]:
newInterval[0] = min(intervals[i][0], newInterval[0])
newInterval[1] = max(intervals[i][1], newInterval[1])
i += 1
result.append(newInterval)
while i < len(intervals):
result.append(intervals[i])
i += 1
return result
# time complexity: O(n)
# space complexity: O(n)
class Solution:
def insert(self, intervals: List[List[int]], newInterval: List[int]) -> List[List[int]]:
result = []
merged = False
for interval in intervals:
if interval[1] < newInterval[0]:
result.append(interval)
elif interval[0] > newInterval[1]:
if not merged:
result.append(newInterval)
merged = True
result.append(interval)
else:
newInterval[0] = min(newInterval[0], interval[0])
newInterval[1] = max(newInterval[1], interval[1])
if not merged:
result.append(newInterval)
return result
intervals = [[1, 3], [6, 9]]
newInterval = [2, 5]
print(Solution().insert(intervals, newInterval))
intervals = [[1, 2], [3, 5], [6, 7], [8, 10], [12, 16]]
newInterval = [4, 8]
print(Solution().insert(intervals, newInterval))
================================================
FILE: Python/0058-length-of-last-word.py
================================================
class Solution:
def lengthOfLastWord(self, s: str) -> int:
filteredList = [item for item in list(s.split(" ")) if item != ""]
return len(filteredList[-1])
s = " fly me to the moon "
print(Solution().lengthOfLastWord(s))
================================================
FILE: Python/0059-spiral-matrix-ii.py
================================================
# time complexity: O(m*n)
# space complexity: O(m*n)
from typing import List
class Solution:
def generateMatrix(self, n: int) -> List[List[int]]:
grid = [[0 for _ in range(n)] for _ in range(n)]
ROW = n
COL = n
direction = 1
row = 0
col = -1
i = 1
while ROW > 0 and COL > 0:
for _ in range(COL):
col += direction
grid[row][col] = i
i += 1
ROW -= 1
for _ in range(ROW):
row += direction
grid[row][col] = i
i += 1
COL -= 1
direction *= -1
return grid
n = 3
print(Solution().generateMatrix(3))
n = 1
print(Solution().generateMatrix(1))
================================================
FILE: Python/0061-rotate-list.py
================================================
# time complexity: O(n)
# space complexity: O(1)
from typing import Optional
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def rotateRight(self, head: Optional[ListNode], k: int) -> Optional[ListNode]:
if head is None or head.next is None:
return head
oldTail = head
n = 1
while oldTail.next:
oldTail = oldTail.next
n += 1
k = k % n
oldTail.next = head
newTail = head
for i in range(1, n-k):
newTail = newTail.next
newHead = newTail.next
newTail.next = None
return newHead
root = ListNode(1)
root.next = ListNode(2)
root.next.next = ListNode(3)
root.next.next.next = ListNode(4)
root.next.next.next.next = ListNode(5)
k = 2
print(Solution().rotateRight(root, k))
================================================
FILE: Python/0062-unique-paths.py
================================================
# time complexity: O(m*n)
# space complexity: O(m*n)
from functools import lru_cache
from math import factorial
class Solution:
@lru_cache(None)
def uniquePaths(self, m: int, n: int) -> int:
if m == 1 or n == 1:
return 1
return self.uniquePaths(m-1, n) + self.uniquePaths(m, n-1)
class Solution:
def uniquePaths(self, r: int, c: int) -> int:
MOD = 10**9
dp = [[1] * (c + 1) for _ in range(r + 1)]
for i in range(1, r):
for j in range(1, c):
dp[i][j] = (dp[i-1][j] + dp[i][j-1]) % MOD
return dp[r-1][c-1]
# time complexity: O((m + n)(log(m + n) * log(log(m + n)) ^ 2))
# space complexity: O(1)
class Solution:
def uniquePaths(self, m: int, n: int) -> int:
return factorial(m + n - 2) // factorial(n - 1) // factorial(m - 1)
m = 3
n = 7
print(Solution().uniquePaths(m, n))
m = 3
n = 2
print(Solution().uniquePaths(m, n))
================================================
FILE: Python/0063-unique-paths-ii.py
================================================
# time complexity: O(m*n)
# space complexity: O(m*n)
from functools import lru_cache
from typing import List
class Solution:
def uniquePathsWithObstacles(self, obstacleGrid: List[List[int]]) -> int:
ROW = len(obstacleGrid)
COL = len(obstacleGrid[0])
@lru_cache(None)
def dp(r: int, c: int) -> int:
if r == ROW - 1 and c == COL - 1 and obstacleGrid[r][c] == 0:
return 1
if r >= ROW or c >= COL or obstacleGrid[r][c] == 1:
return 0
return dp(r+1, c) + dp(r, c+1)
return dp(0, 0)
# time complexity: O(m*n)
# space complexity: O(m*n)
class Solution:
def uniquePathsWithObstacles(self, obstacleGrid: List[List[int]]) -> int:
ROW, COL = len(obstacleGrid), len(obstacleGrid[0])
dp = [[0 for _ in range(COL)] for _ in range(ROW)]
if obstacleGrid[0][0]:
return 0
dp[0][0] = 1
for r in range(ROW):
for c in range(COL):
if obstacleGrid[r][c]:
dp[r][c] = 0
else:
if r > 0:
dp[r][c] += dp[r - 1][c]
if c > 0:
dp[r][c] += dp[r][c - 1]
return dp[ROW - 1][COL - 1]
obstacleGrid = [[0, 0, 0], [0, 1, 0], [0, 0, 0]]
print(Solution().uniquePathsWithObstacles(obstacleGrid))
obstacleGrid = [[0, 1], [0, 0]]
print(Solution().uniquePathsWithObstacles(obstacleGrid))
================================================
FILE: Python/0064-minimum-path-sum.py
================================================
# time complexity: O(mn)
# space complexity: O(1)
from typing import List
class Solution:
def minPathSum(self, grid: List[List[int]]) -> int:
ROW = len(grid)
COL = len(grid[0])
for r in range(1, ROW):
grid[r][0] += grid[r-1][0]
for c in range(1, COL):
grid[0][c] += grid[0][c-1]
for r in range(1, ROW):
for c in range(1, COL):
grid[r][c] += min(grid[r-1][c], grid[r][c-1])
return grid[ROW-1][COL-1]
# time complexity: O(mn)
# space complexity: O(mn)
class Solution:
def minPathSum(self, grid: List[List[int]]) -> int:
ROW = len(grid)
COL = len(grid[0])
dp = [[0 for _ in range(COL + 1)] for _ in range(ROW + 1)]
for r in range(1, ROW + 1):
for c in range(1, COL + 1):
if c == 1:
dp[r][c] = dp[r - 1][c] + grid[r - 1][c - 1]
elif r == 1:
dp[r][c] = dp[r][c - 1] + grid[r - 1][c - 1]
else:
dp[r][c] = min(dp[r][c - 1], dp[r - 1]
[c]) + grid[r - 1][c - 1]
return dp[ROW][COL]
grid = [[1, 3, 1], [1, 5, 1], [4, 2, 1]]
print(Solution().minPathSum(grid))
grid = [[1, 2, 3], [4, 5, 6]]
print(Solution().minPathSum(grid))
================================================
FILE: Python/0066-plus-one.py
================================================
from typing import List
class Solution:
def plusOne(self, digits: List[int]) -> List[int]:
convertNumber = int(''.join(str(item) for item in digits))+1
convertList = list(str(convertNumber))
return [int(i) for i in convertList]
digits = [9, 9, 9, 9]
print(Solution().plusOne(digits))
================================================
FILE: Python/0067-add-binary.py
================================================
class Solution:
def addBinary(self, a: str, b: str) -> str:
return bin(int(a, 2)+int(b, 2))[2:]
================================================
FILE: Python/0068-text-justification.py
================================================
# time complexity: O(n*k)
# space complexity: O(m)
from typing import List
class Solution:
def fullJustify(self, words: List[str], maxWidth: int) -> List[str]:
def getWords(i):
currentLine = []
currLength = 0
while i < len(words) and currLength + len(words[i]) <= maxWidth:
currentLine.append(words[i])
currLength += len(words[i]) + 1
i += 1
return currentLine
def createLine(line, i):
baseLength = -1
for word in line:
baseLength += len(word) + 1
extraSpaces = maxWidth - baseLength
if len(line) == 1 or i == len(words):
return " ".join(line) + " " * extraSpaces
wordCount = len(line) - 1
spacesPerWord = extraSpaces // wordCount
needsExtraSpace = extraSpaces % wordCount
for j in range(needsExtraSpace):
line[j] += " "
for j in range(wordCount):
line[j] += " " * spacesPerWord
return " ".join(line)
result = []
i = 0
while i < len(words):
currentLine = getWords(i)
i += len(currentLine)
result.append(createLine(currentLine, i))
return result
words = ["This", "is", "an", "example", "of", "text", "justification."]
maxWidth = 16
print(Solution().fullJustify(words, maxWidth))
words = ["What", "must", "be", "acknowledgment", "shall", "be"]
maxWidth = 16
print(Solution().fullJustify(words, maxWidth))
words = ["Science", "is", "what", "we", "understand", "well", "enough", "to",
"explain", "to", "a", "computer.", "Art", "is", "everything", "else", "we", "do"]
maxWidth = 20
print(Solution().fullJustify(words, maxWidth))
================================================
FILE: Python/0069-sqrtx.py
================================================
# time complexity: O(logN)
# space complexity: O(1)
class Solution:
def mySqrt(self, x: int) -> int:
if x < 2:
return x
left, right = 2, x//2
while left <= right:
pivot = left + (right - left) // 2
num = pivot * pivot
if num > x:
right = pivot - 1
elif num < x:
left = pivot + 1
else:
return pivot
return right
x = 8
print(Solution().mySqrt(x))
================================================
FILE: Python/0070-climbing-stairs.py
================================================
from functools import lru_cache
# time complexity: O(n)
# space complexity: O(n)
# Cashe with brute force
class Solution:
def climbStairs(self, n: int) -> int:
memo = [0] * (n+1)
return self.climb_Stairs(0, n, memo)
# time complexity: O(n)
# space complexity: O(n)
class Solution:
def climb_Stairs(self, i: int, n: int, memo: list) -> int:
if (i > n):
return 0
if (i == n):
return 1
if (memo[i]):
return memo[i]
memo[i] = self.climb_Stairs(i+1, n, memo) + \
self.climb_Stairs(i+2, n, memo)
return memo[i]
# time complexity: O(n)
# space complexity: O(b)
# Dynamic Programming
class Solution:
def climbStairs(self, n: int):
if n == 1:
return 1
dp = [0] * (n + 1)
dp[1] = 1
dp[2] = 2
for i in range(3, n+1):
dp[i] = dp[i-1] + dp[i-2]
return dp[n]
# time complexity: O(n)
# space complexity: O(1)
# Fibonacci Number
class Solution:
def climbStairs(self, n: int) -> int:
if n == 1:
return 1
first = 1
second = 2
third = 0
for i in range(3, n+1):
third = first + second
first = second
second = third
return second
class Solution:
@lru_cache(None)
def climbStairs(self, n: int) -> int:
if n == 1:
return 1
if n == 2:
return 2
return self.climbStairs(n-1) + self.climbStairs(n-2)
n = 50
print(Solution().climbStairs(50))
================================================
FILE: Python/0071-simplify-path.py
================================================
# time complexity: O(n)
# space complexity: O(n)
class Solution:
def simplifyPath(self, path: str) -> str:
stack = []
for item in path.split("/"):
if item:
if item == "..":
if stack:
stack.pop()
elif item == ".":
continue
else:
stack.append(item)
return "/" + "/".join(stack)
path = "/a/./b/../../c/"
print(Solution().simplifyPath(path))
================================================
FILE: Python/0072-edit-distance.py
================================================
# time complexity: O(m*n)
# space complexity: O(m*n)
from functools import lru_cache
class Solution:
def minDistance(self, word1: str, word2: str) -> int:
@lru_cache(None)
def minDisCal(w1: str, w2: str, w1Idx: int, w2Idx: int):
if w1Idx == 0:
return w2Idx
if w2Idx == 0:
return w1Idx
minEditDis = 0
if w1[w1Idx - 1] == w2[w2Idx - 1]:
minEditDis = minDisCal(w1, w2, w1Idx - 1, w2Idx - 1)
else:
insert = minDisCal(w1, w2, w1Idx, w2Idx - 1)
delete = minDisCal(w1, w2, w1Idx - 1, w2Idx)
replace = minDisCal(w1, w2, w1Idx - 1, w2Idx - 1)
minEditDis = (min(insert, delete, replace) + 1)
return minEditDis
return minDisCal(word1, word2, len(word1), len(word2))
class Solution:
def minDistance(self, word1: str, word2: str) -> int:
W1, W2 = len(word1), len(word2)
dp = [[w2 for w2 in range(w1, w1 + W2 + 1)] for w1 in range(W1 + 1)]
for w1 in range(1, W1 + 1):
for w2 in range(1, W2 + 1):
if word1[w1 - 1] == word2[w2 - 1]:
dp[w1][w2] = dp[w1-1][w2-1]
else:
dp[w1][w2] = min(dp[w1-1][w2], dp[w1]
[w2-1], dp[w1-1][w2-1]) + 1
return dp[W1][W2]
'''
a b c
<- w1
a b e
<- w2
'''
word1 = "horse"
word2 = "ros"
print(Solution().minDistance(word1, word2))
word1 = "intention"
word2 = "execution"
print(Solution().minDistance(word1, word2))
================================================
FILE: Python/0073-set-matrix-zeroes.py
================================================
# time complexity: O(m*n)
# space complexity: O(m+n)
from typing import List
class Solution:
def setZeroes(self, matrix: List[List[int]]) -> None:
rowSet, colSet = set(), set()
for r in range(len(matrix)):
for c in range(len(matrix[0])):
if matrix[r][c] == 0:
rowSet.add(r)
colSet.add(c)
for r in range(len(matrix)):
for c in range(len(matrix[0])):
if r in rowSet or c in colSet:
matrix[r][c] = 0
# time complexity: O(r*c)
# space complexity: O(1)
class Solution:
def setZeroes(self, matrix: List[List[int]]) -> None:
ROW = len(matrix)
COL = len(matrix[0])
firstRowZero = False
firstColZero = False
for c in range(COL):
if matrix[0][c] == 0:
firstRowZero = True
break
for r in range(ROW):
if matrix[r][0] == 0:
firstColZero = True
break
for r in range(1, ROW):
for c in range(1, COL):
if matrix[r][c] == 0:
matrix[r][0] = 0
matrix[0][c] = 0
for r in range(1, ROW):
if matrix[r][0] == 0:
for c in range(1, COL):
matrix[r][c] = 0
for c in range(1, COL):
if matrix[0][c] == 0:
for r in range(1, ROW):
matrix[r][c] = 0
if firstRowZero:
for c in range(COL):
matrix[0][c] = 0
if firstColZero:
for r in range(ROW):
matrix[r][0] = 0
return matrix
matrix = [[1, 1, 1], [1, 0, 1], [1, 1, 1]]
print(Solution().setZeroes(matrix))
matrix = [[0, 1, 2, 0], [3, 4, 5, 2], [1, 3, 1, 5]]
print(Solution().setZeroes(matrix))
================================================
FILE: Python/0074-search-a-2d-matrix.py
================================================
# time complexity: O(logmn)
# space complexity: O(1)
from typing import List
class Solution:
def searchMatrix(self, matrix: List[List[int]], target: int) -> bool:
ROW = len(matrix)
COL = len(matrix[0])
left = 0
right = ROW * COL - 1
if ROW == 0:
return False
while left <= right:
mid = left + (right - left) // 2
value = matrix[mid//COL][mid % COL]
if value < target:
left = mid + 1
elif value > target:
right = mid - 1
else:
return True
return False
'''
0 1 2 3 4 5 6 7 8
0 1 2
3 4 5
6 7 8
row = idx // COL
col = idx % COL
'''
matrix = [[1, 3, 5, 7], [10, 11, 16, 20], [23, 30, 34, 60]]
target = 3
print(Solution().searchMatrix(matrix, target))
matrix = [[1, 3, 5, 7], [10, 11, 16, 20], [23, 30, 34, 60]]
target = 13
print(Solution().searchMatrix(matrix, target))
================================================
FILE: Python/0075-sort-colors.py
================================================
# time complexity: O(n)
# space complexity: O(1)
from typing import List
class Solution:
def sortColors(self, nums: List[int]) -> None:
left = curr = 0
right = len(nums) - 1
while curr <= right:
if nums[curr] == 0:
nums[left], nums[curr] = nums[curr], nums[left]
left += 1
curr += 1
elif nums[curr] == 2:
nums[right], nums[curr] = nums[curr], nums[right]
right -= 1
else:
curr += 1
return nums
nums = [1, 2, 0]
print(Solution().sortColors(nums))
================================================
FILE: Python/0076-minimum-window-substring.py
================================================
# time complexity: O(len(s) + len(t))
# space complexity: O(len(s) + len(t))
from collections import defaultdict
class Solution:
def minWindow(self, s: str, t: str) -> str:
feqCount = defaultdict(int)
window = defaultdict(int)
result = [-1, -1]
resultLen = float('inf')
current = 0
for char in t:
feqCount[char] += 1
required = len(feqCount)
left = 0
for right in range(len(s)):
char = s[right]
if char in feqCount:
window[char] += 1
if window[char] == feqCount[char]:
current += 1
while current == required:
if (right - left + 1) < resultLen:
resultLen = right - left + 1
result = [left, right]
leftChar = s[left]
if leftChar in window:
window[leftChar] -= 1
if window[leftChar] < feqCount[leftChar]:
current -= 1
left += 1
return s[result[0]:result[1] + 1
Showing preview only (212K chars total). Download the full file or copy to clipboard to get everything.
gitextract_mc96q52d/ ├── .github/ │ ├── FUNDING.yml │ ├── scripts/ │ │ └── update_leetcode.cjs │ ├── test.txt │ └── workflows/ │ └── python-publish.yml ├── .vscode/ │ └── settings.json ├── C++/ │ ├── 0002-add-two-numbers.cpp │ ├── 0003-longest-substring-without-repeating-characters.cpp │ ├── 0009-palindrome-number.cpp │ ├── 0013-roman-to-integer.cpp │ ├── 0014-longest-common-prefix.cpp │ ├── 0015-3sum.cpp │ ├── 0019-remove-nth-node-from-end-of-list.cpp │ ├── 0020-valid-parentheses.cpp │ ├── 0021-merge-two-sorted-lists.cpp │ ├── 0035-search-insert-position.cpp │ ├── 0036-valid-sudoku.cpp │ ├── 0045-jump-game-ii.cpp │ ├── 0046-permutations.cpp │ ├── 0048-rotate-image.cpp │ ├── 0054-spiral-matrix.cpp │ ├── 0055-jump-game.cpp │ ├── 0056-merge-intervals.cpp │ ├── 0059-spiral-matrix-ii.cpp │ ├── 0070-climbing-stairs.cpp │ ├── 0074-search-a-2d-matrix.cpp │ ├── 0075-sort-colors.cpp │ ├── 0077-combinations.cpp │ ├── 0083-remove-duplicates-from-sorted-list.cpp │ ├── 0088-merge-sorted-array.cpp │ ├── 0094-binary-tree-inorder-traversal.cpp │ ├── 0098-validate-binary-search-tree.cpp │ ├── 0101-symmetric-tree.cpp │ ├── 0102-binary-tree-level-order-traversal.cpp │ ├── 0104-maximum-depth-of-binary-tree.cpp │ ├── 0112-path-sum.cpp │ ├── 0116-populating-next-right-pointers-in-each-node.cpp │ ├── 0118-pascals-triangle.cpp │ ├── 0119-pascals-triangle-ii.cpp │ ├── 0120-triangle.cpp │ ├── 0121-best-time-to-buy-and-sell-stock.cpp │ ├── 0136-single-number.cpp │ ├── 0141-linked-list-cycle.cpp │ ├── 0144-binary-tree-preorder-traversal.cpp │ ├── 0145-binary-tree-postorder-traversal.cpp │ ├── 0167-two-sum-ii-input-array-is-sorted.cpp │ ├── 0169-majority-element.cpp │ ├── 0189-rotate-array.cpp │ ├── 0190-reverse-bits.cpp │ ├── 0191-number-of-1-bits.cpp │ ├── 0198-house-robber.cpp │ ├── 0203-remove-linked-list-elements.cpp │ ├── 0206-reverse-linked-list.cpp │ ├── 0213-house-robber-ii.cpp │ ├── 0217-contains-duplicate.cpp │ ├── 0231-power-of-two.cpp │ ├── 0232-implement-queue-using-stacks.cpp │ ├── 0235-lowest-common-ancestor-of-a-binary-search-tree.cpp │ ├── 0242-valid-anagram.cpp │ ├── 0278-first-bad-version.cpp │ ├── 0283-move-zeroes.cpp │ ├── 0344-reverse-string.cpp │ ├── 0350-intersection-of-two-arrays-ii.cpp │ ├── 0383-ransom-note.cpp │ ├── 0387-first-unique-character-in-a-string.cpp │ ├── 0509-fibonacci-number.cpp │ ├── 0542-01-matrix.cpp │ ├── 0557-reverse-words-in-a-string-iii.cpp │ ├── 0566-reshape-the-matrix.cpp │ ├── 0567-permutation-in-string.cpp │ ├── 0617-merge-two-binary-trees.cpp │ ├── 0653-two-sum-iv-input-is-a-bst.cpp │ ├── 0695-max-area-of-island.cpp │ ├── 0700-search-in-a-binary-search-tree.cpp │ ├── 0701-insert-into-a-binary-search-tree.cpp │ ├── 0704-binary-search.cpp │ ├── 0706-design-hashmap.cpp │ ├── 0733-flood-fill.cpp │ ├── 0746-min-cost-climbing-stairs.cpp │ ├── 0784-letter-case-permutation.cpp │ ├── 0876-middle-of-the-linked-list.cpp │ ├── 0977-squares-of-a-sorted-array.cpp │ ├── 0994-rotting-oranges.cpp │ ├── 1137-n-th-tribonacci-number.cpp │ ├── 1265-print-immutable-linked-list-in-reverse.cpp │ └── 1920-build-array-from-permutation.cpp ├── CODE_OF_CONDUCT.md ├── JavaScript/ │ ├── 0020-valid-parentheses.js │ ├── 0021-merge-two-sorted-lists.js │ ├── 0049-group-anagrams.js │ ├── 0074-search-a-2d-matrix.js │ ├── 0078-subsets.js │ ├── 0094-binary-tree-inorder-traversal.js │ ├── 0100-same-tree.js │ ├── 0104-maximum-depth-of-binary-tree.js │ ├── 0121-best-time-to-buy-and-sell-stock.js │ ├── 0141-linked-list-cycle.js │ ├── 0144-binary-tree-preorder-traversal.js │ ├── 0145-binary-tree-postorder-traversal.js │ ├── 0153-find-minimum-in-rotated-sorted-array.js │ ├── 0206-reverse-linked-list.js │ ├── 0217-contains-duplicate.js │ ├── 0226-invert-binary-tree.js │ ├── 0242-valid-anagram.js │ ├── 0506-relative-ranks.js │ ├── 0572-subtree-of-another-tree.js │ ├── 0704-binary-search.js │ ├── 0994-rotting-oranges.js │ ├── 2619-array-prototype-last.js │ ├── 2620-counter.js │ ├── 2621-sleep.js │ ├── 2622-cache-with-time-limit.js │ ├── 2623-memoize.js │ ├── 2625-flatten-deeply-nested-array.js │ ├── 2626-array-reduce-transformation.js │ ├── 2627-debounce.js │ ├── 2628-json-deep-equal.js │ ├── 2629-function-composition.js │ ├── 2631-group-by.js │ ├── 2632-curry.js │ ├── 2633-convert-object-to-json-string.js │ ├── 2634-filter-elements-from-array.js │ ├── 2635-apply-transform-over-each-element-in-array.js │ ├── 2636-promise-pool.js │ ├── 2637-promise-time-limit.js │ ├── 2665-counter-ii.js │ ├── 2666-allow-one-function-call.js │ ├── 2667-create-hello-world-function.js │ ├── 2676-throttle.js │ ├── 2677-chunk-array.js │ ├── 2694-event-emitter.js │ ├── 2695-array-wrapper.js │ ├── 2703-return-length-of-arguments-passed.js │ ├── 2704-to-be-or-not-to-be.js │ ├── 2705-compact-object.js │ ├── 2715-execute-cancellable-function-with-delay.js │ ├── 2721-execute-asynchronous-functions-in-parallel.js │ ├── 2722-join-two-arrays-by-id.js │ ├── 2723-add-two-promises.js │ ├── 2724-sort-by.js │ ├── 2725-interval-cancellation.js │ ├── 2726-calculator-with-method-chaining.js │ └── 2727-is-object-empty.js ├── LICENSE ├── Python/ │ ├── 0001-two-sum.py │ ├── 0002-add-two-numbers.py │ ├── 0003-longest-substring-without-repeating-characters.py │ ├── 0004-median-of-two-sorted-arrays.py │ ├── 0005-longest-palindromic-substring.py │ ├── 0006-zigzag-conversion.py │ ├── 0007-reverse-integer.py │ ├── 0008-string-to-integer-atoi.py │ ├── 0010-regular-expression-matching.py │ ├── 0011-container-with-most-water.py │ ├── 0012-integer-to-roman.py │ ├── 0013-roman-to-integer.py │ ├── 0014-longest-common-prefix.py │ ├── 0015-3sum.py │ ├── 0016-3sum-closest.py │ ├── 0017-letter-combinations-of-a-phone-number.py │ ├── 0018-4sum.py │ ├── 0019-remove-nth-node-from-end-of-list.py │ ├── 0020-valid-parentheses.py │ ├── 0021-merge-two-sorted-lists.py │ ├── 0022-generate-parentheses.py │ ├── 0023-merge-k-sorted-lists.py │ ├── 0024-swap-nodes-in-pairs.py │ ├── 0025-reverse-nodes-in-k-group.py │ ├── 0026-remove-duplicates-from-sorted-array.py │ ├── 0027-remove-element.py │ ├── 0028-find-the-index-of-the-first-occurrence-in-a-string.py │ ├── 0029-divide-two-integers.py │ ├── 0030-substring-with-concatenation-of-all-words.py │ ├── 0031-next-permutation.py │ ├── 0032-longest-valid-parentheses.py │ ├── 0033-search-in-rotated-sorted-array.py │ ├── 0034-find-first-and-last-position-of-element-in-sorted-array.py │ ├── 0035-search-insert-position.py │ ├── 0036-valid-sudoku.py │ ├── 0037-sudoku-solver.py │ ├── 0038-count-and-say.py │ ├── 0039-combination-sum.py │ ├── 0040-combination-sum-ii.py │ ├── 0041-first-missing-positive.py │ ├── 0042-trapping-rain-water.py │ ├── 0043-multiply-strings.py │ ├── 0044-wildcard-matching.py │ ├── 0045-jump-game-ii.py │ ├── 0046-permutations.py │ ├── 0047-permutations-ii.py │ ├── 0048-rotate-image.py │ ├── 0049-group-anagrams.py │ ├── 0050-powx-n.py │ ├── 0051-n-queens.py │ ├── 0052-n-queens-ii.py │ ├── 0053-maximum-subarray.py │ ├── 0054-spiral-matrix.py │ ├── 0055-jump-game.py │ ├── 0056-merge-intervals.py │ ├── 0057-insert-interval.py │ ├── 0058-length-of-last-word.py │ ├── 0059-spiral-matrix-ii.py │ ├── 0061-rotate-list.py │ ├── 0062-unique-paths.py │ ├── 0063-unique-paths-ii.py │ ├── 0064-minimum-path-sum.py │ ├── 0066-plus-one.py │ ├── 0067-add-binary.py │ ├── 0068-text-justification.py │ ├── 0069-sqrtx.py │ ├── 0070-climbing-stairs.py │ ├── 0071-simplify-path.py │ ├── 0072-edit-distance.py │ ├── 0073-set-matrix-zeroes.py │ ├── 0074-search-a-2d-matrix.py │ ├── 0075-sort-colors.py │ ├── 0076-minimum-window-substring.py │ ├── 0077-combinations.py │ ├── 0078-subsets.py │ ├── 0079-word-search.py │ ├── 0080-remove-duplicates-from-sorted-array-ii.py │ ├── 0081-search-in-rotated-sorted-array-ii.py │ ├── 0082-remove-duplicates-from-sorted-list-ii.py │ ├── 0083-remove-duplicates-from-sorted-list.py │ ├── 0084-largest-rectangle-in-histogram.py │ ├── 0085-maximal-rectangle.py │ ├── 0086-partition-list.py │ ├── 0087-scramble-string.py │ ├── 0088-merge-sorted-array.py │ ├── 0089-gray-code.py │ ├── 0090-subsets-ii.py │ ├── 0091-decode-ways.py │ ├── 0092-reverse-linked-list-ii.py │ ├── 0093-restore-ip-addresses.py │ ├── 0095-unique-binary-search-trees-ii.py │ ├── 0096-unique-binary-search-trees.py │ ├── 0097-interleaving-string.py │ ├── 0098-validate-binary-search-tree.py │ ├── 0099-recover-binary-search-tree.py │ ├── 0100-same-tree.py │ ├── 0101-symmetric-tree.py │ ├── 0102-binary-tree-level-order-traversal.py │ ├── 0103-binary-tree-zigzag-level-order-traversal.py │ ├── 0104-maximum-depth-of-binary-tree.py │ ├── 0105-construct-binary-tree-from-preorder-and-inorder-traversal.py │ ├── 0106-construct-binary-tree-from-inorder-and-postorder-traversal.py │ ├── 0107-binary-tree-level-order-traversal-ii.py │ ├── 0108-convert-sorted-array-to-binary-search-tree.py │ ├── 0110-balanced-binary-tree.py │ ├── 0111-minimum-depth-of-binary-tree.py │ ├── 0112-path-sum.py │ ├── 0113-path-sum-ii.py │ ├── 0114-flatten-binary-tree-to-linked-list.py │ ├── 0115-distinct-subsequences.py │ ├── 0116-populating-next-right-pointers-in-each-node.py │ ├── 0117-populating-next-right-pointers-in-each-node-ii.py │ ├── 0118-pascals-triangle.py │ ├── 0119-pascals-triangle-ii.py │ ├── 0120-triangle.py │ ├── 0121-best-time-to-buy-and-sell-stock.py │ ├── 0122-best-time-to-buy-and-sell-stock-ii.py │ ├── 0123-best-time-to-buy-and-sell-stock-iii.py │ ├── 0124-binary-tree-maximum-path-sum.py │ ├── 0125-valid-palindrome.py │ ├── 0126-word-ladder-ii.py │ ├── 0127-word-ladder.py │ ├── 0128-longest-consecutive-sequence.py │ ├── 0129-sum-root-to-leaf-numbers.py │ ├── 0130-surrounded-regions.py │ ├── 0131-palindrome-partitioning.py │ ├── 0132-palindrome-partitioning-ii.py │ ├── 0133-clone-graph.py │ ├── 0134-gas-station.py │ ├── 0135-candy.py │ ├── 0136-single-number.py │ ├── 0137-single-number-ii.py │ ├── 0138-copy-list-with-random-pointer.py │ ├── 0139-word-break.py │ ├── 0140-word-break-ii.py │ ├── 0141-linked-list-cycle.py │ ├── 0142-linked-list-cycle-ii.py │ ├── 0143-reorder-list.py │ ├── 0145-binary-tree-postorder-traversal.py │ ├── 0146-lru-cache.py │ ├── 0148-sort-list.py │ ├── 0149-max-points-on-a-line.py │ ├── 0150-evaluate-reverse-polish-notation.py │ ├── 0151-reverse-words-in-a-string.py │ ├── 0152-maximum-product-subarray.py │ ├── 0153-find-minimum-in-rotated-sorted-array.py │ ├── 0155-min-stack.py │ ├── 0159-longest-substring-with-at-most-two-distinct-characters.py │ ├── 0160-intersection-of-two-linked-lists.py │ ├── 0162-find-peak-element.py │ ├── 0165-compare-version-numbers.py │ ├── 0166-fraction-to-recurring-decimal.py │ ├── 0167-two-sum-ii-input-array-is-sorted.py │ ├── 0168-excel-sheet-column-title.py │ ├── 0169-majority-element.py │ ├── 0170-two-sum-iii-data-structure-design.py │ ├── 0172-factorial-trailing-zeroes.py │ ├── 0173-binary-search-tree-iterator.py │ ├── 0179-largest-number.py │ ├── 0187-repeated-dna-sequences.py │ ├── 0188-best-time-to-buy-and-sell-stock-iv.py │ ├── 0190-reverse-bits.py │ ├── 0191-number-of-1-bits.py │ ├── 0198-house-robber.py │ ├── 0199-binary-tree-right-side-view.py │ ├── 0200-number-of-islands.py │ ├── 0201-bitwise-and-of-numbers-range.py │ ├── 0202-happy-number.py │ ├── 0203-remove-linked-list-elements.py │ ├── 0205-isomorphic-strings.py │ ├── 0206-reverse-linked-list.py │ ├── 0207-course-schedule.py │ ├── 0208-implement-trie-prefix-tree.py │ ├── 0209-minimum-size-subarray-sum.py │ ├── 0210-course-schedule-ii.py │ ├── 0211-design-add-and-search-words-data-structure.py │ ├── 0212-word-search-ii.py │ ├── 0213-house-robber-ii.py │ ├── 0214-shortest-palindrome.py │ ├── 0215-kth-largest-element-in-an-array.py │ ├── 0216-combination-sum-iii.py │ ├── 0217-contains-duplicate.py │ ├── 0218-the-skyline-problem.py │ ├── 0219-contains-duplicate-ii.py │ ├── 0221-maximal-square.py │ ├── 0222-count-complete-tree-nodes.py │ ├── 0224-basic-calculator.py │ ├── 0225-implement-stack-using-queues.py │ ├── 0226-invert-binary-tree.py │ ├── 0227-basic-calculator-ii.py │ ├── 0228-summary-ranges.py │ ├── 0229-majority-element-ii.py │ ├── 0230-kth-smallest-element-in-a-bst.py │ ├── 0231-power-of-two.py │ ├── 0232-implement-queue-using-stacks.py │ ├── 0234-palindrome-linked-list.py │ ├── 0235-lowest-common-ancestor-of-a-binary-search-tree.py │ ├── 0236-lowest-common-ancestor-of-a-binary-tree.py │ ├── 0237-delete-node-in-a-linked-list.py │ ├── 0238-product-of-array-except-self.py │ ├── 0239-sliding-window-maximum.py │ ├── 0240-search-a-2d-matrix-ii.py │ ├── 0241-different-ways-to-add-parentheses.py │ ├── 0242-valid-anagram.py │ ├── 0244-shortest-word-distance-ii.py │ ├── 0246-strobogrammatic-number.py │ ├── 0249-group-shifted-strings.py │ ├── 0250-count-univalue-subtrees.py │ ├── 0252-meeting-rooms.py │ ├── 0253-meeting-rooms-ii.py │ ├── 0254-factor-combinations.py │ ├── 0255-verify-preorder-sequence-in-binary-search-tree.py │ ├── 0256-paint-house.py │ ├── 0257-binary-tree-paths.py │ ├── 0259-3sum-smaller.py │ ├── 0260-single-number-iii.py │ ├── 0261-graph-valid-tree.py │ ├── 0263-ugly-number.py │ ├── 0264-ugly-number-ii.py │ ├── 0265-paint-house-ii.py │ ├── 0266-palindrome-permutation.py │ ├── 0268-missing-number.py │ ├── 0269-alien-dictionary.py │ ├── 0270-closest-binary-search-tree-value.py │ ├── 0271-encode-and-decode-strings.py │ ├── 0272-closest-binary-search-tree-value-ii.py │ ├── 0273-integer-to-english-words.py │ ├── 0274-h-index.py │ ├── 0276-paint-fence.py │ ├── 0277-find-the-celebrity.py │ ├── 0278-first-bad-version.py │ ├── 0279-perfect-squares.py │ ├── 0283-move-zeroes.py │ ├── 0285-inorder-successor-in-bst.py │ ├── 0286-walls-and-gates.py │ ├── 0287-find-the-duplicate-number.py │ ├── 0289-game-of-life.py │ ├── 0290-word-pattern.py │ ├── 0291-word-pattern-ii.py │ ├── 0293-flip-game.py │ ├── 0295-find-median-from-data-stream.py │ ├── 0296-best-meeting-point.py │ ├── 0297-serialize-and-deserialize-binary-tree.py │ ├── 0298-binary-tree-longest-consecutive-sequence.py │ ├── 0299-bulls-and-cows.py │ ├── 0300-longest-increasing-subsequence.py │ ├── 0301-remove-invalid-parentheses.py │ ├── 0302-smallest-rectangle-enclosing-black-pixels.py │ ├── 0303-range-sum-query-immutable.py │ ├── 0304-range-sum-query-2d-immutable.py │ ├── 0305-number-of-islands-ii.py │ ├── 0307-range-sum-query-mutable.py │ ├── 0309-best-time-to-buy-and-sell-stock-with-cooldown.py │ ├── 0310-minimum-height-trees.py │ ├── 0311-sparse-matrix-multiplication.py │ ├── 0312-burst-balloons.py │ ├── 0314-binary-tree-vertical-order-traversal.py │ ├── 0315-count-of-smaller-numbers-after-self.py │ ├── 0316-remove-duplicate-letters.py │ ├── 0317-shortest-distance-from-all-buildings.py │ ├── 0320-generalized-abbreviation.py │ ├── 0322-coin-change.py │ ├── 0323-number-of-connected-components-in-an-undirected-graph.py │ ├── 0325-maximum-size-subarray-sum-equals-k.py │ ├── 0326-power-of-three.py │ ├── 0327-count-of-range-sum.py │ ├── 0328-odd-even-linked-list.py │ ├── 0329-longest-increasing-path-in-a-matrix.py │ ├── 0330-patching-array.py │ ├── 0331-verify-preorder-serialization-of-a-binary-tree.py │ ├── 0332-reconstruct-itinerary.py │ ├── 0333-largest-bst-subtree.py │ ├── 0334-increasing-triplet-subsequence.py │ ├── 0337-house-robber-iii.py │ ├── 0338-counting-bits.py │ ├── 0339-nested-list-weight-sum.py │ ├── 0340-longest-substring-with-at-most-k-distinct-characters.py │ ├── 0341-flatten-nested-list-iterator.py │ ├── 0342-power-of-four.py │ ├── 0343-integer-break.py │ ├── 0344-reverse-string.py │ ├── 0345-reverse-vowels-of-a-string.py │ ├── 0346-moving-average-from-data-stream.py │ ├── 0347-top-k-frequent-elements.py │ ├── 0348-design-tic-tac-toe.py │ ├── 0349-intersection-of-two-arrays.py │ ├── 0350-intersection-of-two-arrays-ii.py │ ├── 0351-android-unlock-patterns.py │ ├── 0352-data-stream-as-disjoint-intervals.py │ ├── 0353-domino-and-tromino-tiling.py │ ├── 0354-russian-doll-envelopes.py │ ├── 0355-design-twitter.py │ ├── 0358-rearrange-string-k-distance-apart.py │ ├── 0359-logger-rate-limiter.py │ ├── 0361-bomb-enemy.py │ ├── 0362-design-hit-counter.py │ ├── 0364-nested-list-weight-sum-ii.py │ ├── 0366-find-leaves-of-binary-tree.py │ ├── 0368-largest-divisible-subset.py │ ├── 0370-range-addition.py │ ├── 0371-sum-of-two-integers.py │ ├── 0373-find-k-pairs-with-smallest-sums.py │ ├── 0374-guess-number-higher-or-lower.py │ ├── 0377-combination-sum-iv.py │ ├── 0378-kth-smallest-element-in-a-sorted-matrix.py │ ├── 0380-insert-delete-getrandom-o1.py │ ├── 0383-ransom-note.py │ ├── 0386-lexicographical-numbers.py │ ├── 0387-first-unique-character-in-a-string.py │ ├── 0388-longest-absolute-file-path.py │ ├── 0389-find-the-difference.py │ ├── 0390-elimination-game.py │ ├── 0391-perfect-rectangle.py │ ├── 0392-is-subsequence.py │ ├── 0393-utf-8-validation.py │ ├── 0394-decode-string.py │ ├── 0395-longest-substring-with-at-least-k-repeating-characters.py │ ├── 0396-rotate-function.py │ ├── 0397-integer-replacement.py │ ├── 0398-random-pick-index.py │ ├── 0399-evaluate-division.py │ ├── 0400-nth-digit.py │ ├── 0401-binary-watch.py │ ├── 0402-remove-k-digits.py │ ├── 0403-frog-jump.py │ ├── 0404-sum-of-left-leaves.py │ ├── 0405-convert-a-number-to-hexadecimal.py │ ├── 0406-queue-reconstruction-by-height.py │ ├── 0407-trapping-rain-water-ii.py │ ├── 0408-valid-word-abbreviation.py │ ├── 0409-longest-palindrome.py │ ├── 0410-split-array-largest-sum.py │ ├── 0414-third-maximum-number.py │ ├── 0416-partition-equal-subset-sum.py │ ├── 0417-pacific-atlantic-water-flow.py │ ├── 0424-longest-repeating-character-replacement.py │ ├── 0425-word-squares.py │ ├── 0426-convert-binary-search-tree-to-sorted-doubly-linked-list.py │ ├── 0427-construct-quad-tree.py │ ├── 0432-all-oone-data-structure.py │ ├── 0433-minimum-genetic-mutation.py │ ├── 0435-non-overlapping-intervals.py │ ├── 0436-find-right-interval.py │ ├── 0437-path-sum-iii.py │ ├── 0438-find-all-anagrams-in-a-string.py │ ├── 0439-ternary-expression-parser.py │ ├── 0440-k-th-smallest-in-lexicographical-order.py │ ├── 0442-find-all-duplicates-in-an-array.py │ ├── 0443-string-compression.py │ ├── 0444-sequence-reconstruction.py │ ├── 0445-add-two-numbers-ii.py │ ├── 0446-arithmetic-slices-ii-subsequence.py │ ├── 0448-find-all-numbers-disappeared-in-an-array.py │ ├── 0449-serialize-and-deserialize-bst.py │ ├── 0450-delete-node-in-a-bst.py │ ├── 0451-sort-characters-by-frequency.py │ ├── 0452-minimum-number-of-arrows-to-burst-balloons.py │ ├── 0455-assign-cookies.py │ ├── 0456-132-pattern.py │ ├── 0457-circular-array-loop.py │ ├── 0458-poor-pigs.py │ ├── 0459-repeated-substring-pattern.py │ ├── 0460-lfu-cache.py │ ├── 0463-island-perimeter.py │ ├── 0465-optimal-account-balancing.py │ ├── 0473-matchsticks-to-square.py │ ├── 0474-ones-and-zeroes.py │ ├── 0475-heaters.py │ ├── 0476-number-complement.py │ ├── 0485-max-consecutive-ones.py │ ├── 0486-predict-the-winner.py │ ├── 0487-max-consecutive-ones-ii.py │ ├── 0489-robot-room-cleaner.py │ ├── 0490-the-maze.py │ ├── 0491-non-decreasing-subsequences.py │ ├── 0493-reverse-pairs.py │ ├── 0494-target-sum.py │ ├── 0496-next-greater-element-i.py │ ├── 0498-diagonal-traverse.py │ ├── 0499-the-maze-iii.py │ ├── 0501-find-mode-in-binary-search-tree.py │ ├── 0502-ipo.py │ ├── 0505-the-maze-ii.py │ ├── 0506-relative-ranks.py │ ├── 0509-fibonacci-number.py │ ├── 0510-inorder-successor-in-bst-ii.py │ ├── 0513-find-bottom-left-tree-value.py │ ├── 0514-freedom-trail.py │ ├── 0515-find-largest-value-in-each-tree-row.py │ ├── 0516-longest-palindromic-subsequence.py │ ├── 0518-coin-change-ii.py │ ├── 0523-continuous-subarray-sum.py │ ├── 0525-contiguous-array.py │ ├── 0527-word-abbreviation.py │ ├── 0528-random-pick-with-weight.py │ ├── 0530-minimum-absolute-difference-in-bst.py │ ├── 0532-k-diff-pairs-in-an-array.py │ ├── 0539-minimum-time-difference.py │ ├── 0540-single-element-in-a-sorted-array.py │ ├── 0542-01-matrix.py │ ├── 0543-diameter-of-binary-tree.py │ ├── 0545-boundary-of-binary-tree.py │ ├── 0547-number-of-provinces.py │ ├── 0549-binary-tree-longest-consecutive-sequence-ii.py │ ├── 0552-student-attendance-record-ii.py │ ├── 0560-subarray-sum-equals-k.py │ ├── 0561-array-partition.py │ ├── 0564-find-the-closest-palindrome.py │ ├── 0567-permutation-in-string.py │ ├── 0572-subtree-of-another-tree.py │ ├── 0573-squirrel-simulation.py │ ├── 0576-out-of-boundary-paths.py │ ├── 0588-design-in-memory-file-system.py │ ├── 0590-n-ary-tree-postorder-traversal.py │ ├── 0592-fraction-addition-and-subtraction.py │ ├── 0594-longest-harmonious-subsequence.py │ ├── 0605-can-place-flowers.py │ ├── 0606-construct-string-from-binary-tree.py │ ├── 0609-find-duplicate-file-in-system.py │ ├── 0611-valid-triangle-number.py │ ├── 0616-add-bold-tag-in-string.py │ ├── 0621-task-scheduler.py │ ├── 0623-add-one-row-to-tree.py │ ├── 0624-maximum-distance-in-arrays.py │ ├── 0629-k-inverse-pairs-array.py │ ├── 0632-smallest-range-covering-elements-from-k-lists.py │ ├── 0633-sum-of-square-numbers.py │ ├── 0636-exclusive-time-of-functions.py │ ├── 0637-average-of-levels-in-binary-tree.py │ ├── 0641-design-circular-deque.py │ ├── 0643-maximum-average-subarray-i.py │ ├── 0645-set-mismatch.py │ ├── 0646-maximum-length-of-pair-chain.py │ ├── 0647-palindromic-substrings.py │ ├── 0648-replace-words.py │ ├── 0649-dota2-senate.py │ ├── 0650-2-keys-keyboard.py │ ├── 0653-two-sum-iv-input-is-a-bst.py │ ├── 0656-coin-path.py │ ├── 0658-find-k-closest-elements.py │ ├── 0661-image-smoother.py │ ├── 0662-maximum-width-of-binary-tree.py │ ├── 0663-equal-tree-partition.py │ ├── 0664-strange-printer.py │ ├── 0666-path-sum-iv.py │ ├── 0670-maximum-swap.py │ ├── 0677-map-sum-pairs.py │ ├── 0678-valid-parenthesis-string.py │ ├── 0679-24-game.py │ ├── 0680-valid-palindrome-ii.py │ ├── 0683-k-empty-slots.py │ ├── 0684-redundant-connection.py │ ├── 0689-maximum-sum-of-3-non-overlapping-subarrays.py │ ├── 0692-top-k-frequent-words.py │ ├── 0694-number-of-distinct-islands.py │ ├── 0695-max-area-of-island.py │ ├── 0702-search-in-a-sorted-array-of-unknown-size.py │ ├── 0703-kth-largest-element-in-a-stream.py │ ├── 0704-binary-search.py │ ├── 0705-design-hashset.py │ ├── 0706-design-hashmap.py │ ├── 0712-minimum-ascii-delete-sum-for-two-strings.py │ ├── 0713-subarray-product-less-than-k.py │ ├── 0714-best-time-to-buy-and-sell-stock-with-transaction-fee.py │ ├── 0715-range-module.py │ ├── 0716-max-stack.py │ ├── 0717-1-bit-and-2-bit-characters.py │ ├── 0718-maximum-length-of-repeated-subarray.py │ ├── 0719-find-k-th-smallest-pair-distance.py │ ├── 0721-accounts-merge.py │ ├── 0723-candy-crush.py │ ├── 0724-find-pivot-index.py │ ├── 0725-split-linked-list-in-parts.py │ ├── 0726-number-of-atoms.py │ ├── 0727-minimum-window-subsequence.py │ ├── 0729-my-calendar-i.py │ ├── 0731-my-calendar-ii.py │ ├── 0733-flood-fill.py │ ├── 0734-sentence-similarity.py │ ├── 0735-asteroid-collision.py │ ├── 0737-sentence-similarity-ii.py │ ├── 0739-daily-temperatures.py │ ├── 0740-delete-and-earn.py │ ├── 0741-cherry-pickup.py │ ├── 0743-network-delay-time.py │ ├── 0744-find-smallest-letter-greater-than-target.py │ ├── 0746-min-cost-climbing-stairs.py │ ├── 0752-open-the-lock.py │ ├── 0756-pyramid-transition-matrix.py │ ├── 0757-set-intersection-size-at-least-two.py │ ├── 0758-bold-words-in-string.py │ ├── 0759-employee-free-time.py │ ├── 0763-partition-labels.py │ ├── 0767-reorganize-string.py │ ├── 0768-partition-labels.py │ ├── 0769-max-chunks-to-make-sorted.py │ ├── 0773-sliding-puzzle.py │ ├── 0774-minimize-max-distance-to-gas-station.py │ ├── 0775-global-and-local-inversions.py │ ├── 0776-split-bst.py │ ├── 0778-swim-in-rising-water.py │ ├── 0779-k-th-symbol-in-grammar.py │ ├── 0781-rabbits-in-forest.py │ ├── 0786-k-th-smallest-prime-fraction.py │ ├── 0787-cheapest-flights-within-k-stops.py │ ├── 0790-domino-and-tromino-tiling.py │ ├── 0791-custom-sort-string.py │ ├── 0794-valid-tic-tac-toe-state.py │ ├── 0796-rotate-string.py │ ├── 0797-all-paths-from-source-to-target.py │ ├── 0799-champagne-tower.py │ ├── 0802-find-eventual-safe-states.py │ ├── 0807-max-increase-to-keep-city-skyline.py │ ├── 0808-soup-servings.py │ ├── 0812-largest-triangle-area.py │ ├── 0814-binary-tree-pruning.py │ ├── 0815-bus-routes.py │ ├── 0817-linked-list-components.py │ ├── 0823-binary-trees-with-factors.py │ ├── 0826-most-profit-assigning-work.py │ ├── 0827-making-a-large-island.py │ ├── 0831-masking-personal-information.py │ ├── 0832-flipping-an-image.py │ ├── 0833-find-and-replace-in-string.py │ ├── 0834-sum-of-distances-in-tree.py │ ├── 0837-new-21-game.py │ ├── 0838-push-dominoes.py │ ├── 0840-magic-squares-in-grid.py │ ├── 0841-keys-and-rooms.py │ ├── 0844-backspace-string-compare.py │ ├── 0845-longest-mountain-in-array.py │ ├── 0846-hand-of-straights.py │ ├── 0847-shortest-path-visiting-all-nodes.py │ ├── 0849-maximize-distance-to-closest-person.py │ ├── 0851-loud-and-rich.py │ ├── 0852-peak-index-in-a-mountain-array.py │ ├── 0853-car-fleet.py │ ├── 0856-score-of-parentheses.py │ ├── 0857-minimum-cost-to-hire-k-workers.py │ ├── 0860-lemonade-change.py │ ├── 0861-score-after-flipping-matrix.py │ ├── 0862-shortest-subarray-with-sum-at-least-k.py │ ├── 0863-all-nodes-distance-k-in-binary-tree.py │ ├── 0865-smallest-subtree-with-all-the-deepest-nodes.py │ ├── 0867-transpose-matrix.py │ ├── 0869-reordered-power-of-2.py │ ├── 0871-minimum-number-of-refueling-stops.py │ ├── 0872-leaf-similar-trees.py │ ├── 0873-length-of-longest-fibonacci-subsequence.py │ ├── 0874-walking-robot-simulation.py │ ├── 0875-koko-eating-bananas.py │ ├── 0876-middle-of-the-linked-list.py │ ├── 0880-decoded-string-at-index.py │ ├── 0881-boats-to-save-people.py │ ├── 0884-uncommon-words-from-two-sentences.py │ ├── 0885-spiral-matrix-iii.py │ ├── 0888-fair-candy-swap.py │ ├── 0889-construct-binary-tree-from-preorder-and-postorder-traversal.py │ ├── 0890-find-and-replace-pattern.py │ ├── 0894-all-possible-full-binary-trees.py │ ├── 0895-maximum-frequency-stack.py │ ├── 0896-monotonic-array.py │ ├── 0898-bitwise-ors-of-subarrays.py │ ├── 0900-rle-iterator.py │ ├── 0901-online-stock-span.py │ ├── 0904-fruit-into-baskets.py │ ├── 0905-sort-array-by-parity.py │ ├── 0907-koko-eating-bananas.py │ ├── 0907-sum-of-subarray-minimums.py │ ├── 0909-snakes-and-ladders.py │ ├── 0912-sort-an-array.py │ ├── 0915-partition-array-into-disjoint-intervals.py │ ├── 0916-word-subsets.py │ ├── 0918-maximum-sum-circular-subarray.py │ ├── 0920-number-of-music-playlists.py │ ├── 0921-minimum-add-to-make-parentheses-valid.py │ ├── 0924-minimize-malware-spread.py │ ├── 0930-binary-subarrays-with-sum.py │ ├── 0931-minimum-falling-path-sum.py │ ├── 0933-number-of-recent-calls.py │ ├── 0934-shortest-bridge.py │ ├── 0935-knight-dialer.py │ ├── 0938-range-sum-of-bst.py │ ├── 0939-minimum-area-rectangle.py │ ├── 0941-valid-mountain-array.py │ ├── 0944-delete-columns-to-make-sorted.py │ ├── 0945-minimum-increment-to-make-array-unique.py │ ├── 0946-validate-stack-sequences.py │ ├── 0947-most-stones-removed-with-same-row-or-column.py │ ├── 0948-bag-of-tokens.py │ ├── 0949-largest-time-for-given-digits.py │ ├── 0950-reveal-cards-in-increasing-order.py │ ├── 0951-flip-equivalent-binary-trees.py │ ├── 0953-verifying-an-alien-dictionary.py │ ├── 0954-array-of-doubled-pairs.py │ ├── 0955-delete-columns-to-make-sorted-ii.py │ ├── 0958-check-completeness-of-a-binary-tree.py │ ├── 0959-regions-cut-by-slashes.py │ ├── 0960-delete-columns-to-make-sorted-iii.py │ ├── 0961-n-repeated-element-in-size-2n-array.py │ ├── 0962-maximum-width-ramp.py │ ├── 0966-vowel-spellchecker.py │ ├── 0967-numbers-with-same-consecutive-differences.py │ ├── 0969-pancake-sorting.py │ ├── 0973-k-closest-points-to-origin.py │ ├── 0974-subarray-sums-divisible-by-k.py │ ├── 0976-largest-perimeter-triangle.py │ ├── 0977-squares-of-a-sorted-array.py │ ├── 0978-longest-turbulent-subarray.py │ ├── 0979-distribute-coins-in-binary-tree.py │ ├── 0981-time-based-key-value-store.py │ ├── 0983-minimum-cost-for-tickets.py │ ├── 0984-string-without-aaa-or-bbb.py │ ├── 0986-interval-list-intersections.py │ ├── 0987-vertical-order-traversal-of-a-binary-tree.py │ ├── 0988-smallest-string-starting-from-leaf.py │ ├── 0992-subarrays-with-k-different-integers.py │ ├── 0993-cousins-in-binary-tree.py │ ├── 0994-rotting-oranges.py │ ├── 0995-minimum-number-of-k-consecutive-bit-flips.py │ ├── 0997-find-the-town-judge.py │ ├── 0998-maximum-binary-tree-ii.py │ ├── 1002-find-common-characters.py │ ├── 1003-check-if-word-is-valid-after-substitutions.py │ ├── 1004-max-consecutive-ones-iii.py │ ├── 1006-clumsy-factorial.py │ ├── 1007-minimum-domino-rotations-for-equal-row.py │ ├── 1008-construct-binary-search-tree-from-preorder-traversal.py │ ├── 1009-complement-of-base-10-integer.py │ ├── 1010-pairs-of-songs-with-total-durations-divisible-by-60.py │ ├── 1011-capacity-to-ship-packages-within-d-days.py │ ├── 1014-best-sightseeing-pair.py │ ├── 1015-smallest-integer-divisible-by-k.py │ ├── 1018-binary-prefix-divisible-by-5.py │ ├── 1019-next-greater-node-in-linked-list.py │ ├── 1023-camelcase-matching.py │ ├── 1026-maximum-difference-between-node-and-ancestor.py │ ├── 1028-recover-a-tree-from-preorder-traversal.py │ ├── 1029-two-city-scheduling.py │ ├── 1033-moving-stones-until-consecutive.py │ ├── 1038-binary-search-tree-to-greater-sum-tree.py │ ├── 1039-minimum-score-triangulation-of-polygon.py │ ├── 1041-robot-bounded-in-circle.py │ ├── 1043-partition-array-for-maximum-sum.py │ ├── 1046-last-stone-weight.py │ ├── 1047-remove-all-adjacent-duplicates-in-string.py │ ├── 1048-longest-string-chain.py │ ├── 1051-height-checker.py │ ├── 1052-grumpy-bookstore-owner.py │ ├── 1055-shortest-way-to-form-string.py │ ├── 1057-campus-bikes.py │ ├── 1060-missing-element-in-sorted-array.py │ ├── 1061-lexicographically-smallest-equivalent-string.py │ ├── 1062-longest-repeating-substring.py │ ├── 1063-number-of-valid-subarrays.py │ ├── 1065-index-pairs-of-a-string.py │ ├── 1066-campus-bikes-ii.py │ ├── 1071-greatest-common-divisor-of-strings.py │ ├── 1072-flip-columns-for-maximum-number-of-equal-rows.py │ ├── 1074-number-of-submatrices-that-sum-to-target.py │ ├── 1079-letter-tile-possibilities.py │ ├── 1081-smallest-subsequence-of-distinct-characters.py │ ├── 1086-high-five.py │ ├── 1087-brace-expansion.py │ ├── 1090-largest-values-from-labels.py │ ├── 1091-shortest-path-in-binary-matrix.py │ ├── 1092-shortest-common-supersequence.py │ ├── 1093-statistics-from-a-large-sample.py │ ├── 1094-car-pooling.py │ ├── 1095-find-in-mountain-array.py │ ├── 1097-stream-of-characters.py │ ├── 1099-two-sum-less-than-k.py │ ├── 1100-find-k-length-substrings-with-no-repeated-characters.py │ ├── 1101-the-earliest-moment-when-everyone-become-friends.py │ ├── 1104-path-in-zigzag-labelled-binary-tree.py │ ├── 1105-filling-bookcase-shelves.py │ ├── 1106-parsing-a-boolean-expression.py │ ├── 1109-corporate-flight-bookings.py │ ├── 1110-delete-nodes-and-return-forest.py │ ├── 1119-remove-vowels-from-a-string.py │ ├── 1120-maximum-average-subtree.py │ ├── 1121-divide-array-into-increasing-sequences.py │ ├── 1122-relative-sort-array.py │ ├── 1123-lowest-common-ancestor-of-deepest-leaves.py │ ├── 1128-number-of-equivalent-domino-pairs.py │ ├── 1133-largest-unique-number.py │ ├── 1135-connecting-cities-with-minimum-cost.py │ ├── 1136-parallel-courses.py │ ├── 1137-n-th-tribonacci-number.py │ ├── 1138-alphabet-board-path.py │ ├── 1140-stone-game-ii.py │ ├── 1143-longest-common-subsequence.py │ ├── 1144-decrease-elements-to-make-array-zigzag.py │ ├── 1146-snapshot-array.py │ ├── 1150-check-if-a-number-is-majority-element-in-a-sorted-array.py │ ├── 1151-minimum-swaps-to-group-all-1s-together.py │ ├── 1152-analyze-user-website-visit-pattern.py │ ├── 1155-number-of-dice-rolls-with-target-sum.py │ ├── 1160-find-words-that-can-be-formed-by-characters.py │ ├── 1161-maximum-level-sum-of-a-binary-tree.py │ ├── 1165-single-row-keyboard.py │ ├── 1166-design-file-system.py │ ├── 1167-minimum-cost-to-connect-sticks.py │ ├── 1168-optimize-water-distribution-in-a-village.py │ ├── 1170-compare-strings-by-frequency-of-the-smallest-character.py │ ├── 1171-remove-zero-sum-consecutive-nodes-from-linked-list.py │ ├── 1176-diet-plan-performance.py │ ├── 1181-before-and-after-puzzle.py │ ├── 1182-shortest-distance-to-target-color.py │ ├── 1183-maximum-number-of-ones.py │ ├── 1190-reverse-substrings-between-each-pair-of-parentheses.py │ ├── 1192-critical-connections-in-a-network.py │ ├── 1197-minimum-knight-moves.py │ ├── 1198-find-smallest-common-element-in-all-rows.py │ ├── 1199-minimum-time-to-build-blocks.py │ ├── 1200-minimum-absolute-difference.py │ ├── 1202-smallest-string-with-swaps.py │ ├── 1203-sort-items-by-groups-respecting-dependencies.py │ ├── 1207-unique-number-of-occurrences.py │ ├── 1208-get-equal-substrings-within-budget.py │ ├── 1209-remove-all-adjacent-duplicates-in-string-ii.py │ ├── 1213-intersection-of-three-sorted-arrays.py │ ├── 1214-two-sum-bsts.py │ ├── 1216-valid-palindrome-iii.py │ ├── 1219-path-with-maximum-gold.py │ ├── 1220-count-vowels-permutation.py │ ├── 1222-queens-that-can-attack-the-king.py │ ├── 1229-meeting-scheduler.py │ ├── 1230-toss-strange-coins.py │ ├── 1233-remove-sub-folders-from-the-filesystem.py │ ├── 1235-maximum-profit-in-job-scheduling.py │ ├── 1239-maximum-length-of-a-concatenated-string-with-unique-characters.py │ ├── 1244-design-a-leaderboard.py │ ├── 1245-tree-diameter.py │ ├── 1248-count-number-of-nice-subarrays.py │ ├── 1249-minimum-remove-to-make-valid-parentheses.py │ ├── 1253-reconstruct-a-2-row-binary-matrix.py │ ├── 1254-number-of-closed-islands.py │ ├── 1255-maximum-score-words-formed-by-letters.py │ ├── 1256-encode-number.py │ ├── 1257-smallest-common-region.py │ ├── 1261-find-elements-in-a-contaminated-binary-tree.py │ ├── 1262-greatest-sum-divisible-by-three.py │ ├── 1266-minimum-time-visiting-all-points.py │ ├── 1267-count-servers-that-communicate.py │ ├── 1268-search-suggestions-system.py │ ├── 1269-number-of-ways-to-stay-in-the-same-place-after-some-steps.py │ ├── 1272-remove-interval.py │ ├── 1276-number-of-burgers-with-no-waste-of-ingredients.py │ ├── 1277-count-square-submatrices-with-all-ones.py │ ├── 1282-group-the-people-given-the-group-size-they-belong-to.py │ ├── 1283-find-the-smallest-divisor-given-a-threshold.py │ ├── 1287-element-appearing-more-than-25-in-sorted-array.py │ ├── 1288-remove-covered-intervals.py │ ├── 1289-minimum-falling-path-sum-ii.py │ ├── 1290-convert-binary-number-in-a-linked-list-to-integer.py │ ├── 1291-sequential-digits.py │ ├── 1292-maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold.py │ ├── 1295-find-numbers-with-even-number-of-digits.py │ ├── 1296-divide-array-in-sets-of-k-consecutive-numbers.py │ ├── 1298-maximum-candies-you-can-get-from-boxes.py │ ├── 1300-sum-of-mutated-array-closest-to-target.py │ ├── 1302-deepest-leaves-sum.py │ ├── 1304-find-n-unique-integers-sum-up-to-zero.py │ ├── 1305-all-elements-in-two-binary-search-trees.py │ ├── 1306-jump-game-iii.py │ ├── 1310-xor-queries-of-a-subarray.py │ ├── 1314-matrix-block-sum.py │ ├── 1315-sum-of-nodes-with-even-valued-grandparent.py │ ├── 1317-convert-integer-to-the-sum-of-two-no-zero-integers.py │ ├── 1318-minimum-flips-to-make-a-or-b-equal-to-c.py │ ├── 1323-maximum-69-number.py │ ├── 1324-print-words-vertically.py │ ├── 1325-delete-leaves-with-a-given-value.py │ ├── 1326-minimum-number-of-taps-to-open-to-water-a-garden.py │ ├── 1328-break-a-palindrome.py │ ├── 1329-sort-the-matrix-diagonally.py │ ├── 1331-rank-transform-of-an-array.py │ ├── 1333-filter-restaurants-by-vegan-friendly-price-and-distance.py │ ├── 1334-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance.py │ ├── 1335-minimum-difficulty-of-a-job-schedule.py │ ├── 1337-the-k-weakest-rows-in-a-matrix.py │ ├── 1338-reduce-array-size-to-the-half.py │ ├── 1339-maximum-product-of-splitted-binary-tree.py │ ├── 1343-number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold.py │ ├── 1344-angle-between-hands-of-a-clock.py │ ├── 1346-check-if-n-and-its-double-exist.py │ ├── 1347-minimum-number-of-steps-to-make-two-strings-anagram.py │ ├── 1351-count-negative-numbers-in-a-sorted-matrix.py │ ├── 1352-product-of-the-last-k-numbers.py │ ├── 1353-maximum-number-of-events-that-can-be-attended.py │ ├── 1356-sort-integers-by-the-number-of-1-bits.py │ ├── 1357-apply-discount-every-n-orders.py │ ├── 1358-number-of-substrings-containing-all-three-characters.py │ ├── 1359-count-all-valid-pickup-and-delivery-options.py │ ├── 1360-number-of-days-between-two-dates.py │ ├── 1361-validate-binary-tree-nodes.py │ ├── 1362-closest-divisors.py │ ├── 1365-how-many-numbers-are-smaller-than-the-current-number.py │ ├── 1366-rank-teams-by-votes.py │ ├── 1367-linked-list-in-binary-tree.py │ ├── 1368-minimum-cost-to-make-at-least-one-valid-path-in-a-grid.py │ ├── 1371-find-the-longest-substring-containing-vowels-in-even-counts.py │ ├── 1372-longest-zigzag-path-in-a-binary-tree.py │ ├── 1375-number-of-times-binary-string-is-prefix-aligned.py │ ├── 1376-time-needed-to-inform-all-employees.py │ ├── 1380-lucky-numbers-in-a-matrix.py │ ├── 1381-design-a-stack-with-increment-operation.py │ ├── 1382-balance-a-binary-search-tree.py │ ├── 1385-find-the-distance-value-between-two-arrays.py │ ├── 1387-sort-integers-by-the-power-value.py │ ├── 1390-four-divisors.py │ ├── 1394-find-lucky-integer-in-an-array.py │ ├── 1395-count-number-of-teams.py │ ├── 1396-design-underground-system.py │ ├── 1399-count-largest-group.py │ ├── 1400-construct-k-palindrome-strings.py │ ├── 1404-number-of-steps-to-reduce-a-number-in-binary-representation-to-one.py │ ├── 1405-longest-happy-string.py │ ├── 1408-string-matching-in-an-array.py │ ├── 1409-queries-on-a-permutation-with-key.py │ ├── 1410-html-entity-parser.py │ ├── 1411-number-of-ways-to-paint-n-3-grid.py │ ├── 1414-find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k.py │ ├── 1415-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n.py │ ├── 1418-display-table-of-food-orders-in-a-restaurant.py │ ├── 1420-build-array-where-you-can-find-the-maximum-exactly-k-comparisons.py │ ├── 1422-maximum-score-after-splitting-a-string.py │ ├── 1423-maximum-points-you-can-obtain-from-cards.py │ ├── 1424-diagonal-traverse-ii.py │ ├── 1425-constrained-subsequence-sum.py │ ├── 1427-perform-string-shifts.py │ ├── 1428-leftmost-column-with-at-least-a-one.py │ ├── 1429-first-unique-number.py │ ├── 1431-kids-with-the-greatest-number-of-candies.py │ ├── 1432-max-difference-you-can-get-from-changing-an-integer.py │ ├── 1433-check-if-a-string-can-break-another-string.py │ ├── 1436-destination-city.py │ ├── 1437-check-if-all-1s-are-at-least-length-k-places-away.py │ ├── 1438-longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit.py │ ├── 1441-build-an-array-with-stack-operations.py │ ├── 1442-count-triplets-that-can-form-two-arrays-of-equal-xor.py │ ├── 1447-simplified-fractions.py │ ├── 1448-count-good-nodes-in-binary-tree.py │ ├── 1451-rearrange-words-in-a-sentence.py │ ├── 1452-people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list.py │ ├── 1455-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence.py │ ├── 1456-maximum-number-of-vowels-in-a-substring-of-given-length.py │ ├── 1457-pseudo-palindromic-paths-in-a-binary-tree.py │ ├── 1458-max-dot-product-of-two-subsequences.py │ ├── 1460-make-two-arrays-equal-by-reversing-subarrays.py │ ├── 1461-check-if-a-string-contains-all-binary-codes-of-size-k.py │ ├── 1462-course-schedule-iv.py │ ├── 1463-cherry-pickup-ii.py │ ├── 1464-maximum-product-of-two-elements-in-an-array.py │ ├── 1465-maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts.py │ ├── 1466-reorder-routes-to-make-all-paths-lead-to-the-city-zero.py │ ├── 1469-find-all-the-lonely-nodes.py │ ├── 1470-shuffle-the-array.py │ ├── 1471-the-k-strongest-values-in-an-array.py │ ├── 1472-design-browser-history.py │ ├── 1474-delete-n-nodes-after-m-nodes-of-a-linked-list.py │ ├── 1475-final-prices-with-a-special-discount-in-a-shop.py │ ├── 1476-subrectangle-queries.py │ ├── 1481-least-number-of-unique-integers-after-k-removals.py │ ├── 1482-minimum-number-of-days-to-make-m-bouquets.py │ ├── 1488-avoid-flood-in-the-city.py │ ├── 1489-find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree.py │ ├── 1492-the-kth-factor-of-n.py │ ├── 1493-longest-subarray-of-1s-after-deleting-one-element.py │ ├── 1496-path-crossing.py │ ├── 1497-check-if-array-pairs-are-divisible-by-k.py │ ├── 1498-number-of-subsequences-that-satisfy-the-given-sum-condition.py │ ├── 1503-last-moment-before-all-ants-fall-out-of-a-plank.py │ ├── 1508-range-sum-of-sorted-subarray-sums.py │ ├── 1509-minimum-difference-between-largest-and-smallest-value-in-three-moves.py │ ├── 1512-number-of-good-pairs.py │ ├── 1513-number-of-substrings-with-only-1s.py │ ├── 1514-path-with-maximum-probability.py │ ├── 1518-water-bottles.py │ ├── 1523-count-odd-numbers-in-an-interval-range.py │ ├── 1524-number-of-sub-arrays-with-odd-sum.py │ ├── 1525-number-of-good-ways-to-split-a-string.py │ ├── 1526-minimum-number-of-increments-on-subarrays-to-form-a-target-array.py │ ├── 1529-minimum-suffix-flips.py │ ├── 1530-number-of-good-leaf-nodes-pairs.py │ ├── 1531-string-compression-ii.py │ ├── 1534-count-good-triplets.py │ ├── 1535-find-the-winner-of-an-array-game.py │ ├── 1539-kth-missing-positive-number.py │ ├── 1544-make-the-string-great.py │ ├── 1545-find-kth-bit-in-nth-binary-string.py │ ├── 1550-three-consecutive-odds.py │ ├── 1551-minimum-operations-to-make-array-equal.py │ ├── 1552-magnetic-force-between-two-balls.py │ ├── 1557-minimum-number-of-vertices-to-reach-all-nodes.py │ ├── 1561-maximum-number-of-coins-you-can-get.py │ ├── 1568-minimum-number-of-days-to-disconnect-island.py │ ├── 1570-dot-product-of-two-sparse-vectors.py │ ├── 1574-shortest-subarray-to-be-removed-to-make-array-sorted.py │ ├── 1578-minimum-time-to-make-rope-colorful.py │ ├── 1579-remove-max-number-of-edges-to-keep-graph-fully-traversable.py │ ├── 1580-put-boxes-into-the-warehouse-ii.py │ ├── 1582-special-positions-in-a-binary-matrix.py │ ├── 1584-min-cost-to-connect-all-points.py │ ├── 1590-make-sum-divisible-by-p.py │ ├── 1593-split-a-string-into-the-max-number-of-unique-substrings.py │ ├── 1598-crawler-log-folder.py │ ├── 1605-find-valid-matrix-given-row-and-column-sums.py │ ├── 1608-special-array-with-x-elements-greater-than-or-equal-x.py │ ├── 1609-even-odd-tree.py │ ├── 1611-minimum-one-bit-operations-to-make-integers-zero.py │ ├── 1614-maximum-nesting-depth-of-the-parentheses.py │ ├── 1615-maximal-network-rank.py │ ├── 1624-largest-substring-between-two-equal-characters.py │ ├── 1625-lexicographically-smallest-string-after-applying-operations.py │ ├── 1630-arithmetic-subarrays.py │ ├── 1631-path-with-minimum-effort.py │ ├── 1634-add-two-polynomials-represented-as-linked-lists.py │ ├── 1636-sort-array-by-increasing-frequency.py │ ├── 1637-widest-vertical-area-between-two-points-containing-no-points.py │ ├── 1639-number-of-ways-to-form-a-target-string-given-a-dictionary.py │ ├── 1641-count-sorted-vowel-strings.py │ ├── 1642-furthest-building-you-can-reach.py │ ├── 1644-lowest-common-ancestor-of-a-binary-tree-ii.py │ ├── 1647-minimum-deletions-to-make-character-frequencies-unique.py │ ├── 1650-lowest-common-ancestor-of-a-binary-tree-iii.py │ ├── 1652-defuse-the-bomb.py │ ├── 1653-minimum-deletions-to-make-string-balanced.py │ ├── 1657-determine-if-two-strings-are-close.py │ ├── 1658-minimum-operations-to-reduce-x-to-zero.py │ ├── 1660-correct-a-binary-tree.py │ ├── 1662-check-if-two-string-arrays-are-equivalent.py │ ├── 1663-smallest-string-with-a-given-numeric-value.py │ ├── 1669-merge-in-between-linked-lists.py │ ├── 1671-minimum-number-of-removals-to-make-mountain-array.py │ ├── 1679-max-number-of-k-sum-pairs.py │ ├── 1684-count-the-number-of-consistent-strings.py │ ├── 1685-sum-of-absolute-differences-in-a-sorted-array.py │ ├── 1688-count-of-matches-in-tournament.py │ ├── 1689-partitioning-into-minimum-number-of-deci-binary-numbers.py │ ├── 1695-maximum-erasure-value.py │ ├── 1700-number-of-students-unable-to-eat-lunch.py │ ├── 1701-average-waiting-time.py │ ├── 1704-determine-if-string-halves-are-alike.py │ ├── 1706-where-will-the-ball-fall.py │ ├── 1716-calculate-money-in-leetcode-bank.py │ ├── 1717-maximum-score-from-removing-substrings.py │ ├── 1718-construct-the-lexicographically-largest-valid-sequence.py │ ├── 1721-swapping-nodes-in-a-linked-list.py │ ├── 1726-tuple-with-same-product.py │ ├── 1727-largest-submatrix-with-rearrangements.py │ ├── 1730-shortest-path-to-get-food.py │ ├── 1732-find-the-highest-altitude.py │ ├── 1733-minimum-number-of-people-to-teach.py │ ├── 1740-find-distance-in-a-binary-tree.py │ ├── 1743-restore-the-array-from-adjacent-pairs.py │ ├── 1746-maximum-subarray-sum-after-one-operation.py │ ├── 1749-maximum-absolute-sum-of-any-subarray.py │ ├── 1750-minimum-length-of-string-after-deleting-similar-ends.py │ ├── 1752-check-if-array-is-sorted-and-rotated.py │ ├── 1753-maximum-score-from-removing-stones.py │ ├── 1756-design-most-recently-used-queue.py │ ├── 1758-minimum-changes-to-make-alternating-binary-string.py │ ├── 1759-count-number-of-homogenous-substrings.py │ ├── 1760-minimum-limit-of-balls-in-a-bag.py │ ├── 1762-buildings-with-an-ocean-view.py │ ├── 1765-map-of-highest-peak.py │ ├── 1768-merge-strings-alternately.py │ ├── 1769-minimum-number-of-operations-to-move-all-balls-to-each-box.py │ ├── 1770-maximum-score-from-performing-multiplication-operations.py │ ├── 1780-check-if-number-is-a-sum-of-powers-of-three.py │ ├── 1785-minimum-elements-to-add-to-form-a-given-sum.py │ ├── 1790-check-if-one-string-swap-can-make-strings-equal.py │ ├── 1791-find-center-of-star-graph.py │ ├── 1792-maximum-average-pass-ratio.py │ ├── 1793-maximum-score-of-a-good-subarray.py │ ├── 1797-design-authentication-manager.py │ ├── 1800-maximum-ascending-subarray-sum.py │ ├── 1802-maximum-value-at-a-given-index-in-a-bounded-array.py │ ├── 1804-implement-trie-ii-prefix-tree.py │ ├── 1806-minimum-number-of-operations-to-reinitialize-a-permutation.py │ ├── 1807-evaluate-the-bracket-pairs-of-a-string.py │ ├── 1813-sentence-similarity-iii.py │ ├── 1814-count-nice-pairs-in-an-array.py │ ├── 1817-finding-the-users-active-minutes.py │ ├── 1823-find-the-winner-of-the-circular-game.py │ ├── 1828-queries-on-number-of-points-inside-a-circle.py │ ├── 1829-maximum-xor-for-each-query.py │ ├── 1833-maximum-ice-cream-bars.py │ ├── 1834-single-threaded-cpu.py │ ├── 1836-remove-duplicates-from-an-unsorted-linked-list.py │ ├── 1838-frequency-of-the-most-frequent-element.py │ ├── 1842-next-palindrome-using-same-digits.py │ ├── 1845-seat-reservation-manager.py │ ├── 1846-maximum-element-after-decreasing-and-rearranging.py │ ├── 1851-minimum-interval-to-include-each-query.py │ ├── 1852-distinct-numbers-in-each-subarray.py │ ├── 1855-maximum-distance-between-a-pair-of-values.py │ ├── 1857-largest-color-value-in-a-directed-graph.py │ ├── 1858-longest-word-with-all-prefixes.py │ ├── 1860-incremental-memory-leak.py │ ├── 1861-rotating-the-box.py │ ├── 1863-sum-of-all-subset-xor-totals.py │ ├── 1865-finding-pairs-with-a-certain-sum.py │ ├── 1870-minimum-speed-to-arrive-on-time.py │ ├── 1874-minimize-product-sum-of-two-arrays.py │ ├── 1877-minimize-maximum-pair-sum-in-array.py │ ├── 1881-maximum-value-after-insertion.py │ ├── 1885-count-pairs-in-two-arrays.py │ ├── 1887-reduction-operations-to-make-the-array-elements-equal.py │ ├── 1888-minimum-number-of-flips-to-make-the-binary-string-alternating.py │ ├── 1891-cutting-ribbons.py │ ├── 1894-find-the-student-that-will-replace-the-chalk.py │ ├── 1895-largest-magic-square.py │ ├── 1897-redistribute-characters-to-make-all-strings-equal.py │ ├── 1898-maximum-number-of-removable-characters.py │ ├── 1899-merge-triplets-to-form-target-triplet.py │ ├── 1900-the-earliest-and-latest-rounds-where-players-compete.py │ ├── 1903-largest-odd-number-in-string.py │ ├── 1904-the-number-of-full-rounds-you-have-played.py │ ├── 1905-count-sub-islands.py │ ├── 1910-remove-all-occurrences-of-a-substring.py │ ├── 1912-design-movie-rental-system.py │ ├── 1913-maximum-product-difference-between-two-pairs.py │ ├── 1915-number-of-wonderful-substrings.py │ ├── 1920-build-array-from-permutation.py │ ├── 1921-eliminate-maximum-number-of-monsters.py │ ├── 1922-count-good-numbers.py │ ├── 1925-count-square-sum-triples.py │ ├── 1926-nearest-exit-from-entrance-in-maze.py │ ├── 1929-concatenation-of-array.py │ ├── 1930-unique-length-3-palindromic-subsequences.py │ ├── 1931-painting-a-grid-with-three-different-colors.py │ ├── 1935-maximum-number-of-words-you-can-type.py │ ├── 1936-add-minimum-number-of-rungs.py │ ├── 1937-maximum-number-of-points-with-cost.py │ ├── 1940-longest-common-subsequence-between-sorted-arrays.py │ ├── 1942-the-number-of-the-smallest-unoccupied-chair.py │ ├── 1945-sum-of-digits-of-string-after-convert.py │ ├── 1946-largest-number-after-mutating-substring.py │ ├── 1948-delete-duplicate-folders-in-system.py │ ├── 1957-delete-characters-to-make-fancy-string.py │ ├── 1962-remove-stones-to-minimize-the-total.py │ ├── 1963-minimum-number-of-swaps-to-make-the-string-balanced.py │ ├── 1968-array-with-elements-not-equal-to-average-of-neighbors.py │ ├── 1970-last-day-where-you-can-still-cross.py │ ├── 1971-find-if-path-exists-in-graph.py │ ├── 1973-count-nodes-equal-to-sum-of-descendants.py │ ├── 1975-maximum-matrix-sum.py │ ├── 1976-number-of-ways-to-arrive-at-destination.py │ ├── 1980-find-unique-binary-string.py │ ├── 1984-minimum-difference-between-highest-and-lowest-of-k-scores.py │ ├── 1985-find-the-kth-largest-integer-in-the-array.py │ ├── 1992-find-all-groups-of-farmland.py │ ├── 2000-reverse-prefix-of-word.py │ ├── 2001-number-of-pairs-of-interchangeable-rectangles.py │ ├── 2002-maximum-product-of-the-length-of-two-palindromic-subsequences.py │ ├── 2007-find-original-array-from-doubled-array.py │ ├── 2009-minimum-number-of-operations-to-make-array-continuous.py │ ├── 2011-final-value-of-variable-after-performing-operations.py │ ├── 2012-sum-of-beauty-in-the-array.py │ ├── 2013-detect-squares.py │ ├── 2014-longest-subsequence-repeated-k-times.py │ ├── 2016-maximum-difference-between-increasing-elements.py │ ├── 2017-grid-game.py │ ├── 2022-convert-1d-array-into-2d-array.py │ ├── 2023-number-of-pairs-of-strings-with-concatenation-equal-to-target.py │ ├── 2028-find-missing-observations.py │ ├── 2033-minimum-operations-to-make-a-uni-value-grid.py │ ├── 2034-stock-price-fluctuation.py │ ├── 2035-partition-array-into-two-arrays-to-minimize-sum-difference.py │ ├── 2037-minimum-number-of-moves-to-seat-everyone.py │ ├── 2038-remove-colored-pieces-if-both-neighbors-are-the-same-color.py │ ├── 2040-kth-smallest-product-of-two-sorted-arrays.py │ ├── 2043-simple-bank-system.py │ ├── 2044-count-number-of-maximum-bitwise-or-subsets.py │ ├── 2045-second-minimum-time-to-reach-destination.py │ ├── 2048-next-greater-numerically-balanced-number.py │ ├── 2050-parallel-courses-iii.py │ ├── 2053-kth-distinct-string-in-an-array.py │ ├── 2054-two-best-non-overlapping-events.py │ ├── 2055-plates-between-candles.py │ ├── 2058-find-the-minimum-and-maximum-number-of-nodes-between-critical-points.py │ ├── 2061-number-of-spaces-cleaning-robot-cleaned.py │ ├── 2062-count-vowel-substrings-of-a-string.py │ ├── 2064-minimized-maximum-of-products-distributed-to-any-store.py │ ├── 2070-most-beautiful-item-for-each-query.py │ ├── 2071-maximum-number-of-tasks-you-can-assign.py │ ├── 2073-time-needed-to-buy-tickets.py │ ├── 2074-reverse-nodes-in-even-length-groups.py │ ├── 2077-paths-in-maze-that-lead-to-same-room.py │ ├── 2079-watering-plants.py │ ├── 2081-sum-of-k-mirror-numbers.py │ ├── 2083-substrings-that-begin-and-end-with-the-same-letter.py │ ├── 2089-find-target-indices-after-sorting-array.py │ ├── 2090-k-radius-subarray-averages.py │ ├── 2091-removing-minimum-and-maximum-from-array.py │ ├── 2092-find-all-people-with-secret.py │ ├── 2093-minimum-cost-to-reach-city-with-discounts.py │ ├── 2094-finding-3-digit-even-numbers.py │ ├── 2095-delete-the-middle-node-of-a-linked-list.py │ ├── 2096-step-by-step-directions-from-a-binary-tree-node-to-another.py │ ├── 2097-valid-arrangement-of-pairs.py │ ├── 2099-find-subsequence-of-length-k-with-the-largest-sum.py │ ├── 2101-detonate-the-maximum-bombs.py │ ├── 2104-total-characters-in-string-after-transformations-i.py │ ├── 2105-watering-plants-ii.py │ ├── 2106-maximum-fruits-harvested-after-at-most-k-steps.py │ ├── 2107-number-of-unique-flavors-after-sharing-k-candies.py │ ├── 2108-find-first-palindromic-string-in-the-array.py │ ├── 2109-adding-spaces-to-a-string.py │ ├── 2110-number-of-smooth-descent-periods-of-a-stock.py │ ├── 2115-find-all-possible-recipes-from-given-supplies.py │ ├── 2116-check-if-a-parentheses-string-can-be-valid.py │ ├── 2120-execution-of-all-suffix-instructions-staying-in-a-grid.py │ ├── 2125-number-of-laser-beams-in-a-bank.py │ ├── 2127-maximum-employees-to-be-invited-to-a-meeting.py │ ├── 2130-maximum-twin-sum-of-a-linked-list.py │ ├── 2131-longest-palindrome-by-concatenating-two-letter-words.py │ ├── 2134-minimum-swaps-to-group-all-1s-together-ii.py │ ├── 2138-divide-a-string-into-groups-of-size-k.py │ ├── 2139-detect-squares.py │ ├── 2139-minimum-moves-to-reach-target-score.py │ ├── 2140-solving-questions-with-brainpower.py │ ├── 2141-maximum-running-time-of-n-computers.py │ ├── 2145-count-the-hidden-sequences.py │ ├── 2147-number-of-ways-to-divide-a-long-corridor.py │ ├── 2149-rearrange-array-elements-by-sign.py │ ├── 2150-find-all-lonely-numbers-in-the-array.py │ ├── 2154-keep-multiplying-found-values-by-two.py │ ├── 2155-all-divisions-with-the-highest-score-of-a-binary-array.py │ ├── 2161-partition-array-according-to-given-pivot.py │ ├── 2163-minimum-difference-in-sums-after-removal-of-elements.py │ ├── 2165-smallest-value-of-the-rearranged-number.py │ ├── 2168-unique-substrings-with-equal-digit-frequency.py │ ├── 2169-count-operations-to-obtain-zero.py │ ├── 2176-count-equal-and-divisible-pairs-in-an-array.py │ ├── 2177-find-three-consecutive-integers-that-sum-to-a-given-number.py │ ├── 2178-maximum-split-of-positive-even-integers.py │ ├── 2179-count-good-triplets-in-an-array.py │ ├── 2181-merge-nodes-in-between-zeros.py │ ├── 2182-construct-string-with-repeat-limit.py │ ├── 2185-counting-words-with-a-given-prefix.py │ ├── 2186-minimum-number-of-steps-to-make-two-strings-anagram-ii.py │ ├── 2191-sort-the-jumbled-numbers.py │ ├── 2192-all-ancestors-of-a-node-in-a-directed-acyclic-graph.py │ ├── 2193-minimum-number-of-moves-to-make-palindrome.py │ ├── 2196-create-binary-tree-from-descriptions.py │ ├── 2197-replace-non-coprime-numbers-in-array.py │ ├── 2200-find-all-k-distant-indices-in-an-array.py │ ├── 2201-zero-array-transformation-i.py │ ├── 2204-distance-to-a-cycle-in-undirected-graph.py │ ├── 2206-divide-array-into-equal-pairs.py │ ├── 2207-maximize-number-of-subsequences-in-a-string.py │ ├── 2208-minimum-operations-to-halve-array-sum.py │ ├── 2210-count-hills-and-valleys-in-an-array.py │ ├── 2211-count-collisions-on-a-road.py │ ├── 2214-minimum-health-to-beat-game.py │ ├── 2215-find-the-difference-of-two-arrays.py │ ├── 2216-minimum-deletions-to-make-array-beautiful.py │ ├── 2220-minimum-bit-flips-to-convert-number.py │ ├── 2221-find-triangular-sum-of-an-array.py │ ├── 2225-find-players-with-zero-or-one-losses.py │ ├── 2226-maximum-candies-allocated-to-k-children.py │ ├── 2231-largest-number-after-digit-swaps-by-parity.py │ ├── 2235-add-two-integers.py │ ├── 2240-number-of-ways-to-buy-pens-and-pencils.py │ ├── 2244-minimum-rounds-to-complete-all-tasks.py │ ├── 2246-longest-path-with-different-adjacent-characters.py │ ├── 2251-number-of-flowers-in-full-bloom.py │ ├── 2256-minimum-average-difference.py │ ├── 2257-count-unguarded-cells-in-the-grid.py │ ├── 2260-minimum-consecutive-cards-to-pick-up.py │ ├── 2262-total-appeal-of-a-string.py │ ├── 2264-largest-3-same-digit-number-in-string.py │ ├── 2265-count-nodes-equal-to-average-of-subtree.py │ ├── 2270-number-of-ways-to-split-array.py │ ├── 2273-find-resultant-array-after-removing-anagrams.py │ ├── 2274-maximum-consecutive-floors-without-special-floors.py │ ├── 2275-largest-combination-with-bitwise-and-greater-than-zero.py │ ├── 2279-maximum-bags-with-full-capacity-of-rocks.py │ ├── 2284-sender-with-largest-word-count.py │ ├── 2285-maximum-total-importance-of-roads.py │ ├── 2290-minimum-obstacle-removal-to-reach-corner.py │ ├── 2291-maximum-profit-from-trading-stocks.py │ ├── 2294-partition-array-such-that-maximum-difference-is-k.py │ ├── 2295-replace-elements-in-an-array.py │ ├── 2300-successful-pairs-of-spells-and-potions.py │ ├── 2302-count-subarrays-with-score-less-than-k.py │ ├── 2303-calculate-amount-paid-in-taxes.py │ ├── 2310-sum-of-numbers-with-units-digit-k.py │ ├── 2311-longest-binary-subsequence-less-than-or-equal-to-k.py │ ├── 2322-minimum-score-after-removals-on-a-tree.py │ ├── 2326-spiral-matrix-iv.py │ ├── 2327-number-of-people-aware-of-a-secret.py │ ├── 2331-evaluate-boolean-binary-tree.py │ ├── 2334-subarray-with-elements-greater-than-varying-threshold.py │ ├── 2336-smallest-number-in-infinite-set.py │ ├── 2337-move-pieces-to-obtain-a-string.py │ ├── 2338-count-the-number-of-ideal-arrays.py │ ├── 2342-max-sum-of-a-pair-with-equal-sum-of-digits.py │ ├── 2348-number-of-zero-filled-subarrays.py │ ├── 2349-design-a-number-container-system.py │ ├── 2352-equal-row-and-column-pairs.py │ ├── 2353-design-a-food-rating-system.py │ ├── 2355-maximum-number-of-books-you-can-take.py │ ├── 2357-make-array-zero-by-subtracting-equal-amounts.py │ ├── 2358-maximum-number-of-groups-entering-a-competition.py │ ├── 2359-find-closest-node-to-given-two-nodes.py │ ├── 2361-minimum-costs-using-the-train-line.py │ ├── 2364-count-number-of-bad-pairs.py │ ├── 2366-minimum-replacements-to-sort-the-array.py │ ├── 2368-reachable-nodes-with-restrictions.py │ ├── 2369-check-if-there-is-a-valid-partition-for-the-array.py │ ├── 2370-longest-ideal-subsequence.py │ ├── 2371-minimize-maximum-value-in-a-grid.py │ ├── 2373-largest-local-values-in-a-matrix.py │ ├── 2374-node-with-highest-edge-score.py │ ├── 2375-construct-smallest-number-from-di-string.py │ ├── 2379-minimum-recolors-to-get-k-consecutive-black-blocks.py │ ├── 2380-time-needed-to-rearrange-a-binary-string.py │ ├── 2381-shifting-letters-ii.py │ ├── 2384-largest-palindromic-number.py │ ├── 2385-amount-of-time-for-binary-tree-to-be-infected.py │ ├── 2389-longest-subsequence-with-limited-sum.py │ ├── 2390-removing-stars-from-a-string.py │ ├── 2391-minimum-amount-of-time-to-collect-garbage.py │ ├── 2392-build-a-matrix-with-conditions.py │ ├── 2393-count-strictly-increasing-subarrays.py │ ├── 2396-strictly-palindromic-number.py │ ├── 2401-longest-nice-subarray.py │ ├── 2402-meeting-rooms-iii.py │ ├── 2405-optimal-partition-of-string.py │ ├── 2406-divide-intervals-into-minimum-number-of-groups.py │ ├── 2408-design-sql.py │ ├── 2410-maximum-matching-of-players-with-trainers.py │ ├── 2411-smallest-subarrays-with-maximum-bitwise-or.py │ ├── 2414-length-of-the-longest-alphabetical-continuous-substring.py │ ├── 2415-reverse-odd-levels-of-binary-tree.py │ ├── 2416-sum-of-prefix-scores-of-strings.py │ ├── 2418-sort-the-people.py │ ├── 2419-longest-subarray-with-maximum-bitwise-and.py │ ├── 2425-bitwise-xor-of-all-pairings.py │ ├── 2428-maximum-sum-of-an-hourglass.py │ ├── 2429-minimize-xor.py │ ├── 2433-find-the-original-array-of-prefix-xor.py │ ├── 2434-using-a-robot-to-print-the-lexicographically-smallest-string.py │ ├── 2435-paths-in-matrix-whose-sum-is-divisible-by-k.py │ ├── 2438-range-product-queries-of-powers.py │ ├── 2439-minimize-maximum-of-array.py │ ├── 2441-largest-positive-integer-that-exists-with-its-negative.py │ ├── 2442-count-number-of-distinct-integers-after-reverse-operations.py │ ├── 2443-sum-of-number-and-its-reverse.py │ ├── 2444-count-subarrays-with-fixed-bounds.py │ ├── 2452-words-within-two-edits-of-dictionary.py │ ├── 2456-most-popular-video-creator.py │ ├── 2458-height-of-binary-tree-after-subtree-removal-queries.py │ ├── 2460-apply-operations-to-an-array.py │ ├── 2461-maximum-sum-of-distinct-subarrays-with-length-k.py │ ├── 2462-total-cost-to-hire-k-workers.py │ ├── 2463-minimum-total-distance-traveled.py │ ├── 2464-minimum-subarrays-in-a-valid-split.py │ ├── 2466-count-ways-to-build-good-strings.py │ ├── 2467-most-profitable-path-in-a-tree.py │ ├── 2470-number-of-subarrays-with-lcm-equal-to-k.py │ ├── 2471-minimum-number-of-operations-to-sort-a-binary-tree-by-level.py │ ├── 2473-minimum-cost-to-buy-apples.py │ ├── 2482-difference-between-ones-and-zeros-in-row-and-column.py │ ├── 2483-minimum-penalty-for-a-shop.py │ ├── 2485-find-the-pivot-integer.py │ ├── 2486-append-characters-to-string-to-make-subsequence.py │ ├── 2487-remove-nodes-from-linked-list.py │ ├── 2490-circular-sentence.py │ ├── 2491-divide-players-into-teams-of-equal-skill.py │ ├── 2492-minimum-score-of-a-path-between-two-cities.py │ ├── 2493-divide-nodes-into-the-maximum-number-of-groups.py │ ├── 2501-longest-square-streak-in-an-array.py │ ├── 2503-maximum-number-of-points-from-grid-queries.py │ ├── 2505-bitwise-or-of-all-subsequence-sums.py │ ├── 2507-smallest-value-after-replacing-with-sum-of-prime-factors.py │ ├── 2516-take-k-of-each-character-from-left-and-right.py │ ├── 2521-distinct-prime-factors-of-product-of-array.py │ ├── 2523-closest-prime-numbers-in-range.py │ ├── 2526-find-consecutive-integers-from-a-data-stream.py │ ├── 2527-find-xor-beauty-of-array.py │ ├── 2528-maximize-the-minimum-powered-city.py │ ├── 2529-maximum-count-of-positive-integer-and-negative-integer.py │ ├── 2530-maximal-score-after-applying-k-operations.py │ ├── 2536-increment-submatrices-by-one.py │ ├── 2537-count-the-number-of-good-subarrays.py │ ├── 2539-count-the-number-of-good-subsequences.py │ ├── 2540-minimum-common-value.py │ ├── 2542-maximum-subsequence-score.py │ ├── 2545-sort-the-students-by-their-kth-score.py │ ├── 2551-put-marbles-in-bags.py │ ├── 2554-maximum-number-of-integers-to-choose-from-a-range-i.py │ ├── 2558-take-gifts-from-the-richest-pile.py │ ├── 2559-count-vowel-strings-in-ranges.py │ ├── 2560-house-robber-iv.py │ ├── 2561-rearranging-fruits.py │ ├── 2563-count-the-number-of-fair-pairs.py │ ├── 2566-maximum-difference-by-remapping-a-digit.py │ ├── 2570-merge-two-2d-arrays-by-summing-values.py │ ├── 2575-find-the-divisibility-array-of-a-string.py │ ├── 2577-minimum-time-to-visit-a-cell-in-a-grid.py │ ├── 2579-count-total-number-of-colored-cells.py │ ├── 2582-pass-the-pillow.py │ ├── 2583-kth-largest-sum-in-a-binary-tree.py │ ├── 2587-rearrange-array-to-maximize-prefix-score.py │ ├── 2592-maximize-greatness-of-an-array.py │ ├── 2593-find-score-of-an-array-after-marking-all-elements.py │ ├── 2594-minimum-time-to-repair-cars.py │ ├── 2596-check-knight-tour-configuration.py │ ├── 2597-the-number-of-beautiful-subsets.py │ ├── 2598-smallest-missing-non-negative-integer-after-operations.py │ ├── 2599-make-the-prefix-sum-non-negative.py │ ├── 2601-prime-subtraction-operation.py │ ├── 2602-minimum-operations-to-make-all-array-elements-equal.py │ ├── 2606-find-the-substring-with-maximum-cost.py │ ├── 2610-convert-an-array-into-a-2d-array-with-conditions.py │ ├── 2616-minimize-the-maximum-difference-of-pairs.py │ ├── 2640-find-the-score-of-all-prefixes-of-an-array.py │ ├── 2641-cousins-in-binary-tree-ii.py │ ├── 2642-design-graph-with-shortest-path-calculator.py │ ├── 2645-minimum-additions-to-make-valid-string.py │ ├── 2654-minimum-number-of-operations-to-make-all-array-elements-equal-to-1.py │ ├── 2657-find-the-prefix-common-array-of-two-arrays.py │ ├── 2658-maximum-number-of-fish-in-a-grid.py │ ├── 2661-first-completely-painted-row-or-column.py │ ├── 2664-the-knights-tour.py │ ├── 2671-frequency-tracker.py │ ├── 2674-split-a-circular-linked-list.py │ ├── 2678-number-of-senior-citizens.py │ ├── 2679-sum-in-a-matrix.py │ ├── 2683-neighboring-bitwise-xor.py │ ├── 2684-maximum-number-of-moves-in-a-grid.py │ ├── 2685-count-the-number-of-complete-components.py │ ├── 2696-minimum-string-length-after-removing-substrings.py │ ├── 2698-find-the-punishment-number-of-an-integer.py │ ├── 2699-modify-graph-edge-weights.py │ ├── 2706-buy-two-chocolates.py │ ├── 2707-extra-characters-in-a-string.py │ ├── 2708-maximum-strength-of-a-group.py │ ├── 2709-greatest-common-divisor-traversal.py │ ├── 2711-difference-of-number-of-distinct-values-on-diagonals.py │ ├── 2730-find-the-longest-semi-repetitive-substring.py │ ├── 2734-lexicographically-smallest-string-after-substring-operation.py │ ├── 2737-find-the-closest-marked-node.py │ ├── 2740-find-the-value-of-the-partition.py │ ├── 2742-painting-the-walls.py │ ├── 2743-count-substrings-without-repeating-character.py │ ├── 2749-minimum-operations-to-make-the-integer-zero.py │ ├── 2751-robot-collisions.py │ ├── 2761-prime-pairs-with-target-sum.py │ ├── 2762-continuous-subarrays.py │ ├── 2770-maximum-number-of-jumps-to-reach-the-last-index.py │ ├── 2771-longest-non-decreasing-subarray-from-two-arrays.py │ ├── 2772-apply-operations-to-make-all-array-elements-equal-to-zero.py │ ├── 2778-sum-of-squares-of-special-elements.py │ ├── 2779-maximum-beauty-of-an-array-after-applying-operation.py │ ├── 2780-minimum-index-of-a-valid-split.py │ ├── 2784-check-if-array-is-good.py │ ├── 2785-sort-vowels-in-a-string.py │ ├── 2787-ways-to-express-an-integer-as-sum-of-powers.py │ ├── 2788-split-strings-by-separator.py │ ├── 2789-largest-element-in-an-array-after-merge-operations.py │ ├── 2798-number-of-employees-who-met-the-target.py │ ├── 2799-count-complete-subarrays-in-an-array.py │ ├── 2802-find-the-k-th-lucky-number.py │ ├── 2806-account-balance-after-rounded-purchase.py │ ├── 2807-insert-greatest-common-divisors-in-linked-list.py │ ├── 2810-faulty-keyboard.py │ ├── 2811-check-if-it-is-possible-to-split-array.py │ ├── 2812-find-the-safest-path-in-a-grid.py │ ├── 2814-minimum-time-takes-to-reach-destination-without-drowning.py │ ├── 2816-double-a-number-represented-as-a-linked-list.py │ ├── 2818-apply-operations-to-maximize-score.py │ ├── 2824-count-pairs-whose-sum-is-less-than-target.py │ ├── 2825-make-string-a-subsequence-using-cyclic-increments.py │ ├── 2829-determine-the-minimum-sum-of-a-k-avoiding-array.py │ ├── 2832-maximal-range-that-each-element-is-maximum-in-it.py │ ├── 2833-furthest-point-from-origin.py │ ├── 2834-find-the-minimum-possible-sum-of-a-beautiful-array.py │ ├── 2838-maximum-coins-heroes-can-collect.py │ ├── 2840-check-if-strings-can-be-made-equal-with-operations-ii.py │ ├── 2841-maximum-sum-of-almost-unique-subarray.py │ ├── 2843-count-symmetric-integers.py │ ├── 2845-count-of-interesting-subarrays.py │ ├── 2849-determine-if-a-cell-is-reachable-at-a-given-time.py │ ├── 2850-minimum-moves-to-spread-stones-over-grid.py │ ├── 2852-sum-of-remoteness-of-all-cells.py │ ├── 2856-minimum-array-length-after-pair-removals.py │ ├── 2864-maximum-odd-binary-number.py │ ├── 2865-beautiful-towers-i.py │ ├── 2870-minimum-number-of-operations-to-make-array-empty.py │ ├── 2872-maximum-number-of-k-divisible-components.py │ ├── 2873-maximum-value-of-an-ordered-triplet-i.py │ ├── 2874-maximum-value-of-an-ordered-triplet-ii.py │ ├── 2877-create-a-dataframe-from-list.py │ ├── 2878-get-the-size-of-a-dataframe.py │ ├── 2879-display-the-first-three-rows.py │ ├── 2880-select-data.py │ ├── 2881-create-a-new-column.py │ ├── 2882-drop-duplicate-rows.py │ ├── 2883-drop-missing-data.py │ ├── 2884-modify-columns.py │ ├── 2885-rename-columns.py │ ├── 2886-change-data-type.py │ ├── 2887-fill-missing-data.py │ ├── 2888-reshape-data-concatenate.py │ ├── 2889-reshape-data-pivot.py │ ├── 2890-reshape-data-melt.py │ ├── 2891-method-chaining.py │ ├── 2894-divisible-and-non-divisible-sums-difference.py │ ├── 2895-minimum-processing-time.py │ ├── 2900-longest-unequal-adjacent-groups-subsequence-i.py │ ├── 2901-longest-unequal-adjacent-groups-subsequence-ii.py │ ├── 2904-shortest-and-lexicographically-smallest-beautiful-string.py │ ├── 2909-minimum-sum-of-mountain-triplets-ii.py │ ├── 2914-minimum-number-of-changes-to-make-binary-string-beautiful.py │ ├── 2918-minimum-equal-sum-of-two-arrays-after-replacing-zeros.py │ ├── 2923-find-champion-i.py │ ├── 2924-find-champion-ii.py │ ├── 2927-distribute-candies-among-children-iii.py │ ├── 2929-distribute-candies-among-children-ii.py │ ├── 2933-high-access-employees.py │ ├── 2938-separate-black-and-white-balls.py │ ├── 2940-find-building-where-alice-and-bob-can-meet.py │ ├── 2942-find-words-containing-character.py │ ├── 2943-maximize-area-of-square-hole-in-grid.py │ ├── 2947-count-beautiful-substrings-i.py │ ├── 2948-make-lexicographically-smallest-array-by-swapping-elements.py │ ├── 2955-number-of-same-end-substrings.py │ ├── 2957-remove-adjacent-almost-equal-characters.py │ ├── 2958-length-of-longest-subarray-with-at-most-k-frequency.py │ ├── 2961-double-modular-exponentiation.py │ ├── 2962-count-subarrays-where-max-element-appears-at-least-k-times.py │ ├── 2965-find-missing-and-repeated-values.py │ ├── 2966-divide-array-into-arrays-with-max-difference.py │ ├── 2971-find-polygon-with-the-largest-perimeter.py │ ├── 2975-maximum-square-area-by-removing-fences-from-a-field.py │ ├── 2976-minimum-cost-to-convert-string-i.py │ ├── 2977-minimum-cost-to-convert-string-ii.py │ ├── 2981-find-longest-special-substring-that-occurs-thrice-i.py │ ├── 2997-minimum-number-of-operations-to-make-array-xor-equal-to-k.py │ ├── 2999-count-the-number-of-powerful-integers.py │ ├── 3000-maximum-area-of-longest-diagonal-rectangle.py │ ├── 3003-maximize-the-number-of-partitions-after-operations.py │ ├── 3005-count-elements-with-maximum-frequency.py │ ├── 3006-find-beautiful-indices-in-the-given-array-i.py │ ├── 3010-divide-an-array-into-subarrays-with-minimum-cost-i.py │ ├── 3011-find-if-array-can-be-sorted.py │ ├── 3013-divide-an-array-into-subarrays-with-minimum-cost-ii.py │ ├── 3016-minimum-number-of-pushes-to-type-word-ii.py │ ├── 3020-find-the-maximum-number-of-elements-in-subset.py │ ├── 3021-alice-and-bob-playing-flower-game.py │ ├── 3024-type-of-triangle.py │ ├── 3025-find-the-number-of-ways-to-place-people-i.py │ ├── 3026-maximum-good-subarray-sum.py │ ├── 3027-find-the-number-of-ways-to-place-people-ii.py │ ├── 3034-number-of-subarrays-that-match-a-pattern-i.py │ ├── 3039-apply-operations-to-make-string-empty.py │ ├── 3042-count-prefix-and-suffix-pairs-i.py │ ├── 3043-find-the-length-of-the-longest-common-prefix.py │ ├── 3047-find-the-largest-area-of-square-inside-two-rectangles.py │ ├── 3062-winner-of-the-linked-list-game.py │ ├── 3063-linked-list-frequency.py │ ├── 3066-minimum-operations-to-exceed-threshold-value-ii.py │ ├── 3068-find-the-maximum-sum-of-node-values.py │ ├── 3070-count-submatrices-with-top-left-element-and-sum-less-than-k.py │ ├── 3074-apple-redistribution-into-boxes.py │ ├── 3075-maximize-happiness-of-selected-children.py │ ├── 3084-count-substrings-starting-and-ending-with-given-character.py │ ├── 3085-minimum-deletions-to-make-string-k-special.py │ ├── 3091-apply-operations-to-make-sum-of-array-greater-than-or-equal-to-k.py │ ├── 3095-shortest-subarray-with-or-at-least-k-i.py │ ├── 3096-minimum-levels-to-gain-more-points.py │ ├── 3097-shortest-subarray-with-or-at-least-k-ii.py │ ├── 3100-water-bottles-ii.py │ ├── 3101-count-alternating-subarrays.py │ ├── 3105-longest-strictly-increasing-or-strictly-decreasing-subarray.py │ ├── 3106-lexicographically-smallest-string-after-operations-with-constraint.py │ ├── 3108-minimum-cost-walk-in-weighted-graph.py │ ├── 3110-score-of-a-string.py │ ├── 3111-minimum-rectangles-to-cover-points.py │ ├── 3115-maximum-prime-difference.py │ ├── 3121-count-the-number-of-special-characters-ii.py │ ├── 3128-right-triangles.py │ ├── 3133-minimum-array-end.py │ ├── 3136-valid-word.py │ ├── 3137-minimum-number-of-operations-to-make-word-k-periodic.py │ ├── 3147-taking-maximum-energy-from-the-mystic-dungeon.py │ ├── 3151-special-array-i.py │ ├── 3152-special-array-ii.py │ ├── 3155-maximum-number-of-upgradable-servers.py │ ├── 3159-find-occurrences-of-an-element-in-an-array.py │ ├── 3160-find-the-number-of-distinct-colors-among-the-balls.py │ ├── 3163-string-compression-iii.py │ ├── 3169-count-days-without-meetings.py │ ├── 3170-lexicographically-minimum-string-after-removing-stars.py │ ├── 3174-clear-digits.py │ ├── 3175-find-the-first-player-to-win-k-games-in-a-row.py │ ├── 3176-find-the-maximum-length-of-a-good-subsequence-i.py │ ├── 3177-find-the-maximum-length-of-a-good-subsequence-ii.py │ ├── 3179-find-the-n-th-value-after-k-seconds.py │ ├── 3186-maximum-total-damage-with-spell-casting.py │ ├── 3189-minimum-moves-to-get-a-peaceful-board.py │ ├── 3190-find-minimum-operations-to-make-all-elements-divisible-by-three.py │ ├── 3191-minimum-operations-to-make-binary-array-elements-equal-to-one-i.py │ ├── 3192-minimum-operations-to-make-binary-array-elements-equal-to-one-ii.py │ ├── 3195-find-the-minimum-area-to-cover-all-ones-i.py │ ├── 3197-find-the-minimum-area-to-cover-all-ones-ii.py │ ├── 3201-find-the-maximum-length-of-valid-subsequence-i.py │ ├── 3202-find-the-maximum-length-of-valid-subsequence-ii.py │ ├── 3203-find-minimum-diameter-after-merging-two-trees.py │ ├── 3208-alternating-groups-ii.py │ ├── 3211-generate-binary-strings-without-adjacent-zeros.py │ ├── 3217-delete-nodes-from-linked-list-present-in-array.py │ ├── 3223-minimum-length-of-string-after-operations.py │ ├── 3227-vowels-game-in-a-string.py │ ├── 3228-maximum-number-of-operations-to-move-ones-to-the-end.py │ ├── 3233-find-the-count-of-numbers-which-are-not-special.py │ ├── 3234-count-the-number-of-substrings-with-dominant-ones.py │ ├── 3239-minimum-number-of-flips-to-make-binary-grid-palindromic-i.py │ ├── 3243-shortest-distance-after-road-addition-queries-i.py │ ├── 3249-count-the-number-of-good-nodes.py │ ├── 3254-find-the-power-of-k-size-subarrays-i.py │ ├── 3259-maximum-energy-boost-from-two-drinks.py │ ├── 3264-final-array-state-after-k-multiplication-operations-i.py │ ├── 3271-hash-divided-string.py │ ├── 3272-find-the-count-of-good-integers.py │ ├── 3275-k-th-nearest-obstacle-queries.py │ ├── 3280-convert-date-to-binary.py │ ├── 3281-maximize-score-of-numbers-in-ranges.py │ ├── 3282-reach-end-of-array-with-max-score.py │ ├── 3285-find-indices-of-stable-mountains.py │ ├── 3286-find-a-safe-walk-through-a-grid.py │ ├── 3289-the-two-sneaky-numbers-of-digitville.py │ ├── 3290-maximum-multiplication-score.py │ ├── 3295-report-spam-message.py │ ├── 3296-minimum-number-of-seconds-to-make-mountain-height-zero.py │ ├── 3300-minimum-element-after-replacement-with-digit-sum.py │ ├── 3301-maximize-the-total-height-of-unique-towers.py │ ├── 3304-find-the-k-th-character-in-string-game-i.py │ ├── 3305-count-of-substrings-containing-every-vowel-and-k-consonants-i.py │ ├── 3306-count-of-substrings-containing-every-vowel-and-k-consonants-ii.py │ ├── 3307-find-the-k-th-character-in-string-game-ii.py │ ├── 3309-maximum-possible-number-by-binary-concatenation.py │ ├── 3310-remove-methods-from-project.py │ ├── 3314-construct-the-minimum-bitwise-array-i.py │ ├── 3315-construct-the-minimum-bitwise-array-ii.py │ ├── 3318-find-x-sum-of-all-k-long-subarrays-i.py │ ├── 3319-k-th-largest-perfect-subtree-size-in-binary-tree.py │ ├── 3321-find-x-sum-of-all-k-long-subarrays-ii.py │ ├── 3324-find-the-sequence-of-strings-appeared-on-the-screen.py │ ├── 3325-count-substrings-with-k-frequency-characters-i.py │ ├── 3330-find-the-original-typed-string-i.py │ ├── 3331-find-subtree-sizes-after-changes.py │ ├── 3333-find-the-original-typed-string-ii.py │ ├── 3334-find-the-maximum-factor-score-of-array.py │ ├── 3335-total-characters-in-string-after-transformations-i.py │ ├── 3337-total-characters-in-string-after-transformations-ii.py │ ├── 3340-check-balanced-string.py │ ├── 3341-find-minimum-time-to-reach-last-room-i.py │ ├── 3342-find-minimum-time-to-reach-last-room-ii.py │ ├── 3343-count-number-of-balanced-permutations.py │ ├── 3345-smallest-divisible-digit-product-i.py │ ├── 3346-maximum-frequency-of-an-element-after-performing-operations-i.py │ ├── 3347-maximum-frequency-of-an-element-after-performing-operations-ii.py │ ├── 3349-adjacent-increasing-subarrays-detection-i.py │ ├── 3350-adjacent-increasing-subarrays-detection-ii.py │ ├── 3354-make-array-elements-equal-to-zero.py │ ├── 3355-zero-array-transformation-i.py │ ├── 3356-zero-array-transformation-ii.py │ ├── 3360-stone-removal-game.py │ ├── 3361-shift-distance-between-two-strings.py │ ├── 3362-zero-array-transformation-iii.py │ ├── 3363-find-the-maximum-number-of-fruits-collected.py │ ├── 3364-minimum-positive-sum-subarray.py │ ├── 3365-rearrange-k-substrings-to-form-target-string.py │ ├── 3370-smallest-number-with-all-set-bits.py │ ├── 3371-identify-the-largest-outlier-in-an-array.py │ ├── 3372-maximize-the-number-of-target-nodes-after-connecting-trees-i.py │ ├── 3373-maximize-the-number-of-target-nodes-after-connecting-trees-ii.py │ ├── 3375-minimum-operations-to-make-array-values-equal-to-k.py │ ├── 3379-transformed-array.py │ ├── 3380-maximum-area-rectangle-with-point-constraints-i.py │ ├── 3381-maximum-subarray-sum-with-length-divisible-by-k.py │ ├── 3386-button-with-longest-push-time.py │ ├── 3387-maximize-amount-after-two-days-of-conversions.py │ ├── 3392-count-subarrays-of-length-three-with-a-condition.py │ ├── 3393-count-paths-with-the-given-xor-value.py │ ├── 3394-check-if-grid-can-be-cut-into-sections.py │ ├── 3396-minimum-number-of-operations-to-make-elements-in-array-distinct.py │ ├── 3397-maximum-number-of-distinct-elements-after-operations.py │ ├── 3402-minimum-operations-to-make-columns-strictly-increasing.py │ ├── 3403-find-the-lexicographically-largest-string-from-the-box-i.py │ ├── 3405-count-the-number-of-arrays-with-k-matching-adjacent-elements.py │ ├── 3407-substring-matching-pattern.py │ ├── 3408-design-task-manager.py │ ├── 3411-maximum-subarray-with-equal-products.py │ ├── 3412-find-mirror-score-of-a-string.py │ ├── 3417-zigzag-grid-traversal-with-skip.py │ ├── 3418-maximum-amount-of-money-robot-can-earn.py │ ├── 3423-maximum-difference-between-adjacent-elements-in-a-circular-array.py │ ├── 3424-minimum-cost-to-make-arrays-identical.py │ ├── 3427-sum-of-variable-length-subarrays.py │ ├── 3428-maximum-and-minimum-sums-of-at-most-size-k-subsequences.py │ ├── 3432-count-partitions-with-even-sum-difference.py │ ├── 3433-count-mentions-per-user.py │ ├── 3434-maximum-frequency-after-subarray-operation.py │ ├── 3438-find-valid-pair-of-adjacent-digits-in-string.py │ ├── 3439-reschedule-meetings-for-maximum-free-time-i.py │ ├── 3440-reschedule-meetings-for-maximum-free-time-i.py │ ├── 3442-maximum-difference-between-even-and-odd-frequency-i.py │ ├── 3443-maximum-manhattan-distance-after-k-changes.py │ ├── 3445-maximum-difference-between-even-and-odd-frequency-ii.py │ ├── 3446-sort-matrix-by-diagonals.py │ ├── 3447-assign-elements-to-groups-with-constraints.py │ ├── 3452-sum-of-good-numbers.py │ ├── 3453-separate-squares-i.py │ ├── 3454-separate-squares-ii.py │ ├── 3456-find-special-substring-of-length-k.py │ ├── 3457-eat-pizzas.py │ ├── 3459-length-of-longest-v-shaped-diagonal-segment.py │ ├── 3461-check-if-digits-are-equal-in-string-after-operations-i.py │ ├── 3462-maximum-sum-with-at-most-k-elements.py │ ├── 3467-transform-array-by-parity.py │ ├── 3468-find-the-number-of-copy-arrays.py │ ├── 3471-find-the-largest-almost-missing-integer.py │ ├── 3473-sum-of-k-subarrays-with-length-at-least-m.py │ ├── 3477-fruits-into-baskets-ii.py │ ├── 3478-choose-k-elements-with-maximum-sum.py │ ├── 3479-fruits-into-baskets-iii.py │ ├── 3480-maximize-subarrays-after-removing-one-conflicting-pair.py │ ├── 3483-unique-3-digit-even-numbers.py │ ├── 3484-design-spreadsheet.py │ ├── 3487-maximum-unique-subarray-sum-after-deletion.py │ ├── 3488-closest-equal-element-queries.py │ ├── 3489-zero-array-transformation-iv.py │ ├── 3492-maximum-containers-on-a-ship.py │ ├── 3493-properties-graph.py │ ├── 3494-find-the-minimum-amount-of-time-to-brew-potions.py │ ├── 3495-minimum-operations-to-make-array-elements-zero.py │ ├── 3498-reverse-degree-of-a-string.py │ ├── 3499-maximize-active-section-with-trade-i.py │ ├── 3502-minimum-cost-to-reach-every-position.py │ ├── 3503-longest-palindrome-after-substring-concatenation-i.py │ ├── 3507-minimum-pair-removal-to-sort-array-i.py │ ├── 3508-implement-router.py │ ├── 3510-minimum-pair-removal-to-sort-array-ii.py │ ├── 3512-minimum-operations-to-make-array-sum-divisible-by-k.py │ ├── 3513-number-of-unique-xor-triplets-i.py │ ├── 3514-number-of-unique-xor-triplets-ii.py │ ├── 3516-find-closest-person.py │ ├── 3517-smallest-palindromic-rearrangement-i.py │ ├── 3519-count-numbers-with-non-decreasing-digits.py │ ├── 3522-calculate-score-after-performing-instructions.py │ ├── 3523-make-array-non-decreasing.py │ ├── 3524-find-x-value-of-array-i.py │ ├── 3527-find-the-most-common-response.py │ ├── 3528-unit-conversion-i.py │ ├── 3531-count-covered-buildings.py │ ├── 3532-path-existence-queries-in-a-graph-i.py │ ├── 3536-maximum-product-of-two-digits.py │ ├── 3537-fill-a-special-grid.py │ ├── 3539-find-sum-of-array-product-of-magical-sequences.py │ ├── 3541-find-most-frequent-vowel-and-consonant.py │ ├── 3542-minimum-operations-to-convert-all-elements-to-zero.py │ ├── 3545-minimum-deletions-for-at-most-k-distinct-characters.py │ ├── 3546-equal-sum-grid-partition-i.py │ ├── 3550-minimum-swaps-to-sort-by-digit-sum.py │ ├── 3551-smallest-index-with-digit-sum-equal-to-index.py │ ├── 3556-sum-of-largest-prime-substrings.py │ ├── 3558-number-of-ways-to-assign-edge-weights-i.py │ ├── 3560-find-minimum-log-transportation-cost.py │ ├── 3561-resulting-string-after-adjacent-removals.py │ ├── 3562-maximum-profit-from-trading-stocks-with-discounts.py │ ├── 3566-partition-array-into-two-equal-product-subsets.py │ ├── 3567-minimum-moves-to-clean-the-classroom.py │ ├── 3568-maximize-count-of-distinct-primes-after-split.py │ ├── 3569-minimum-absolute-difference-in-sliding-submatrix.py │ ├── 3573-best-time-to-buy-and-sell-stock-v.py │ ├── 3574-maximize-ysum-by-picking-a-triplet-of-distinct-xvalues.py │ ├── 3576-transform-array-to-all-equal-elements.py │ ├── 3577-count-the-number-of-computer-unlocking-permutations.py │ ├── 3578-count-partitions-with-max-min-difference-at-most-k.py │ ├── 3582-generate-tag-for-video-caption.py │ ├── 3583-count-special-triplets.py │ ├── 3584-maximum-product-of-first-and-last-elements-of-a-subsequence.py │ ├── 3587-minimum-adjacent-swaps-to-alternate-parity.py │ ├── 3588-find-maximum-area-of-a-triangle.py │ ├── 3591-check-if-any-element-has-prime-frequency.py │ ├── 3592-inverse-coin-change.py │ ├── 3593-minimum-increments-to-equalize-leaf-paths.py │ ├── 3597-partition-string.py │ ├── 3599-partition-array-to-minimize-xor.py │ ├── 3602-hexadecimal-and-hexatrigesimal-conversion.py │ ├── 3603-minimum-cost-path-with-alternating-directions-ii.py │ ├── 3604-minimum-time-to-reach-destination-in-directed-graph.py │ ├── 3606-coupon-code-validator.py │ ├── 3607-power-grid-maintenance.py │ ├── 3608-minimum-time-for-k-connected-components.py │ ├── 3612-process-string-with-special-operations-i.py │ ├── 3613-minimize-maximum-component-cost.py │ ├── 3614-process-string-with-special-operations-ii.py │ ├── 3622-check-divisibility-by-digit-sum-and-product.py │ ├── 3623-count-number-of-trapezoids-i.py │ ├── 3624-number-of-integers-with-popcount-depth-equal-to-k-ii.py │ ├── 3625-count-number-of-trapezoids-ii.py │ ├── 3627-maximum-median-sum-of-subsequences-of-size-3.py │ ├── 3628-maximum-number-of-subsequences-after-one-inserting.py │ ├── 3633-earliest-finish-time-for-land-and-water-rides-i.py │ ├── 3634-minimum-removals-to-balance-array.py │ ├── 3635-earliest-finish-time-for-land-and-water-rides-ii.py │ ├── 3637-trionic-array-i.py │ ├── 3638-maximum-balanced-shipments.py │ ├── 3640-trionic-array-ii.py │ ├── 3643-flip-square-submatrix-vertically.py │ ├── 3644-maximum-k-to-sort-a-permutation.py │ ├── 3646-next-special-palindrome-number.py │ ├── 3648-minimum-sensors-to-cover-grid.py │ ├── 3649-number-of-perfect-pairs.py │ ├── 3650-minimum-cost-path-with-edge-reversals.py │ ├── 3651-minimum-cost-path-with-teleportations.py │ ├── 3652-best-time-to-buy-and-sell-stock-using-strategy.py │ ├── 3653-xor-after-range-multiplication-queries-i.py │ ├── 3654-minimum-sum-after-divisible-sum-deletions.py │ ├── 3658-gcd-of-odd-and-even-sums.py │ ├── 3659-partition-array-into-k-distinct-groups.py │ ├── 3663-find-the-least-frequent-digit.py │ ├── 3665-twisted-mirror-path-count.py │ ├── 3668-restore-finishing-order.py │ ├── 3669-balanced-k-factor-decomposition.py │ ├── 3674-minimum-operations-to-equalize-array.py │ ├── 3675-minimum-operations-to-transform-string.py │ ├── 3676-count-bowl-subarrays.py │ ├── 3678-smallest-absent-positive-greater-than-average.py │ ├── 3679-minimum-discards-to-balance-inventory.py │ ├── 3681-maximum-xor-of-subsequences.py │ ├── 3688-bitwise-or-of-even-numbers-in-an-array.py │ ├── 3689-maximum-total-subarray-value-i.py │ ├── 3690-split-and-merge-array-transformation.py │ ├── 3692-majority-frequency-characters.py │ ├── 3693-climbing-stairs-ii.py │ ├── 3694-distinct-points-reachable-after-substring-removal.py │ ├── 3697-compute-decimal-representation.py │ ├── 3698-split-array-with-minimum-difference.py │ ├── 3701-compute-alternating-sum.py │ ├── 3702-longest-subsequence-with-non-zero-bitwise-xor.py │ ├── 3703-remove-k-balanced-substrings.py │ ├── 3707-equal-score-substrings.py │ ├── 3708-longest-fibonacci-subarray.py │ ├── 3709-design-exam-scores-tracker.py │ ├── 3712-sum-of-elements-with-frequency-divisible-by-k.py │ ├── 3713-longest-balanced-substring-i.py │ ├── 3715-sum-of-perfect-square-ancestors.py │ ├── 3718-smallest-missing-multiple-of-k.py │ ├── 3719-longest-balanced-subarray-i.py │ ├── 3720-lexicographically-smallest-permutation-greater-than-target.py │ ├── 3721-longest-balanced-subarray-ii.py │ ├── 373-find-k-pairs-with-smallest-sums.py │ ├── 3731-find-missing-elements.py │ ├── 3732-maximum-product-of-three-elements-after-one-replacement.py │ ├── 3733-minimum-time-to-complete-all-deliveries.py │ ├── 3740-minimum-distance-between-three-equal-elements-i.py │ ├── 3741-minimum-distance-between-three-equal-elements-ii.py │ ├── 3742-maximum-path-score-in-a-grid.py │ ├── 3745-maximize-expression-of-three-elements.py │ ├── 3746-minimum-string-length-after-balanced-removals.py │ ├── 3747-count-distinct-integers-after-removing-zeros.py │ ├── 3748-sort-matrix-by-diagonals.py │ ├── 3750-minimum-number-of-flips-to-reverse-binary-string.py │ ├── 3751-total-waviness-of-numbers-in-range-i.py │ ├── 3752-lexicographically-smallest-negated-permutation-that-sums-to-target.py │ ├── 3765-complete-prime-number.py │ ├── 3766-minimum-operations-to-make-binary-palindrome.py │ ├── 3767-maximize-points-after-choosing-k-tasks.py │ ├── 3769-sort-integers-by-binary-reflection.py │ ├── 3770-largest-prime-from-consecutive-prime-sum.py │ ├── 3771-total-score-of-dungeon-runs.py │ ├── 3774-absolute-difference-between-maximum-and-minimum-k-elements.py │ ├── 3775-reverse-words-with-same-vowel-count.py │ ├── 3776-minimum-moves-to-balance-circular-array.py │ ├── 3779-minimum-number-of-operations-to-have-distinct-elements.py │ ├── 3780-maximum-sum-of-three-numbers-divisible-by-three.py │ ├── 3781-maximum-score-after-binary-swaps.py │ ├── 3783-mirror-distance-of-an-integer.py │ ├── 3784-minimum-deletion-cost-to-make-all-characters-equal.py │ ├── 3785-minimum-swaps-to-avoid-forbidden-values.py │ ├── 401-binary-watch.py │ ├── 480-sliding-window-median.py │ └── 661-49-group-anagrams.py ├── Question_List_0001_1000.md ├── Question_List_1001_2000.md ├── Question_List_2001_3000.md ├── Question_List_3001_4000.md ├── README.md ├── Readme/ │ ├── 0001-two-sum.md │ ├── 0002-add-two-numbers.md │ ├── 0003-longest-substring-without-repeating-characters.md │ ├── 0004-median-of-two-sorted-arrays.md │ ├── 0005-longest-palindromic-substring.md │ ├── 0006-zigzag-conversion.md │ ├── 0007-reverse-integer.md │ ├── 0008-string-to-integer-atoi.md │ ├── 0009-palindrome-number.md │ ├── 0010-regular-expression-matching.md │ ├── 0011-container-with-most-water.md │ ├── 0012-integer-to-roman.md │ ├── 0013-roman-to-integer.md │ ├── 0014-longest-common-prefix.md │ ├── 0015-3sum.md │ ├── 0016-3sum-closest.md │ ├── 0017-letter-combinations-of-a-phone-number.md │ ├── 0018-4sum.md │ ├── 0019-remove-nth-node-from-end-of-list.md │ ├── 0020-valid-parentheses.md │ ├── 0021-merge-two-sorted-lists.md │ ├── 0022-generate-parentheses.md │ ├── 0023-merge-k-sorted-lists.md │ ├── 0024-swap-nodes-in-pairs.md │ ├── 0025-reverse-nodes-in-k-group.md │ ├── 0026-remove-duplicates-from-sorted-array.md │ ├── 0027-remove-element.md │ ├── 0028-find-the-index-of-the-first-occurrence-in-a-string.md │ ├── 0029-divide-two-integers.md │ ├── 0030-substring-with-concatenation-of-all-words.md │ ├── 0031-next-permutation.md │ ├── 0032-longest-valid-parentheses.md │ ├── 0033-search-in-rotated-sorted-array.md │ ├── 0034-find-first-and-last-position-of-element-in-sorted-array.md │ ├── 0035-search-insert-position.md │ ├── 0036-valid-sudoku.md │ ├── 0037-sudoku-solver.md │ ├── 0038-count-and-say.md │ ├── 0039-combination-sum.md │ ├── 0040-combination-sum-ii.md │ ├── 0041-first-missing-positive.md │ ├── 0042-trapping-rain-water.md │ ├── 0043-multiply-strings.md │ ├── 0044-wildcard-matching.md │ ├── 0045-jump-game-ii.md │ ├── 0046-permutations.md │ ├── 0047-permutations-ii.md │ ├── 0048-rotate-image.md │ ├── 0049-group-anagrams.md │ ├── 0050-powx-n.md │ ├── 0051-n-queens.md │ ├── 0052-n-queens-ii.md │ ├── 0053-maximum-subarray.md │ ├── 0054-spiral-matrix.md │ ├── 0055-jump-game.md │ ├── 0056-merge-intervals.md │ ├── 0057-insert-interval.md │ ├── 0058-length-of-last-word.md │ ├── 0059-spiral-matrix-ii.md │ ├── 0061-rotate-list.md │ ├── 0062-unique-paths.md │ ├── 0063-unique-paths-ii.md │ ├── 0064-minimum-path-sum.md │ ├── 0066-plus-one.md │ ├── 0067-add-binary.md │ ├── 0068-text-justification.md │ ├── 0069-sqrtx.md │ ├── 0070-climbing-stairs.md │ ├── 0071-simplify-path.md │ ├── 0072-edit-distance.md │ ├── 0073-set-matrix-zeroes.md │ ├── 0074-search-a-2d-matrix.md │ ├── 0075-sort-colors.md │ ├── 0076-minimum-window-substring.md │ ├── 0077-combinations.md │ ├── 0078-subsets.md │ ├── 0079-word-search.md │ ├── 0080-remove-duplicates-from-sorted-array-ii.md │ ├── 0081-search-in-rotated-sorted-array-ii.md │ ├── 0082-remove-duplicates-from-sorted-list-ii.md │ ├── 0083-remove-duplicates-from-sorted-list.md │ ├── 0084-largest-rectangle-in-histogram.md │ ├── 0085-maximal-rectangle.md │ ├── 0086-partition-list.md │ ├── 0087-scramble-string.md │ ├── 0088-merge-sorted-array.md │ ├── 0089-gray-code.md │ ├── 0090-subsets-ii.md │ ├── 0091-decode-ways.md │ ├── 0092-reverse-linked-list-ii.md │ ├── 0093-restore-ip-addresses.md │ ├── 0094-binary-tree-inorder-traversal.md │ ├── 0095-unique-binary-search-trees-ii.md │ ├── 0096-unique-binary-search-trees.md │ ├── 0097-interleaving-string.md │ ├── 0098-validate-binary-search-tree.md │ ├── 0099-recover-binary-search-tree.md │ ├── 0100-same-tree.md │ ├── 0101-symmetric-tree.md │ ├── 0102-binary-tree-level-order-traversal.md │ ├── 0103-binary-tree-zigzag-level-order-traversal.md │ ├── 0104-maximum-depth-of-binary-tree.md │ ├── 0105-construct-binary-tree-from-preorder-and-inorder-traversal.md │ ├── 0106-construct-binary-tree-from-inorder-and-postorder-traversal.md │ ├── 0107-binary-tree-level-order-traversal-ii.md │ ├── 0108-convert-sorted-array-to-binary-search-tree.md │ ├── 0110-balanced-binary-tree.md │ ├── 0111-minimum-depth-of-binary-tree.md │ ├── 0112-path-sum.md │ ├── 0113-path-sum-ii.md │ ├── 0114-flatten-binary-tree-to-linked-list.md │ ├── 0115-distinct-subsequences.md │ ├── 0116-populating-next-right-pointers-in-each-node.md │ ├── 0117-populating-next-right-pointers-in-each-node-ii.md │ ├── 0118-pascals-triangle.md │ ├── 0119-pascals-triangle-ii.md │ ├── 0120-triangle.md │ ├── 0121-best-time-to-buy-and-sell-stock.md │ ├── 0122-best-time-to-buy-and-sell-stock-ii.md │ ├── 0123-best-time-to-buy-and-sell-stock-iii.md │ ├── 0124-binary-tree-maximum-path-sum.md │ ├── 0125-valid-palindrome.md │ ├── 0126-word-ladder-ii.md │ ├── 0127-word-ladder.md │ ├── 0128-longest-consecutive-sequence.md │ ├── 0129-sum-root-to-leaf-numbers.md │ ├── 0130-surrounded-regions.md │ ├── 0131-palindrome-partitioning.md │ ├── 0132-palindrome-partitioning-ii.md │ ├── 0133-clone-graph.md │ ├── 0134-gas-station.md │ ├── 0135-candy.md │ ├── 0136-single-number.md │ ├── 0137-single-number-ii.md │ ├── 0138-copy-list-with-random-pointer.md │ ├── 0139-word-break.md │ ├── 0140-word-break-ii.md │ ├── 0141-linked-list-cycle.md │ ├── 0142-linked-list-cycle-ii.md │ ├── 0143-reorder-list.md │ ├── 0144-binary-tree-preorder-traversal.md │ ├── 0145-binary-tree-postorder-traversal.md │ ├── 0146-lru-cache.md │ ├── 0148-sort-list.md │ ├── 0149-max-points-on-a-line.md │ ├── 0150-evaluate-reverse-polish-notation.md │ ├── 0151-reverse-words-in-a-string.md │ ├── 0152-maximum-product-subarray.md │ ├── 0153-find-minimum-in-rotated-sorted-array.md │ ├── 0155-min-stack.md │ ├── 0159-longest-substring-with-at-most-two-distinct-characters.md │ ├── 0160-intersection-of-two-linked-lists.md │ ├── 0162-find-peak-element.md │ ├── 0166-fraction-to-recurring-decimal.md │ ├── 0167-two-sum-ii-input-array-is-sorted.md │ ├── 0168-excel-sheet-column-title.md │ ├── 0169-majority-element.md │ ├── 0170-two-sum-iii-data-structure-design.md │ ├── 0172-factorial-trailing-zeroes.md │ ├── 0173-binary-search-tree-iterator.md │ ├── 0179-largest-number.md │ ├── 0187-repeated-dna-sequences.md │ ├── 0188-best-time-to-buy-and-sell-stock-iv.md │ ├── 0189-rotate-array.md │ ├── 0190-reverse-bits.md │ ├── 0191-number-of-1-bits.md │ ├── 0197-rising-temperature.md │ ├── 0198-house-robber.md │ ├── 0199-binary-tree-right-side-view.md │ ├── 0200-number-of-islands.md │ ├── 0201-bitwise-and-of-numbers-range.md │ ├── 0202-happy-number.md │ ├── 0203-remove-linked-list-elements.md │ ├── 0205-isomorphic-strings.md │ ├── 0206-reverse-linked-list.md │ ├── 0207-course-schedule.md │ ├── 0208-implement-trie-prefix-tree.md │ ├── 0209-minimum-size-subarray-sum.md │ ├── 0210-course-schedule-ii.md │ ├── 0211-design-add-and-search-words-data-structure.md │ ├── 0212-word-search-ii.md │ ├── 0213-house-robber-ii.md │ ├── 0214-shortest-palindrome.md │ ├── 0215-kth-largest-element-in-an-array.md │ ├── 0216-combination-sum-iii.md │ ├── 0217-contains-duplicate.md │ ├── 0218-the-skyline-problem.md │ ├── 0219-contains-duplicate-ii.md │ ├── 0221-maximal-square.md │ ├── 0222-count-complete-tree-nodes.md │ ├── 0224-basic-calculator.md │ ├── 0225-implement-stack-using-queues.md │ ├── 0226-invert-binary-tree.md │ ├── 0227-basic-calculator-ii.md │ ├── 0228-summary-ranges.md │ ├── 0229-majority-element-ii.md │ ├── 0230-kth-smallest-element-in-a-bst.md │ ├── 0231-power-of-two.md │ ├── 0232-implement-queue-using-stacks.md │ ├── 0234-palindrome-linked-list.md │ ├── 0235-lowest-common-ancestor-of-a-binary-search-tree.md │ ├── 0236-lowest-common-ancestor-of-a-binary-tree.md │ ├── 0237-delete-node-in-a-linked-list.md │ ├── 0238-product-of-array-except-self.md │ ├── 0239-sliding-window-maximum.md │ ├── 0240-search-a-2d-matrix-ii.md │ ├── 0241-different-ways-to-add-parentheses.md │ ├── 0242-valid-anagram.md │ ├── 0244-shortest-word-distance-ii.md │ ├── 0246-strobogrammatic-number.md │ ├── 0249-group-shifted-strings.md │ ├── 0250-count-univalue-subtrees.md │ ├── 0252-meeting-rooms.md │ ├── 0253-meeting-rooms-ii.md │ ├── 0254-factor-combinations.md │ ├── 0255-verify-preorder-sequence-in-binary-search-tree.md │ ├── 0256-paint-house.md │ ├── 0257-binary-tree-paths.md │ ├── 0259-3sum-smaller.md │ ├── 0260-single-number-iii.md │ ├── 0261-graph-valid-tree.md │ ├── 0263-ugly-number.md │ ├── 0264-ugly-number-ii.md │ ├── 0265-paint-house-ii.md │ ├── 0266-palindrome-permutation.md │ ├── 0268-missing-number.md │ ├── 0269-alien-dictionary.md │ ├── 0270-closest-binary-search-tree-value.md │ ├── 0271-encode-and-decode-strings.md │ ├── 0272-closest-binary-search-tree-value-ii.md │ ├── 0273-integer-to-english-words.md │ ├── 0274-h-index.md │ ├── 0276-paint-fence.md │ ├── 0277-find-the-celebrity.md │ ├── 0278-first-bad-version.md │ ├── 0279-perfect-squares.md │ ├── 0283-move-zeroes.md │ ├── 0285-inorder-successor-in-bst.md │ ├── 0286-walls-and-gates.md │ ├── 0287-find-the-duplicate-number.md │ ├── 0289-game-of-life.md │ ├── 0290-word-pattern.md │ ├── 0291-word-pattern-ii.md │ ├── 0293-flip-game.md │ ├── 0295-find-median-from-data-stream.md │ ├── 0296-best-meeting-point.md │ ├── 0297-serialize-and-deserialize-binary-tree.md │ ├── 0298-binary-tree-longest-consecutive-sequence.md │ ├── 0299-bulls-and-cows.md │ ├── 0300-longest-increasing-subsequence.md │ ├── 0301-remove-invalid-parentheses.md │ ├── 0302-smallest-rectangle-enclosing-black-pixels.md │ ├── 0303-range-sum-query-immutable.md │ ├── 0304-range-sum-query-2d-immutable.md │ ├── 0305-number-of-islands-ii.md │ ├── 0307-range-sum-query-mutable.md │ ├── 0309-best-time-to-buy-and-sell-stock-with-cooldown.md │ ├── 0310-minimum-height-trees.md │ ├── 0311-sparse-matrix-multiplication.md │ ├── 0312-burst-balloons.md │ ├── 0314-binary-tree-vertical-order-traversal.md │ ├── 0315-count-of-smaller-numbers-after-self.md │ ├── 0316-remove-duplicate-letters.md │ ├── 0317-shortest-distance-from-all-buildings.md │ ├── 0320-generalized-abbreviation.md │ ├── 0322-coin-change.md │ ├── 0323-number-of-connected-components-in-an-undirected-graph.md │ ├── 0325-maximum-size-subarray-sum-equals-k.md │ ├── 0326-power-of-three.md │ ├── 0327-count-of-range-sum.md │ ├── 0328-odd-even-linked-list.md │ ├── 0329-longest-increasing-path-in-a-matrix.md │ ├── 0330-patching-array.md │ ├── 0331-verify-preorder-serialization-of-a-binary-tree.md │ ├── 0332-reconstruct-itinerary.md │ ├── 0333-largest-bst-subtree.md │ ├── 0334-increasing-triplet-subsequence.md │ ├── 0337-house-robber-iii.md │ ├── 0338-counting-bits.md │ ├── 0339-nested-list-weight-sum.md │ ├── 0340-longest-substring-with-at-most-k-distinct-characters.md │ ├── 0341-flatten-nested-list-iterator.md │ ├── 0342-power-of-four.md │ ├── 0343-integer-break.md │ ├── 0344-reverse-string.md │ ├── 0345-reverse-vowels-of-a-string.md │ ├── 0346-moving-average-from-data-stream.md │ ├── 0347-top-k-frequent-elements.md │ ├── 0348-design-tic-tac-toe.md │ ├── 0349-intersection-of-two-arrays.md │ ├── 0350-intersection-of-two-arrays-ii.md │ ├── 0351-android-unlock-patterns.md │ ├── 0352-data-stream-as-disjoint-intervals.md │ ├── 0353-domino-and-tromino-tiling.md │ ├── 0354-russian-doll-envelopes.md │ ├── 0355-design-twitter.md │ ├── 0358-rearrange-string-k-distance-apart.md │ ├── 0359-logger-rate-limiter.md │ ├── 0361-bomb-enemy.md │ ├── 0362-design-hit-counter.md │ ├── 0364-nested-list-weight-sum-ii.md │ ├── 0366-find-leaves-of-binary-tree.md │ ├── 0368-largest-divisible-subset.md │ ├── 0370-range-addition.md │ ├── 0371-sum-of-two-integers.md │ ├── 0373-find-k-pairs-with-smallest-sums.md │ ├── 0374-guess-number-higher-or-lower.md │ ├── 0377-combination-sum-iv.md │ ├── 0378-kth-smallest-element-in-a-sorted-matrix.md │ ├── 0380-insert-delete-getrandom-o1.md │ ├── 0383-ransom-note.md │ ├── 0386-lexicographical-numbers.md │ ├── 0387-first-unique-character-in-a-string.md │ ├── 0388-longest-absolute-file-path.md │ ├── 0389-find-the-difference.md │ ├── 0390-elimination-game.md │ ├── 0391-perfect-rectangle.md │ ├── 0392-is-subsequence.md │ ├── 0393-utf-8-validation.md │ ├── 0394-decode-string.md │ ├── 0395-longest-substring-with-at-least-k-repeating-characters.md │ ├── 0396-rotate-function.md │ ├── 0397-integer-replacement.md │ ├── 0398-random-pick-index.md │ ├── 0399-evaluate-division.md │ ├── 0400-nth-digit.md │ ├── 0401-binary-watch.md │ ├── 0402-remove-k-digits.md │ ├── 0403-frog-jump.md │ ├── 0404-sum-of-left-leaves.md │ ├── 0405-convert-a-number-to-hexadecimal.md │ ├── 0406-queue-reconstruction-by-height.md │ ├── 0407-trapping-rain-water-ii.md │ ├── 0408-valid-word-abbreviation.md │ ├── 0409-longest-palindrome.md │ ├── 0410-split-array-largest-sum.md │ ├── 0414-third-maximum-number.md │ ├── 0416-partition-equal-subset-sum.md │ ├── 0417-pacific-atlantic-water-flow.md │ ├── 0424-longest-repeating-character-replacement.md │ ├── 0425-word-squares.md │ ├── 0426-convert-binary-search-tree-to-sorted-doubly-linked-list.md │ ├── 0427-construct-quad-tree.md │ ├── 0432-all-oone-data-structure.md │ ├── 0433-minimum-genetic-mutation.md │ ├── 0435-non-overlapping-intervals.md │ ├── 0436-find-right-interval.md │ ├── 0437-path-sum-iii.md │ ├── 0438-find-all-anagrams-in-a-string.md │ ├── 0439-ternary-expression-parser.md │ ├── 0440-k-th-smallest-in-lexicographical-order.md │ ├── 0442-find-all-duplicates-in-an-array.md │ ├── 0443-string-compression.md │ ├── 0444-sequence-reconstruction.md │ ├── 0445-add-two-numbers-ii.md │ ├── 0446-arithmetic-slices-ii-subsequence.md │ ├── 0448-find-all-numbers-disappeared-in-an-array.md │ ├── 0449-serialize-and-deserialize-bst.md │ ├── 0450-delete-node-in-a-bst.md │ ├── 0451-sort-characters-by-frequency.md │ ├── 0452-minimum-number-of-arrows-to-burst-balloons.md │ ├── 0455-assign-cookies.md │ ├── 0456-132-pattern.md │ ├── 0457-circular-array-loop.md │ ├── 0458-poor-pigs.md │ ├── 0459-repeated-substring-pattern.md │ ├── 0460-lfu-cache.md │ ├── 0463-island-perimeter.md │ ├── 0465-optimal-account-balancing.md │ ├── 0473-matchsticks-to-square.md │ ├── 0474-ones-and-zeroes.md │ ├── 0475-heaters.md │ ├── 0476-number-complement.md │ ├── 0485-max-consecutive-ones.md │ ├── 0487-max-consecutive-ones-ii.md │ ├── 0490-the-maze.md │ ├── 0491-non-decreasing-subsequences.md │ ├── 0493-reverse-pairs.md │ ├── 0494-target-sum.md │ ├── 0496-next-greater-element-i.md │ ├── 0498-diagonal-traverse.md │ ├── 0499-the-maze-iii.md │ ├── 0501-find-mode-in-binary-search-tree.md │ ├── 0502-ipo.md │ ├── 0505-the-maze-ii.md │ ├── 0506-relative-ranks.md │ ├── 0509-fibonacci-number.md │ ├── 0510-inorder-successor-in-bst-ii.md │ ├── 0513-find-bottom-left-tree-value.md │ ├── 0514-freedom-trail.md │ ├── 0515-find-largest-value-in-each-tree-row.md │ ├── 0516-longest-palindromic-subsequence.md │ ├── 0518-coin-change-ii.md │ ├── 0523-continuous-subarray-sum.md │ ├── 0525-contiguous-array.md │ ├── 0527-word-abbreviation.md │ ├── 0528-random-pick-with-weight.md │ ├── 0530-minimum-absolute-difference-in-bst.md │ ├── 0532-k-diff-pairs-in-an-array.md │ ├── 0539-minimum-time-difference.md │ ├── 0540-single-element-in-a-sorted-array.md │ ├── 0542-01-matrix.md │ ├── 0543-diameter-of-binary-tree.md │ ├── 0545-boundary-of-binary-tree.md │ ├── 0547-number-of-provinces.md │ ├── 0549-binary-tree-longest-consecutive-sequence-ii.md │ ├── 0552-student-attendance-record-ii.md │ ├── 0557-reverse-words-in-a-string-iii.md │ ├── 0560-subarray-sum-equals-k.md │ ├── 0561-array-partition.md │ ├── 0564-find-the-closest-palindrome.md │ ├── 0566-reshape-the-matrix.md │ ├── 0567-permutation-in-string.md │ ├── 0570-managers-with-at-least-5-direct-reports.md │ ├── 0572-subtree-of-another-tree.md │ ├── 0573-squirrel-simulation.md │ ├── 0576-out-of-boundary-paths.md │ ├── 0577-employee-bonus.md │ ├── 0584-find-customer-referee.md │ ├── 0588-design-in-memory-file-system.md │ ├── 0590-n-ary-tree-postorder-traversal.md │ ├── 0592-fraction-addition-and-subtraction.md │ ├── 0594-longest-harmonious-subsequence.md │ ├── 0595-big-countries.md │ ├── 0605-can-place-flowers.md │ ├── 0606-construct-string-from-binary-tree.md │ ├── 0609-find-duplicate-file-in-system.md │ ├── 0611-valid-triangle-number.md │ ├── 0616-add-bold-tag-in-string.md │ ├── 0617-merge-two-binary-trees.md │ ├── 0620-not-boring-movies.md │ ├── 0621-task-scheduler.md │ ├── 0623-add-one-row-to-tree.md │ ├── 0624-maximum-distance-in-arrays.md │ ├── 0629-k-inverse-pairs-array.md │ ├── 0632-smallest-range-covering-elements-from-k-lists.md │ ├── 0633-sum-of-square-numbers.md │ ├── 0636-exclusive-time-of-functions.md │ ├── 0637-average-of-levels-in-binary-tree.md │ ├── 0641-design-circular-deque.md │ ├── 0643-maximum-average-subarray-i.md │ ├── 0645-set-mismatch.md │ ├── 0646-maximum-length-of-pair-chain.md │ ├── 0647-palindromic-substrings.md │ ├── 0648-replace-words.md │ ├── 0649-dota2-senate.md │ ├── 0650-2-keys-keyboard.md │ ├── 0653-two-sum-iv-input-is-a-bst.md │ ├── 0656-coin-path.md │ ├── 0658-find-k-closest-elements.md │ ├── 0661-image-smoother.md │ ├── 0662-maximum-width-of-binary-tree.md │ ├── 0663-equal-tree-partition.md │ ├── 0664-strange-printer.md │ ├── 0666-path-sum-iv.md │ ├── 0670-maximum-swap.md │ ├── 0677-map-sum-pairs.md │ ├── 0678-valid-parenthesis-string.md │ ├── 0679-24-game.md │ ├── 0680-valid-palindrome-ii.md │ ├── 0683-k-empty-slots.md │ ├── 0684-redundant-connection.md │ ├── 0689-maximum-sum-of-3-non-overlapping-subarrays.md │ ├── 0692-top-k-frequent-words.md │ ├── 0694-number-of-distinct-islands.md │ ├── 0695-max-area-of-island.md │ ├── 0700-search-in-a-binary-search-tree.md │ ├── 0701-insert-into-a-binary-search-tree.md │ ├── 0702-search-in-a-sorted-array-of-unknown-size.md │ ├── 0703-kth-largest-element-in-a-stream.md │ ├── 0704-binary-search.md │ ├── 0705-design-hashset.md │ ├── 0706-design-hashmap.md │ ├── 0712-minimum-ascii-delete-sum-for-two-strings.md │ ├── 0713-subarray-product-less-than-k.md │ ├── 0714-best-time-to-buy-and-sell-stock-with-transaction-fee.md │ ├── 0715-range-module.md │ ├── 0716-max-stack.md │ ├── 0717-1-bit-and-2-bit-characters.md │ ├── 0718-maximum-length-of-repeated-subarray.md │ ├── 0719-find-k-th-smallest-pair-distance.md │ ├── 0721-accounts-merge.md │ ├── 0723-candy-crush.md │ ├── 0724-find-pivot-index.md │ ├── 0725-split-linked-list-in-parts.md │ ├── 0726-number-of-atoms.md │ ├── 0727-minimum-window-subsequence.md │ ├── 0729-my-calendar-i.md │ ├── 0731-my-calendar-ii.md │ ├── 0733-flood-fill.md │ ├── 0734-sentence-similarity.md │ ├── 0735-asteroid-collision.md │ ├── 0737-sentence-similarity-ii.md │ ├── 0739-daily-temperatures.md │ ├── 0740-delete-and-earn.md │ ├── 0741-cherry-pickup.md │ ├── 0743-network-delay-time.md │ ├── 0744-find-smallest-letter-greater-than-target.md │ ├── 0746-min-cost-climbing-stairs.md │ ├── 0752-open-the-lock.md │ ├── 0756-pyramid-transition-matrix.md │ ├── 0757-set-intersection-size-at-least-two.md │ ├── 0758-bold-words-in-string.md │ ├── 0759-employee-free-time.md │ ├── 0763-partition-labels.md │ ├── 0767-reorganize-string.md │ ├── 0769-max-chunks-to-make-sorted.md │ ├── 0773-sliding-puzzle.md │ ├── 0774-minimize-max-distance-to-gas-station.md │ ├── 0775-global-and-local-inversions.md │ ├── 0776-split-bst.md │ ├── 0778-swim-in-rising-water.md │ ├── 0779-k-th-symbol-in-grammar.md │ ├── 0781-rabbits-in-forest.md │ ├── 0784-letter-case-permutation.md │ ├── 0786-k-th-smallest-prime-fraction.md │ ├── 0787-cheapest-flights-within-k-stops.md │ ├── 0790-domino-and-tromino-tiling.md │ ├── 0791-custom-sort-string.md │ ├── 0794-valid-tic-tac-toe-state.md │ ├── 0796-rotate-string.md │ ├── 0797-all-paths-from-source-to-target.md │ ├── 0799-champagne-tower.md │ ├── 0802-find-eventual-safe-states.md │ ├── 0807-max-increase-to-keep-city-skyline.md │ ├── 0808-soup-servings.md │ ├── 0812-largest-triangle-area.md │ ├── 0814-binary-tree-pruning.md │ ├── 0815-bus-routes.md │ ├── 0817-linked-list-components.md │ ├── 0823-binary-trees-with-factors.md │ ├── 0826-most-profit-assigning-work.md │ ├── 0827-making-a-large-island.md │ ├── 0831-masking-personal-information.md │ ├── 0832-flipping-an-image.md │ ├── 0833-find-and-replace-in-string.md │ ├── 0834-sum-of-distances-in-tree.md │ ├── 0837-new-21-game.md │ ├── 0838-push-dominoes.md │ ├── 0840-magic-squares-in-grid.md │ ├── 0841-keys-and-rooms.md │ ├── 0844-backspace-string-compare.md │ ├── 0845-longest-mountain-in-array.md │ ├── 0846-hand-of-straights.md │ ├── 0847-shortest-path-visiting-all-nodes.md │ ├── 0849-maximize-distance-to-closest-person.md │ ├── 0851-loud-and-rich.md │ ├── 0852-peak-index-in-a-mountain-array.md │ ├── 0853-car-fleet.md │ ├── 0856-score-of-parentheses.md │ ├── 0857-minimum-cost-to-hire-k-workers.md │ ├── 0860-lemonade-change.md │ ├── 0861-score-after-flipping-matrix.md │ ├── 0862-shortest-subarray-with-sum-at-least-k.md │ ├── 0863-all-nodes-distance-k-in-binary-tree.md │ ├── 0865-smallest-subtree-with-all-the-deepest-nodes.md │ ├── 0867-transpose-matrix.md │ ├── 0869-reordered-power-of-2.md │ ├── 0871-minimum-number-of-refueling-stops.md │ ├── 0872-leaf-similar-trees.md │ ├── 0873-length-of-longest-fibonacci-subsequence.md │ ├── 0874-walking-robot-simulation.md │ ├── 0875-koko-eating-bananas.md │ ├── 0876-middle-of-the-linked-list.md │ ├── 0880-decoded-string-at-index.md │ ├── 0881-boats-to-save-people.md │ ├── 0884-uncommon-words-from-two-sentences.md │ ├── 0885-spiral-matrix-iii.md │ ├── 0888-fair-candy-swap.md │ ├── 0889-construct-binary-tree-from-preorder-and-postorder-traversal.md │ ├── 0890-find-and-replace-pattern.md │ ├── 0894-all-possible-full-binary-trees.md │ ├── 0895-maximum-frequency-stack.md │ ├── 0896-monotonic-array.md │ ├── 0898-bitwise-ors-of-subarrays.md │ ├── 0900-rle-iterator.md │ ├── 0901-online-stock-span.md │ ├── 0904-fruit-into-baskets.md │ ├── 0905-sort-array-by-parity.md │ ├── 0907-sum-of-subarray-minimums.md │ ├── 0909-snakes-and-ladders.md │ ├── 0912-sort-an-array.md │ ├── 0915-partition-array-into-disjoint-intervals.md │ ├── 0916-word-subsets.md │ ├── 0918-maximum-sum-circular-subarray.md │ ├── 0920-number-of-music-playlists.md │ ├── 0921-minimum-add-to-make-parentheses-valid.md │ ├── 0924-minimize-malware-spread.md │ ├── 0930-binary-subarrays-with-sum.md │ ├── 0931-minimum-falling-path-sum.md │ ├── 0933-number-of-recent-calls.md │ ├── 0934-shortest-bridge.md │ ├── 0935-knight-dialer.md │ ├── 0938-range-sum-of-bst.md │ ├── 0939-minimum-area-rectangle.md │ ├── 0941-valid-mountain-array.md │ ├── 0944-delete-columns-to-make-sorted.md │ ├── 0945-minimum-increment-to-make-array-unique.md │ ├── 0946-validate-stack-sequences.md │ ├── 0947-most-stones-removed-with-same-row-or-column.md │ ├── 0948-bag-of-tokens.md │ ├── 0949-largest-time-for-given-digits.md │ ├── 0950-reveal-cards-in-increasing-order.md │ ├── 0951-flip-equivalent-binary-trees.md │ ├── 0953-verifying-an-alien-dictionary.md │ ├── 0954-array-of-doubled-pairs.md │ ├── 0955-delete-columns-to-make-sorted-ii.md │ ├── 0958-check-completeness-of-a-binary-tree.md │ ├── 0959-regions-cut-by-slashes.md │ ├── 0960-delete-columns-to-make-sorted-iii.md │ ├── 0961-n-repeated-element-in-size-2n-array.md │ ├── 0962-maximum-width-ramp.md │ ├── 0966-vowel-spellchecker.md │ ├── 0967-numbers-with-same-consecutive-differences.md │ ├── 0969-pancake-sorting.md │ ├── 0973-k-closest-points-to-origin.md │ ├── 0974-subarray-sums-divisible-by-k.md │ ├── 0976-largest-perimeter-triangle.md │ ├── 0977-squares-of-a-sorted-array.md │ ├── 0978-longest-turbulent-subarray.md │ ├── 0979-distribute-coins-in-binary-tree.md │ ├── 0981-time-based-key-value-store.md │ ├── 0983-minimum-cost-for-tickets.md │ ├── 0984-string-without-aaa-or-bbb.md │ ├── 0986-interval-list-intersections.md │ ├── 0987-vertical-order-traversal-of-a-binary-tree.md │ ├── 0988-smallest-string-starting-from-leaf.md │ ├── 0992-subarrays-with-k-different-integers.md │ ├── 0993-cousins-in-binary-tree.md │ ├── 0994-rotting-oranges.md │ ├── 0995-minimum-number-of-k-consecutive-bit-flips.md │ ├── 0997-find-the-town-judge.md │ ├── 0998-maximum-binary-tree-ii.md │ ├── 1002-find-common-characters.md │ ├── 1003-check-if-word-is-valid-after-substitutions.md │ ├── 1004-max-consecutive-ones-iii.md │ ├── 1006-clumsy-factorial.md │ ├── 1007-minimum-domino-rotations-for-equal-row.md │ ├── 1008-construct-binary-search-tree-from-preorder-traversal.md │ ├── 1009-complement-of-base-10-integer.md │ ├── 1010-pairs-of-songs-with-total-durations-divisible-by-60.md │ ├── 1011-capacity-to-ship-packages-within-d-days.md │ ├── 1014-best-sightseeing-pair.md │ ├── 1015-smallest-integer-divisible-by-k.md │ ├── 1018-binary-prefix-divisible-by-5.md │ ├── 1019-next-greater-node-in-linked-list.md │ ├── 1023-camelcase-matching.md │ ├── 1026-maximum-difference-between-node-and-ancestor.md │ ├── 1028-recover-a-tree-from-preorder-traversal.md │ ├── 1029-two-city-scheduling.md │ ├── 1033-moving-stones-until-consecutive.md │ ├── 1039-minimum-score-triangulation-of-polygon.md │ ├── 1041-robot-bounded-in-circle.md │ ├── 1043-partition-array-for-maximum-sum.md │ ├── 1046-last-stone-weight.md │ ├── 1047-remove-all-adjacent-duplicates-in-string.md │ ├── 1048-longest-string-chain.md │ ├── 1051-height-checker.md │ ├── 1052-grumpy-bookstore-owner.md │ ├── 1055-shortest-way-to-form-string.md │ ├── 1057-campus-bikes.md │ ├── 1060-missing-element-in-sorted-array.md │ ├── 1061-lexicographically-smallest-equivalent-string.md │ ├── 1062-longest-repeating-substring.md │ ├── 1063-number-of-valid-subarrays.md │ ├── 1065-index-pairs-of-a-string.md │ ├── 1066-campus-bikes-ii.md │ ├── 1068-product-sales-analysis-i.md │ ├── 1071-greatest-common-divisor-of-strings.md │ ├── 1072-flip-columns-for-maximum-number-of-equal-rows.md │ ├── 1074-number-of-submatrices-that-sum-to-target.md │ ├── 1075-project-employees-i.md │ ├── 1079-letter-tile-possibilities.md │ ├── 1081-smallest-subsequence-of-distinct-characters.md │ ├── 1086-high-five.md │ ├── 1087-brace-expansion.md │ ├── 1090-largest-values-from-labels.md │ ├── 1091-shortest-path-in-binary-matrix.md │ ├── 1092-shortest-common-supersequence.md │ ├── 1093-statistics-from-a-large-sample.md │ ├── 1094-car-pooling.md │ ├── 1095-find-in-mountain-array.md │ ├── 1097-stream-of-characters.md │ ├── 1099-two-sum-less-than-k.md │ ├── 1100-find-k-length-substrings-with-no-repeated-characters.md │ ├── 1101-the-earliest-moment-when-everyone-become-friends.md │ ├── 1104-path-in-zigzag-labelled-binary-tree.md │ ├── 1105-filling-bookcase-shelves.md │ ├── 1106-parsing-a-boolean-expression.md │ ├── 1109-corporate-flight-bookings.md │ ├── 1110-delete-nodes-and-return-forest.md │ ├── 1119-remove-vowels-from-a-string.md │ ├── 1120-maximum-average-subtree.md │ ├── 1121-divide-array-into-increasing-sequences.md │ ├── 1122-relative-sort-array.md │ ├── 1123-lowest-common-ancestor-of-deepest-leaves.md │ ├── 1128-number-of-equivalent-domino-pairs.md │ ├── 1133-largest-unique-number.md │ ├── 1135-connecting-cities-with-minimum-cost.md │ ├── 1136-parallel-courses.md │ ├── 1137-n-th-tribonacci-number.md │ ├── 1138-alphabet-board-path.md │ ├── 1140-stone-game-ii.md │ ├── 1143-longest-common-subsequence.md │ ├── 1144-decrease-elements-to-make-array-zigzag.md │ ├── 1146-snapshot-array.md │ ├── 1148-article-views-i.md │ ├── 1150-check-if-a-number-is-majority-element-in-a-sorted-array.md │ ├── 1151-minimum-swaps-to-group-all-1s-together.md │ ├── 1152-analyze-user-website-visit-pattern.md │ ├── 1155-number-of-dice-rolls-with-target-sum.md │ ├── 1160-find-words-that-can-be-formed-by-characters.md │ ├── 1161-maximum-level-sum-of-a-binary-tree.md │ ├── 1165-single-row-keyboard.md │ ├── 1166-design-file-system.md │ ├── 1167-minimum-cost-to-connect-sticks.md │ ├── 1168-optimize-water-distribution-in-a-village.md │ ├── 1170-compare-strings-by-frequency-of-the-smallest-character.md │ ├── 1171-remove-zero-sum-consecutive-nodes-from-linked-list.md │ ├── 1176-diet-plan-performance.md │ ├── 1181-before-and-after-puzzle.md │ ├── 1182-shortest-distance-to-target-color.md │ ├── 1183-maximum-number-of-ones.md │ ├── 1190-reverse-substrings-between-each-pair-of-parentheses.md │ ├── 1192-critical-connections-in-a-network.md │ ├── 1197-minimum-knight-moves.md │ ├── 1198-find-smallest-common-element-in-all-rows.md │ ├── 1199-minimum-time-to-build-blocks.md │ ├── 1200-minimum-absolute-difference.md │ ├── 1202-smallest-string-with-swaps.md │ ├── 1203-sort-items-by-groups-respecting-dependencies.md │ ├── 1207-unique-number-of-occurrences.md │ ├── 1208-get-equal-substrings-within-budget.md │ ├── 1209-remove-all-adjacent-duplicates-in-string-ii.md │ ├── 1213-intersection-of-three-sorted-arrays.md │ ├── 1214-two-sum-bsts.md │ ├── 1216-valid-palindrome-iii.md │ ├── 1219-path-with-maximum-gold.md │ ├── 1220-count-vowels-permutation.md │ ├── 1222-queens-that-can-attack-the-king.md │ ├── 1229-meeting-scheduler.md │ ├── 1230-toss-strange-coins.md │ ├── 1233-remove-sub-folders-from-the-filesystem.md │ ├── 1235-maximum-profit-in-job-scheduling.md │ ├── 1239-maximum-length-of-a-concatenated-string-with-unique-characters.md │ ├── 1244-design-a-leaderboard.md │ ├── 1245-tree-diameter.md │ ├── 1248-count-number-of-nice-subarrays.md │ ├── 1249-minimum-remove-to-make-valid-parentheses.md │ ├── 1251-average-selling-price.md │ ├── 1253-reconstruct-a-2-row-binary-matrix.md │ ├── 1254-number-of-closed-islands.md │ ├── 1255-maximum-score-words-formed-by-letters.md │ ├── 1256-encode-number.md │ ├── 1257-smallest-common-region.md │ ├── 1261-find-elements-in-a-contaminated-binary-tree.md │ ├── 1262-greatest-sum-divisible-by-three.md │ ├── 1265-print-immutable-linked-list-in-reverse.md │ ├── 1266-minimum-time-visiting-all-points.md │ ├── 1267-count-servers-that-communicate.md │ ├── 1268-search-suggestions-system.md │ ├── 1269-number-of-ways-to-stay-in-the-same-place-after-some-steps.md │ ├── 1272-remove-interval.md │ ├── 1276-number-of-burgers-with-no-waste-of-ingredients.md │ ├── 1277-count-square-submatrices-with-all-ones.md │ ├── 1280-students-and-examinations.md │ ├── 1282-group-the-people-given-the-group-size-they-belong-to.md │ ├── 1283-find-the-smallest-divisor-given-a-threshold.md │ ├── 1287-element-appearing-more-than-25-in-sorted-array.md │ ├── 1288-remove-covered-intervals.md │ ├── 1289-minimum-falling-path-sum-ii.md │ ├── 1290-convert-binary-number-in-a-linked-list-to-integer.md │ ├── 1291-sequential-digits.md │ ├── 1292-maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold.md │ ├── 1295-find-numbers-with-even-number-of-digits.md │ ├── 1296-divide-array-in-sets-of-k-consecutive-numbers.md │ ├── 1298-maximum-candies-you-can-get-from-boxes.md │ ├── 1300-sum-of-mutated-array-closest-to-target.md │ ├── 1302-deepest-leaves-sum.md │ ├── 1304-find-n-unique-integers-sum-up-to-zero.md │ ├── 1305-all-elements-in-two-binary-search-trees.md │ ├── 1306-jump-game-iii.md │ ├── 1310-xor-queries-of-a-subarray.md │ ├── 1314-matrix-block-sum.md │ ├── 1315-sum-of-nodes-with-even-valued-grandparent.md │ ├── 1317-convert-integer-to-the-sum-of-two-no-zero-integers.md │ ├── 1318-minimum-flips-to-make-a-or-b-equal-to-c.md │ ├── 1323-maximum-69-number.md │ ├── 1324-print-words-vertically.md │ ├── 1325-delete-leaves-with-a-given-value.md │ ├── 1326-minimum-number-of-taps-to-open-to-water-a-garden.md │ ├── 1328-break-a-palindrome.md │ ├── 1329-sort-the-matrix-diagonally.md │ ├── 1331-rank-transform-of-an-array.md │ ├── 1333-filter-restaurants-by-vegan-friendly-price-and-distance.md │ ├── 1334-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance.md │ ├── 1335-minimum-difficulty-of-a-job-schedule.md │ ├── 1337-the-k-weakest-rows-in-a-matrix.md │ ├── 1338-reduce-array-size-to-the-half.md │ ├── 1339-maximum-product-of-splitted-binary-tree.md │ ├── 1343-number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold.md │ ├── 1344-angle-between-hands-of-a-clock.md │ ├── 1346-check-if-n-and-its-double-exist.md │ ├── 1347-minimum-number-of-steps-to-make-two-strings-anagram.md │ ├── 1351-count-negative-numbers-in-a-sorted-matrix.md │ ├── 1352-product-of-the-last-k-numbers.md │ ├── 1353-maximum-number-of-events-that-can-be-attended.md │ ├── 1356-sort-integers-by-the-number-of-1-bits.md │ ├── 1357-apply-discount-every-n-orders.md │ ├── 1358-number-of-substrings-containing-all-three-characters.md │ ├── 1359-count-all-valid-pickup-and-delivery-options.md │ ├── 1360-number-of-days-between-two-dates.md │ ├── 1361-validate-binary-tree-nodes.md │ ├── 1362-closest-divisors.md │ ├── 1365-how-many-numbers-are-smaller-than-the-current-number.md │ ├── 1366-rank-teams-by-votes.md │ ├── 1367-linked-list-in-binary-tree.md │ ├── 1368-minimum-cost-to-make-at-least-one-valid-path-in-a-grid.md │ ├── 1371-find-the-longest-substring-containing-vowels-in-even-counts.md │ ├── 1372-longest-zigzag-path-in-a-binary-tree.md │ ├── 1375-number-of-times-binary-string-is-prefix-aligned.md │ ├── 1376-time-needed-to-inform-all-employees.md │ ├── 1378-replace-employee-id-with-the-unique-identifier.md │ ├── 1380-lucky-numbers-in-a-matrix.md │ ├── 1381-design-a-stack-with-increment-operation.md │ ├── 1385-find-the-distance-value-between-two-arrays.md │ ├── 1387-sort-integers-by-the-power-value.md │ ├── 1390-four-divisors.md │ ├── 1394-find-lucky-integer-in-an-array.md │ ├── 1395-count-number-of-teams.md │ ├── 1396-design-underground-system.md │ ├── 1399-count-largest-group.md │ ├── 1400-construct-k-palindrome-strings.md │ ├── 1404-number-of-steps-to-reduce-a-number-in-binary-representation-to-one.md │ ├── 1405-longest-happy-string.md │ ├── 1408-string-matching-in-an-array.md │ ├── 1409-queries-on-a-permutation-with-key.md │ ├── 1410-html-entity-parser.md │ ├── 1411-number-of-ways-to-paint-n-3-grid.md │ ├── 1414-find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k.md │ ├── 1415-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n.md │ ├── 1418-display-table-of-food-orders-in-a-restaurant.md │ ├── 1420-build-array-where-you-can-find-the-maximum-exactly-k-comparisons.md │ ├── 1422-maximum-score-after-splitting-a-string.md │ ├── 1423-maximum-points-you-can-obtain-from-cards.md │ ├── 1424-diagonal-traverse-ii.md │ ├── 1425-constrained-subsequence-sum.md │ ├── 1427-perform-string-shifts.md │ ├── 1428-leftmost-column-with-at-least-a-one.md │ ├── 1429-first-unique-number.md │ ├── 1431-kids-with-the-greatest-number-of-candies.md │ ├── 1432-max-difference-you-can-get-from-changing-an-integer.md │ ├── 1433-check-if-a-string-can-break-another-string.md │ ├── 1436-destination-city.md │ ├── 1437-check-if-all-1s-are-at-least-length-k-places-away.md │ ├── 1438-longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit.md │ ├── 1441-build-an-array-with-stack-operations.md │ ├── 1442-count-triplets-that-can-form-two-arrays-of-equal-xor.md │ ├── 1447-simplified-fractions.md │ ├── 1448-count-good-nodes-in-binary-tree.md │ ├── 1451-rearrange-words-in-a-sentence.md │ ├── 1452-people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list.md │ ├── 1455-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence.md │ ├── 1456-maximum-number-of-vowels-in-a-substring-of-given-length.md │ ├── 1457-pseudo-palindromic-paths-in-a-binary-tree.md │ ├── 1458-max-dot-product-of-two-subsequences.md │ ├── 1460-make-two-arrays-equal-by-reversing-subarrays.md │ ├── 1461-check-if-a-string-contains-all-binary-codes-of-size-k.md │ ├── 1462-course-schedule-iv.md │ ├── 1464-maximum-product-of-two-elements-in-an-array.md │ ├── 1465-maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts.md │ ├── 1466-reorder-routes-to-make-all-paths-lead-to-the-city-zero.md │ ├── 1469-find-all-the-lonely-nodes.md │ ├── 1470-shuffle-the-array.md │ ├── 1471-the-k-strongest-values-in-an-array.md │ ├── 1472-design-browser-history.md │ ├── 1474-delete-n-nodes-after-m-nodes-of-a-linked-list.md │ ├── 1475-final-prices-with-a-special-discount-in-a-shop.md │ ├── 1476-subrectangle-queries.md │ ├── 1481-least-number-of-unique-integers-after-k-removals.md │ ├── 1482-minimum-number-of-days-to-make-m-bouquets.md │ ├── 1488-avoid-flood-in-the-city.md │ ├── 1489-find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree.md │ ├── 1492-the-kth-factor-of-n.md │ ├── 1493-longest-subarray-of-1s-after-deleting-one-element.md │ ├── 1496-path-crossing.md │ ├── 1497-check-if-array-pairs-are-divisible-by-k.md │ ├── 1498-number-of-subsequences-that-satisfy-the-given-sum-condition.md │ ├── 1503-last-moment-before-all-ants-fall-out-of-a-plank.md │ ├── 1508-range-sum-of-sorted-subarray-sums.md │ ├── 1509-minimum-difference-between-largest-and-smallest-value-in-three-moves.md │ ├── 1512-number-of-good-pairs.md │ ├── 1513-number-of-substrings-with-only-1s.md │ ├── 1514-path-with-maximum-probability.md │ ├── 1518-water-bottles.md │ ├── 1523-count-odd-numbers-in-an-interval-range.md │ ├── 1524-number-of-sub-arrays-with-odd-sum.md │ ├── 1525-number-of-good-ways-to-split-a-string.md │ ├── 1526-minimum-number-of-increments-on-subarrays-to-form-a-target-array.md │ ├── 1529-minimum-suffix-flips.md │ ├── 1530-number-of-good-leaf-nodes-pairs.md │ ├── 1531-string-compression-ii.md │ ├── 1534-count-good-triplets.md │ ├── 1535-find-the-winner-of-an-array-game.md │ ├── 1539-kth-missing-positive-number.md │ ├── 1544-make-the-string-great.md │ ├── 1545-find-kth-bit-in-nth-binary-string.md │ ├── 1550-three-consecutive-odds.md │ ├── 1551-minimum-operations-to-make-array-equal.md │ ├── 1552-magnetic-force-between-two-balls.md │ ├── 1557-minimum-number-of-vertices-to-reach-all-nodes.md │ ├── 1561-maximum-number-of-coins-you-can-get.md │ ├── 1568-minimum-number-of-days-to-disconnect-island.md │ ├── 1570-dot-product-of-two-sparse-vectors.md │ ├── 1574-shortest-subarray-to-be-removed-to-make-array-sorted.md │ ├── 1578-minimum-time-to-make-rope-colorful.md │ ├── 1580-put-boxes-into-the-warehouse-ii.md │ ├── 1581-customer-who-visited-but-did-not-make-any-transactions.md │ ├── 1582-special-positions-in-a-binary-matrix.md │ ├── 1584-min-cost-to-connect-all-points.md │ ├── 1590-make-sum-divisible-by-p.md │ ├── 1593-split-a-string-into-the-max-number-of-unique-substrings.md │ ├── 1598-crawler-log-folder.md │ ├── 1605-find-valid-matrix-given-row-and-column-sums.md │ ├── 1608-special-array-with-x-elements-greater-than-or-equal-x.md │ ├── 1609-even-odd-tree.md │ ├── 1611-minimum-one-bit-operations-to-make-integers-zero.md │ ├── 1614-maximum-nesting-depth-of-the-parentheses.md │ ├── 1615-maximal-network-rank.md │ ├── 1624-largest-substring-between-two-equal-characters.md │ ├── 1625-lexicographically-smallest-string-after-applying-operations.md │ ├── 1630-arithmetic-subarrays.md │ ├── 1631-path-with-minimum-effort.md │ ├── 1633-percentage-of-users-attended-a-contest.md │ ├── 1634-add-two-polynomials-represented-as-linked-lists.md │ ├── 1636-sort-array-by-increasing-frequency.md │ ├── 1639-number-of-ways-to-form-a-target-string-given-a-dictionary.md │ ├── 1641-count-sorted-vowel-strings.md │ ├── 1642-furthest-building-you-can-reach.md │ ├── 1644-lowest-common-ancestor-of-a-binary-tree-ii.md │ ├── 1647-minimum-deletions-to-make-character-frequencies-unique.md │ ├── 1650-lowest-common-ancestor-of-a-binary-tree-iii.md │ ├── 1652-defuse-the-bomb.md │ ├── 1653-minimum-deletions-to-make-string-balanced.md │ ├── 1657-determine-if-two-strings-are-close.md │ ├── 1658-minimum-operations-to-reduce-x-to-zero.md │ ├── 1660-correct-a-binary-tree.md │ ├── 1661-average-time-of-process-per-machine.md │ ├── 1662-check-if-two-string-arrays-are-equivalent.md │ ├── 1663-smallest-string-with-a-given-numeric-value.md │ ├── 1669-merge-in-between-linked-lists.md │ ├── 1671-minimum-number-of-removals-to-make-mountain-array.md │ ├── 1679-max-number-of-k-sum-pairs.md │ ├── 1683-invalid-tweets.md │ ├── 1684-count-the-number-of-consistent-strings.md │ ├── 1685-sum-of-absolute-differences-in-a-sorted-array.md │ ├── 1688-count-of-matches-in-tournament.md │ ├── 1689-partitioning-into-minimum-number-of-deci-binary-numbers.md │ ├── 1695-maximum-erasure-value.md │ ├── 1700-number-of-students-unable-to-eat-lunch.md │ ├── 1701-average-waiting-time.md │ ├── 1704-determine-if-string-halves-are-alike.md │ ├── 1706-where-will-the-ball-fall.md │ ├── 1716-calculate-money-in-leetcode-bank.md │ ├── 1717-maximum-score-from-removing-substrings.md │ ├── 1718-construct-the-lexicographically-largest-valid-sequence.md │ ├── 1721-swapping-nodes-in-a-linked-list.md │ ├── 1726-tuple-with-same-product.md │ ├── 1727-largest-submatrix-with-rearrangements.md │ ├── 1730-shortest-path-to-get-food.md │ ├── 1732-find-the-highest-altitude.md │ ├── 1733-minimum-number-of-people-to-teach.md │ ├── 1740-find-distance-in-a-binary-tree.md │ ├── 1743-restore-the-array-from-adjacent-pairs.md │ ├── 1746-maximum-subarray-sum-after-one-operation.md │ ├── 1749-maximum-absolute-sum-of-any-subarray.md │ ├── 1750-minimum-length-of-string-after-deleting-similar-ends.md │ ├── 1752-check-if-array-is-sorted-and-rotated.md │ ├── 1753-maximum-score-from-removing-stones.md │ ├── 1756-design-most-recently-used-queue.md │ ├── 1757-recyclable-and-low-fat-products.md │ ├── 1758-minimum-changes-to-make-alternating-binary-string.md │ ├── 1759-count-number-of-homogenous-substrings.md │ ├── 1760-minimum-limit-of-balls-in-a-bag.md │ ├── 1762-buildings-with-an-ocean-view.md │ ├── 1765-map-of-highest-peak.md │ ├── 1768-merge-strings-alternately.md │ ├── 1769-minimum-number-of-operations-to-move-all-balls-to-each-box.md │ ├── 1770-maximum-score-from-performing-multiplication-operations.md │ ├── 1780-check-if-number-is-a-sum-of-powers-of-three.md │ ├── 1785-minimum-elements-to-add-to-form-a-given-sum.md │ ├── 1790-check-if-one-string-swap-can-make-strings-equal.md │ ├── 1791-find-center-of-star-graph.md │ ├── 1792-maximum-average-pass-ratio.md │ ├── 1793-maximum-score-of-a-good-subarray.md │ ├── 1797-design-authentication-manager.md │ ├── 1800-maximum-ascending-subarray-sum.md │ ├── 1802-maximum-value-at-a-given-index-in-a-bounded-array.md │ ├── 1804-implement-trie-ii-prefix-tree.md │ ├── 1806-minimum-number-of-operations-to-reinitialize-a-permutation.md │ ├── 1807-evaluate-the-bracket-pairs-of-a-string.md │ ├── 1813-sentence-similarity-iii.md │ ├── 1814-count-nice-pairs-in-an-array.md │ ├── 1817-finding-the-users-active-minutes.md │ ├── 1823-find-the-winner-of-the-circular-game.md │ ├── 1828-queries-on-number-of-points-inside-a-circle.md │ ├── 1829-maximum-xor-for-each-query.md │ ├── 1833-maximum-ice-cream-bars.md │ ├── 1834-single-threaded-cpu.md │ ├── 1836-remove-duplicates-from-an-unsorted-linked-list.md │ ├── 1838-frequency-of-the-most-frequent-element.md │ ├── 1842-next-palindrome-using-same-digits.md │ ├── 1845-seat-reservation-manager.md │ ├── 1846-maximum-element-after-decreasing-and-rearranging.md │ ├── 1851-minimum-interval-to-include-each-query.md │ ├── 1852-distinct-numbers-in-each-subarray.md │ ├── 1855-maximum-distance-between-a-pair-of-values.md │ ├── 1857-largest-color-value-in-a-directed-graph.md │ ├── 1858-longest-word-with-all-prefixes.md │ ├── 1860-incremental-memory-leak.md │ ├── 1861-rotating-the-box.md │ ├── 1863-sum-of-all-subset-xor-totals.md │ ├── 1865-finding-pairs-with-a-certain-sum.md │ ├── 1870-minimum-speed-to-arrive-on-time.md │ ├── 1874-minimize-product-sum-of-two-arrays.md │ ├── 1877-minimize-maximum-pair-sum-in-array.md │ ├── 1881-maximum-value-after-insertion.md │ ├── 1885-count-pairs-in-two-arrays.md │ ├── 1887-reduction-operations-to-make-the-array-elements-equal.md │ ├── 1888-minimum-number-of-flips-to-make-the-binary-string-alternating.md │ ├── 1891-cutting-ribbons.md │ ├── 1894-find-the-student-that-will-replace-the-chalk.md │ ├── 1895-largest-magic-square.md │ ├── 1897-redistribute-characters-to-make-all-strings-equal.md │ ├── 1898-maximum-number-of-removable-characters.md │ ├── 1899-merge-triplets-to-form-target-triplet.md │ ├── 1900-the-earliest-and-latest-rounds-where-players-compete.md │ ├── 1903-largest-odd-number-in-string.md │ ├── 1904-the-number-of-full-rounds-you-have-played.md │ ├── 1905-count-sub-islands.md │ ├── 1910-remove-all-occurrences-of-a-substring.md │ ├── 1912-design-movie-rental-system.md │ ├── 1913-maximum-product-difference-between-two-pairs.md │ ├── 1915-number-of-wonderful-substrings.md │ ├── 1920-build-array-from-permutation.md │ ├── 1921-eliminate-maximum-number-of-monsters.md │ ├── 1922-count-good-numbers.md │ ├── 1925-count-square-sum-triples.md │ ├── 1926-nearest-exit-from-entrance-in-maze.md │ ├── 1929-concatenation-of-array.md │ ├── 1930-unique-length-3-palindromic-subsequences.md │ ├── 1931-painting-a-grid-with-three-different-colors.md │ ├── 1934-confirmation-rate.md │ ├── 1935-maximum-number-of-words-you-can-type.md │ ├── 1936-add-minimum-number-of-rungs.md │ ├── 1937-maximum-number-of-points-with-cost.md │ ├── 1940-longest-common-subsequence-between-sorted-arrays.md │ ├── 1942-the-number-of-the-smallest-unoccupied-chair.md │ ├── 1945-sum-of-digits-of-string-after-convert.md │ ├── 1946-largest-number-after-mutating-substring.md │ ├── 1948-delete-duplicate-folders-in-system.md │ ├── 1957-delete-characters-to-make-fancy-string.md │ ├── 1962-remove-stones-to-minimize-the-total.md │ ├── 1963-minimum-number-of-swaps-to-make-the-string-balanced.md │ ├── 1968-array-with-elements-not-equal-to-average-of-neighbors.md │ ├── 1970-last-day-where-you-can-still-cross.md │ ├── 1971-find-if-path-exists-in-graph.md │ ├── 1973-count-nodes-equal-to-sum-of-descendants.md │ ├── 1975-maximum-matrix-sum.md │ ├── 1976-number-of-ways-to-arrive-at-destination.md │ ├── 1980-find-unique-binary-string.md │ ├── 1984-minimum-difference-between-highest-and-lowest-of-k-scores.md │ ├── 1985-find-the-kth-largest-integer-in-the-array.md │ ├── 1992-find-all-groups-of-farmland.md │ ├── 2000-reverse-prefix-of-word.md │ ├── 2001-number-of-pairs-of-interchangeable-rectangles.md │ ├── 2002-maximum-product-of-the-length-of-two-palindromic-subsequences.md │ ├── 2007-find-original-array-from-doubled-array.md │ ├── 2009-minimum-number-of-operations-to-make-array-continuous.md │ ├── 2011-final-value-of-variable-after-performing-operations.md │ ├── 2012-sum-of-beauty-in-the-array.md │ ├── 2013-detect-squares.md │ ├── 2014-longest-subsequence-repeated-k-times.md │ ├── 2016-maximum-difference-between-increasing-elements.md │ ├── 2017-grid-game.md │ ├── 2022-convert-1d-array-into-2d-array.md │ ├── 2023-number-of-pairs-of-strings-with-concatenation-equal-to-target.md │ ├── 2028-find-missing-observations.md │ ├── 2033-minimum-operations-to-make-a-uni-value-grid.md │ ├── 2034-stock-price-fluctuation.md │ ├── 2035-partition-array-into-two-arrays-to-minimize-sum-difference.md │ ├── 2037-minimum-number-of-moves-to-seat-everyone.md │ ├── 2038-remove-colored-pieces-if-both-neighbors-are-the-same-color.md │ ├── 2040-kth-smallest-product-of-two-sorted-arrays.md │ ├── 2043-simple-bank-system.md │ ├── 2044-count-number-of-maximum-bitwise-or-subsets.md │ ├── 2045-second-minimum-time-to-reach-destination.md │ ├── 2048-next-greater-numerically-balanced-number.md │ ├── 2050-parallel-courses-iii.md │ ├── 2053-kth-distinct-string-in-an-array.md │ ├── 2054-two-best-non-overlapping-events.md │ ├── 2055-plates-between-candles.md │ ├── 2058-find-the-minimum-and-maximum-number-of-nodes-between-critical-points.md │ ├── 2061-number-of-spaces-cleaning-robot-cleaned.md │ ├── 2062-count-vowel-substrings-of-a-string.md │ ├── 2064-minimized-maximum-of-products-distributed-to-any-store.md │ ├── 2070-most-beautiful-item-for-each-query.md │ ├── 2071-maximum-number-of-tasks-you-can-assign.md │ ├── 2073-time-needed-to-buy-tickets.md │ ├── 2074-reverse-nodes-in-even-length-groups.md │ ├── 2077-paths-in-maze-that-lead-to-same-room.md │ ├── 2079-watering-plants.md │ ├── 2081-sum-of-k-mirror-numbers.md │ ├── 2083-substrings-that-begin-and-end-with-the-same-letter.md │ ├── 2089-find-target-indices-after-sorting-array.md │ ├── 2090-k-radius-subarray-averages.md │ ├── 2091-removing-minimum-and-maximum-from-array.md │ ├── 2092-find-all-people-with-secret.md │ ├── 2094-finding-3-digit-even-numbers.md │ ├── 2095-delete-the-middle-node-of-a-linked-list.md │ ├── 2097-valid-arrangement-of-pairs.md │ ├── 2099-find-subsequence-of-length-k-with-the-largest-sum.md │ ├── 2101-detonate-the-maximum-bombs.md │ ├── 2104-total-characters-in-string-after-transformations-i.md │ ├── 2105-watering-plants-ii.md │ ├── 2106-maximum-fruits-harvested-after-at-most-k-steps.md │ ├── 2107-number-of-unique-flavors-after-sharing-k-candies.md │ ├── 2108-find-first-palindromic-string-in-the-array.md │ ├── 2109-adding-spaces-to-a-string.md │ ├── 2110-number-of-smooth-descent-periods-of-a-stock.md │ ├── 2115-find-all-possible-recipes-from-given-supplies.md │ ├── 2116-check-if-a-parentheses-string-can-be-valid.md │ ├── 2120-execution-of-all-suffix-instructions-staying-in-a-grid.md │ ├── 2125-number-of-laser-beams-in-a-bank.md │ ├── 2127-maximum-employees-to-be-invited-to-a-meeting.md │ ├── 2130-maximum-twin-sum-of-a-linked-list.md │ ├── 2131-longest-palindrome-by-concatenating-two-letter-words.md │ ├── 2134-minimum-swaps-to-group-all-1s-together-ii.md │ ├── 2138-divide-a-string-into-groups-of-size-k.md │ ├── 2139-detect-squares.md │ ├── 2139-minimum-moves-to-reach-target-score.md │ ├── 2140-solving-questions-with-brainpower.md │ ├── 2141-maximum-running-time-of-n-computers.md │ ├── 2145-count-the-hidden-sequences.md │ ├── 2147-number-of-ways-to-divide-a-long-corridor.md │ ├── 2149-rearrange-array-elements-by-sign.md │ ├── 2150-find-all-lonely-numbers-in-the-array.md │ ├── 2154-keep-multiplying-found-values-by-two.md │ ├── 2155-all-divisions-with-the-highest-score-of-a-binary-array.md │ ├── 2161-partition-array-according-to-given-pivot.md │ ├── 2163-minimum-difference-in-sums-after-removal-of-elements.md │ ├── 2165-smallest-value-of-the-rearranged-number.md │ ├── 2168-unique-substrings-with-equal-digit-frequency.md │ ├── 2169-count-operations-to-obtain-zero.md │ ├── 2176-count-equal-and-divisible-pairs-in-an-array.md │ ├── 2177-find-three-consecutive-integers-that-sum-to-a-given-number.md │ ├── 2178-maximum-split-of-positive-even-integers.md │ ├── 2179-count-good-triplets-in-an-array.md │ ├── 2181-merge-nodes-in-between-zeros.md │ ├── 2182-construct-string-with-repeat-limit.md │ ├── 2185-counting-words-with-a-given-prefix.md │ ├── 2186-minimum-number-of-steps-to-make-two-strings-anagram-ii.md │ ├── 2191-sort-the-jumbled-numbers.md │ ├── 2192-all-ancestors-of-a-node-in-a-directed-acyclic-graph.md │ ├── 2193-minimum-number-of-moves-to-make-palindrome.md │ ├── 2196-create-binary-tree-from-descriptions.md │ ├── 2197-replace-non-coprime-numbers-in-array.md │ ├── 2200-find-all-k-distant-indices-in-an-array.md │ ├── 2201-zero-array-transformation-i.md │ ├── 2204-distance-to-a-cycle-in-undirected-graph.md │ ├── 2206-divide-array-into-equal-pairs.md │ ├── 2207-maximize-number-of-subsequences-in-a-string.md │ ├── 2208-minimum-operations-to-halve-array-sum.md │ ├── 2210-count-hills-and-valleys-in-an-array.md │ ├── 2211-count-collisions-on-a-road.md │ ├── 2214-minimum-health-to-beat-game.md │ ├── 2215-find-the-difference-of-two-arrays.md │ ├── 2216-minimum-deletions-to-make-array-beautiful.md │ ├── 2220-minimum-bit-flips-to-convert-number.md │ ├── 2221-find-triangular-sum-of-an-array.md │ ├── 2225-find-players-with-zero-or-one-losses.md │ ├── 2226-maximum-candies-allocated-to-k-children.md │ ├── 2231-largest-number-after-digit-swaps-by-parity.md │ ├── 2235-add-two-integers.md │ ├── 2240-number-of-ways-to-buy-pens-and-pencils.md │ ├── 2244-minimum-rounds-to-complete-all-tasks.md │ ├── 2246-longest-path-with-different-adjacent-characters.md │ ├── 2251-number-of-flowers-in-full-bloom.md │ ├── 2256-minimum-average-difference.md │ ├── 2257-count-unguarded-cells-in-the-grid.md │ ├── 2260-minimum-consecutive-cards-to-pick-up.md │ ├── 2262-total-appeal-of-a-string.md │ ├── 2264-largest-3-same-digit-number-in-string.md │ ├── 2265-count-nodes-equal-to-average-of-subtree.md │ ├── 2270-number-of-ways-to-split-array.md │ ├── 2273-find-resultant-array-after-removing-anagrams.md │ ├── 2274-maximum-consecutive-floors-without-special-floors.md │ ├── 2275-largest-combination-with-bitwise-and-greater-than-zero.md │ ├── 2279-maximum-bags-with-full-capacity-of-rocks.md │ ├── 2284-sender-with-largest-word-count.md │ ├── 2290-minimum-obstacle-removal-to-reach-corner.md │ ├── 2291-maximum-profit-from-trading-stocks.md │ ├── 2294-partition-array-such-that-maximum-difference-is-k.md │ ├── 2295-replace-elements-in-an-array.md │ ├── 23-merge-k-sorted-lists.md │ ├── 2300-successful-pairs-of-spells-and-potions.md │ ├── 2302-count-subarrays-with-score-less-than-k.md │ ├── 2303-calculate-amount-paid-in-taxes.md │ ├── 2310-sum-of-numbers-with-units-digit-k.md │ ├── 2311-longest-binary-subsequence-less-than-or-equal-to-k.md │ ├── 2322-minimum-score-after-removals-on-a-tree.md │ ├── 2326-spiral-matrix-iv.md │ ├── 2327-number-of-people-aware-of-a-secret.md │ ├── 2331-evaluate-boolean-binary-tree.md │ ├── 2334-subarray-with-elements-greater-than-varying-threshold.md │ ├── 2336-smallest-number-in-infinite-set.md │ ├── 2337-move-pieces-to-obtain-a-string.md │ ├── 2338-count-the-number-of-ideal-arrays.md │ ├── 2342-max-sum-of-a-pair-with-equal-sum-of-digits.md │ ├── 2348-number-of-zero-filled-subarrays.md │ ├── 2349-design-a-number-container-system.md │ ├── 2352-equal-row-and-column-pairs.md │ ├── 2353-design-a-food-rating-system.md │ ├── 2355-maximum-number-of-books-you-can-take.md │ ├── 2357-make-array-zero-by-subtracting-equal-amounts.md │ ├── 2358-maximum-number-of-groups-entering-a-competition.md │ ├── 2359-find-closest-node-to-given-two-nodes.md │ ├── 2361-minimum-costs-using-the-train-line.md │ ├── 2364-count-number-of-bad-pairs.md │ ├── 2366-minimum-replacements-to-sort-the-array.md │ ├── 2368-reachable-nodes-with-restrictions.md │ ├── 2369-check-if-there-is-a-valid-partition-for-the-array.md │ ├── 2370-longest-ideal-subsequence.md │ ├── 2371-minimize-maximum-value-in-a-grid.md │ ├── 2373-largest-local-values-in-a-matrix.md │ ├── 2374-node-with-highest-edge-score.md │ ├── 2375-construct-smallest-number-from-di-string.md │ ├── 2379-minimum-recolors-to-get-k-consecutive-black-blocks.md │ ├── 2380-time-needed-to-rearrange-a-binary-string.md │ ├── 2381-shifting-letters-ii.md │ ├── 2384-largest-palindromic-number.md │ ├── 2385-amount-of-time-for-binary-tree-to-be-infected.md │ ├── 2389-longest-subsequence-with-limited-sum.md │ ├── 2390-removing-stars-from-a-string.md │ ├── 2391-minimum-amount-of-time-to-collect-garbage.md │ ├── 2392-build-a-matrix-with-conditions.md │ ├── 2393-count-strictly-increasing-subarrays.md │ ├── 2396-strictly-palindromic-number.md │ ├── 2401-longest-nice-subarray.md │ ├── 2402-meeting-rooms-iii.md │ ├── 2405-optimal-partition-of-string.md │ ├── 2406-divide-intervals-into-minimum-number-of-groups.md │ ├── 2408-design-sql.md │ ├── 2410-maximum-matching-of-players-with-trainers.md │ ├── 2411-smallest-subarrays-with-maximum-bitwise-or.md │ ├── 2414-length-of-the-longest-alphabetical-continuous-substring.md │ ├── 2415-reverse-odd-levels-of-binary-tree.md │ ├── 2416-sum-of-prefix-scores-of-strings.md │ ├── 2418-sort-the-people.md │ ├── 2419-longest-subarray-with-maximum-bitwise-and.md │ ├── 2425-bitwise-xor-of-all-pairings.md │ ├── 2428-maximum-sum-of-an-hourglass.md │ ├── 2429-minimize-xor.md │ ├── 2433-find-the-original-array-of-prefix-xor.md │ ├── 2434-using-a-robot-to-print-the-lexicographically-smallest-string.md │ ├── 2435-paths-in-matrix-whose-sum-is-divisible-by-k.md │ ├── 2438-range-product-queries-of-powers.md │ ├── 2439-minimize-maximum-of-array.md │ ├── 2441-largest-positive-integer-that-exists-with-its-negative.md │ ├── 2442-count-number-of-distinct-integers-after-reverse-operations.md │ ├── 2443-sum-of-number-and-its-reverse.md │ ├── 2444-count-subarrays-with-fixed-bounds.md │ ├── 2452-words-within-two-edits-of-dictionary.md │ ├── 2456-most-popular-video-creator.md │ ├── 2458-height-of-binary-tree-after-subtree-removal-queries.md │ ├── 2460-apply-operations-to-an-array.md │ ├── 2461-maximum-sum-of-distinct-subarrays-with-length-k.md │ ├── 2462-total-cost-to-hire-k-workers.md │ ├── 2463-minimum-total-distance-traveled.md │ ├── 2464-minimum-subarrays-in-a-valid-split.md │ ├── 2466-count-ways-to-build-good-strings.md │ ├── 2467-most-profitable-path-in-a-tree.md │ ├── 2470-number-of-subarrays-with-lcm-equal-to-k.md │ ├── 2471-minimum-number-of-operations-to-sort-a-binary-tree-by-level.md │ ├── 2473-minimum-cost-to-buy-apples.md │ ├── 2482-difference-between-ones-and-zeros-in-row-and-column.md │ ├── 2483-minimum-penalty-for-a-shop.md │ ├── 2485-find-the-pivot-integer.md │ ├── 2486-append-characters-to-string-to-make-subsequence.md │ ├── 2490-circular-sentence.md │ ├── 2491-divide-players-into-teams-of-equal-skill.md │ ├── 2492-minimum-score-of-a-path-between-two-cities.md │ ├── 2493-divide-nodes-into-the-maximum-number-of-groups.md │ ├── 2501-longest-square-streak-in-an-array.md │ ├── 2503-maximum-number-of-points-from-grid-queries.md │ ├── 2505-bitwise-or-of-all-subsequence-sums.md │ ├── 2507-smallest-value-after-replacing-with-sum-of-prime-factors.md │ ├── 2516-take-k-of-each-character-from-left-and-right.md │ ├── 2521-distinct-prime-factors-of-product-of-array.md │ ├── 2523-closest-prime-numbers-in-range.md │ ├── 2526-find-consecutive-integers-from-a-data-stream.md │ ├── 2527-find-xor-beauty-of-array.md │ ├── 2528-maximize-the-minimum-powered-city.md │ ├── 2529-maximum-count-of-positive-integer-and-negative-integer.md │ ├── 2530-maximal-score-after-applying-k-operations.md │ ├── 2536-increment-submatrices-by-one.md │ ├── 2537-count-the-number-of-good-subarrays.md │ ├── 2539-count-the-number-of-good-subsequences.md │ ├── 2542-maximum-subsequence-score.md │ ├── 2545-sort-the-students-by-their-kth-score.md │ ├── 2551-put-marbles-in-bags.md │ ├── 2554-maximum-number-of-integers-to-choose-from-a-range-i.md │ ├── 2558-take-gifts-from-the-richest-pile.md │ ├── 2559-count-vowel-strings-in-ranges.md │ ├── 2560-house-robber-iv.md │ ├── 2561-rearranging-fruits.md │ ├── 2563-count-the-number-of-fair-pairs.md │ ├── 2566-maximum-difference-by-remapping-a-digit.md │ ├── 2570-merge-two-2d-arrays-by-summing-values.md │ ├── 2575-find-the-divisibility-array-of-a-string.md │ ├── 2577-minimum-time-to-visit-a-cell-in-a-grid.md │ ├── 2579-count-total-number-of-colored-cells.md │ ├── 2582-pass-the-pillow.md │ ├── 2583-kth-largest-sum-in-a-binary-tree.md │ ├── 2587-rearrange-array-to-maximize-prefix-score.md │ ├── 2592-maximize-greatness-of-an-array.md │ ├── 2593-find-score-of-an-array-after-marking-all-elements.md │ ├── 2594-minimum-time-to-repair-cars.md │ ├── 2596-check-knight-tour-configuration.md │ ├── 2597-the-number-of-beautiful-subsets.md │ ├── 2598-smallest-missing-non-negative-integer-after-operations.md │ ├── 2599-make-the-prefix-sum-non-negative.md │ ├── 2601-prime-subtraction-operation.md │ ├── 2602-minimum-operations-to-make-all-array-elements-equal.md │ ├── 2606-find-the-substring-with-maximum-cost.md │ ├── 2610-convert-an-array-into-a-2d-array-with-conditions.md │ ├── 2616-minimize-the-maximum-difference-of-pairs.md │ ├── 2618-check-if-object-instance-of-class.md │ ├── 2619-array-prototype-last.md │ ├── 2620-counter.md │ ├── 2621-sleep.md │ ├── 2622-cache-with-time-limit.md │ ├── 2623-memoize.md │ ├── 2624-snail-traversal.md │ ├── 2625-flatten-deeply-nested-array.md │ ├── 2626-array-reduce-transformation.md │ ├── 2627-debounce.md │ ├── 2628-json-deep-equal.md │ ├── 2629-function-composition.md │ ├── 2630-memoize-ii.md │ ├── 2631-group-by.md │ ├── 2632-curry.md │ ├── 2633-convert-object-to-json-string.md │ ├── 2634-filter-elements-from-array.md │ ├── 2635-apply-transform-over-each-element-in-array.md │ ├── 2636-promise-pool.md │ ├── 2637-promise-time-limit.md │ ├── 2640-find-the-score-of-all-prefixes-of-an-array.md │ ├── 2641-cousins-in-binary-tree-ii.md │ ├── 2642-design-graph-with-shortest-path-calculator.md │ ├── 2645-minimum-additions-to-make-valid-string.md │ ├── 2648-generate-fibonacci-sequence.md │ ├── 2649-nested-array-generator.md │ ├── 2650-design-cancellable-function.md │ ├── 2654-minimum-number-of-operations-to-make-all-array-elements-equal-to-1.md │ ├── 2657-find-the-prefix-common-array-of-two-arrays.md │ ├── 2658-maximum-number-of-fish-in-a-grid.md │ ├── 2661-first-completely-painted-row-or-column.md │ ├── 2664-the-knights-tour.md │ ├── 2665-counter-ii.md │ ├── 2666-allow-one-function-call.md │ ├── 2667-create-hello-world-function.md │ ├── 2671-frequency-tracker.md │ ├── 2674-split-a-circular-linked-list.md │ ├── 2675-array-of-objects-to-matrix.md │ ├── 2676-throttle.md │ ├── 2677-chunk-array.md │ ├── 2678-number-of-senior-citizens.md │ ├── 2679-sum-in-a-matrix.md │ ├── 2683-neighboring-bitwise-xor.md │ ├── 2684-maximum-number-of-moves-in-a-grid.md │ ├── 2685-count-the-number-of-complete-components.md │ ├── 2690-infinite-method-object.md │ ├── 2692-make-object-immutable.md │ ├── 2694-event-emitter.md │ ├── 2695-array-wrapper.md │ ├── 2696-minimum-string-length-after-removing-substrings.md │ ├── 2698-find-the-punishment-number-of-an-integer.md │ ├── 2699-modify-graph-edge-weights.md │ ├── 2703-return-length-of-arguments-passed.md │ ├── 2704-to-be-or-not-to-be.md │ ├── 2705-compact-object.md │ ├── 2706-buy-two-chocolates.md │ ├── 2707-extra-characters-in-a-string.md │ ├── 2708-maximum-strength-of-a-group.md │ ├── 2709-greatest-common-divisor-traversal.md │ ├── 2711-difference-of-number-of-distinct-values-on-diagonals.md │ ├── 2715-execute-cancellable-function-with-delay.md │ ├── 2721-execute-asynchronous-functions-in-parallel.md │ ├── 2722-join-two-arrays-by-id.md │ ├── 2723-add-two-promises.md │ ├── 2724-sort-by.md │ ├── 2725-interval-cancellation.md │ ├── 2726-calculator-with-method-chaining.md │ ├── 2727-is-object-empty.md │ ├── 2730-find-the-longest-semi-repetitive-substring.md │ ├── 2734-lexicographically-smallest-string-after-substring-operation.md │ ├── 2737-find-the-closest-marked-node.md │ ├── 2740-find-the-value-of-the-partition.md │ ├── 2742-painting-the-walls.md │ ├── 2743-count-substrings-without-repeating-character.md │ ├── 2749-minimum-operations-to-make-the-integer-zero.md │ ├── 2751-robot-collisions.md │ ├── 2761-prime-pairs-with-target-sum.md │ ├── 2762-continuous-subarrays.md │ ├── 2770-maximum-number-of-jumps-to-reach-the-last-index.md │ ├── 2771-longest-non-decreasing-subarray-from-two-arrays.md │ ├── 2772-apply-operations-to-make-all-array-elements-equal-to-zero.md │ ├── 2778-sum-of-squares-of-special-elements.md │ ├── 2779-maximum-beauty-of-an-array-after-applying-operation.md │ ├── 2780-minimum-index-of-a-valid-split.md │ ├── 2784-check-if-array-is-good.md │ ├── 2785-sort-vowels-in-a-string.md │ ├── 2787-ways-to-express-an-integer-as-sum-of-powers.md │ ├── 2788-split-strings-by-separator.md │ ├── 2789-largest-element-in-an-array-after-merge-operations.md │ ├── 2798-number-of-employees-who-met-the-target.md │ ├── 2799-count-complete-subarrays-in-an-array.md │ ├── 2802-find-the-k-th-lucky-number.md │ ├── 2806-account-balance-after-rounded-purchase.md │ ├── 2807-insert-greatest-common-divisors-in-linked-list.md │ ├── 2810-faulty-keyboard.md │ ├── 2811-check-if-it-is-possible-to-split-array.md │ ├── 2812-find-the-safest-path-in-a-grid.md │ ├── 2814-minimum-time-takes-to-reach-destination-without-drowning.md │ ├── 2816-double-a-number-represented-as-a-linked-list.md │ ├── 2818-apply-operations-to-maximize-score.md │ ├── 2824-count-pairs-whose-sum-is-less-than-target.md │ ├── 2825-make-string-a-subsequence-using-cyclic-increments.md │ ├── 2829-determine-the-minimum-sum-of-a-k-avoiding-array.md │ ├── 2832-maximal-range-that-each-element-is-maximum-in-it.md │ ├── 2833-furthest-point-from-origin.md │ ├── 2834-find-the-minimum-possible-sum-of-a-beautiful-array.md │ ├── 2838-maximum-coins-heroes-can-collect.md │ ├── 2840-check-if-strings-can-be-made-equal-with-operations-ii.md │ ├── 2841-maximum-sum-of-almost-unique-subarray.md │ ├── 2843-count-symmetric-integers.md │ ├── 2845-count-of-interesting-subarrays.md │ ├── 2849-determine-if-a-cell-is-reachable-at-a-given-time.md │ ├── 2850-minimum-moves-to-spread-stones-over-grid.md │ ├── 2852-sum-of-remoteness-of-all-cells.md │ ├── 2856-minimum-array-length-after-pair-removals.md │ ├── 2864-maximum-odd-binary-number.md │ ├── 2865-beautiful-towers-i.md │ ├── 2870-minimum-number-of-operations-to-make-array-empty.md │ ├── 2872-maximum-number-of-k-divisible-components.md │ ├── 2873-maximum-value-of-an-ordered-triplet-i.md │ ├── 2874-maximum-value-of-an-ordered-triplet-ii.md │ ├── 2894-divisible-and-non-divisible-sums-difference.md │ ├── 2895-minimum-processing-time.md │ ├── 2900-longest-unequal-adjacent-groups-subsequence-i.md │ ├── 2901-longest-unequal-adjacent-groups-subsequence-ii.md │ ├── 2904-shortest-and-lexicographically-smallest-beautiful-string.md │ ├── 2909-minimum-sum-of-mountain-triplets-ii.md │ ├── 2914-minimum-number-of-changes-to-make-binary-string-beautiful.md │ ├── 2918-minimum-equal-sum-of-two-arrays-after-replacing-zeros.md │ ├── 2923-find-champion-i.md │ ├── 2924-find-champion-ii.md │ ├── 2927-distribute-candies-among-children-iii.md │ ├── 2929-distribute-candies-among-children-ii.md │ ├── 2933-high-access-employees.md │ ├── 2938-separate-black-and-white-balls.md │ ├── 2940-find-building-where-alice-and-bob-can-meet.md │ ├── 2942-find-words-containing-character.md │ ├── 2943-maximize-area-of-square-hole-in-grid.md │ ├── 2947-count-beautiful-substrings-i.md │ ├── 2948-make-lexicographically-smallest-array-by-swapping-elements.md │ ├── 2955-number-of-same-end-substrings.md │ ├── 2957-remove-adjacent-almost-equal-characters.md │ ├── 2958-length-of-longest-subarray-with-at-most-k-frequency.md │ ├── 2961-double-modular-exponentiation.md │ ├── 2962-count-subarrays-where-max-element-appears-at-least-k-times.md │ ├── 2965-find-missing-and-repeated-values.md │ ├── 2966-divide-array-into-arrays-with-max-difference.md │ ├── 2971-find-polygon-with-the-largest-perimeter.md │ ├── 2975-maximum-square-area-by-removing-fences-from-a-field.md │ ├── 2976-minimum-cost-to-convert-string-i.md │ ├── 2977-minimum-cost-to-convert-string-ii.md │ ├── 2981-find-longest-special-substring-that-occurs-thrice-i.md │ ├── 2985-calculate-compressed-mean.md │ ├── 2997-minimum-number-of-operations-to-make-array-xor-equal-to-k.md │ ├── 2999-count-the-number-of-powerful-integers.md │ ├── 3000-maximum-area-of-longest-diagonal-rectangle.md │ ├── 3003-maximize-the-number-of-partitions-after-operations.md │ ├── 3005-count-elements-with-maximum-frequency.md │ ├── 3006-find-beautiful-indices-in-the-given-array-i.md │ ├── 3010-divide-an-array-into-subarrays-with-minimum-cost-i.md │ ├── 3011-find-if-array-can-be-sorted.md │ ├── 3013-divide-an-array-into-subarrays-with-minimum-cost-ii.md │ ├── 3016-minimum-number-of-pushes-to-type-word-ii.md │ ├── 3020-find-the-maximum-number-of-elements-in-subset.md │ ├── 3021-alice-and-bob-playing-flower-game.md │ ├── 3024-type-of-triangle.md │ ├── 3025-find-the-number-of-ways-to-place-people-i.md │ ├── 3026-maximum-good-subarray-sum.md │ ├── 3027-find-the-number-of-ways-to-place-people-ii.md │ ├── 3034-number-of-subarrays-that-match-a-pattern-i.md │ ├── 3039-apply-operations-to-make-string-empty.md │ ├── 3042-count-prefix-and-suffix-pairs-i.md │ ├── 3043-find-the-length-of-the-longest-common-prefix.md │ ├── 3047-find-the-largest-area-of-square-inside-two-rectangles.md │ ├── 3062-winner-of-the-linked-list-game.md │ ├── 3063-linked-list-frequency.md │ ├── 3066-minimum-operations-to-exceed-threshold-value-ii.md │ ├── 3068-find-the-maximum-sum-of-node-values.md │ ├── 3070-count-submatrices-with-top-left-element-and-sum-less-than-k.md │ ├── 3074-apple-redistribution-into-boxes.md │ ├── 3075-maximize-happiness-of-selected-children.md │ ├── 3084-count-substrings-starting-and-ending-with-given-character.md │ ├── 3085-minimum-deletions-to-make-string-k-special.md │ ├── 3091-apply-operations-to-make-sum-of-array-greater-than-or-equal-to-k.md │ ├── 3095-shortest-subarray-with-or-at-least-k-i.md │ ├── 3096-minimum-levels-to-gain-more-points.md │ ├── 3097-shortest-subarray-with-or-at-least-k-ii.md │ ├── 3100-water-bottles-ii.md │ ├── 3101-count-alternating-subarrays.md │ ├── 3105-longest-strictly-increasing-or-strictly-decreasing-subarray.md │ ├── 3106-lexicographically-smallest-string-after-operations-with-constraint.md │ ├── 3108-minimum-cost-walk-in-weighted-graph.md │ ├── 3110-score-of-a-string.md │ ├── 3111-minimum-rectangles-to-cover-points.md │ ├── 3115-maximum-prime-difference.md │ ├── 3121-count-the-number-of-special-characters-ii.md │ ├── 3128-right-triangles.md │ ├── 3133-minimum-array-end.md │ ├── 3136-valid-word.md │ ├── 3137-minimum-number-of-operations-to-make-word-k-periodic.md │ ├── 3147-taking-maximum-energy-from-the-mystic-dungeon.md │ ├── 3151-special-array-i.md │ ├── 3152-special-array-ii.md │ ├── 3155-maximum-number-of-upgradable-servers.md │ ├── 3159-find-occurrences-of-an-element-in-an-array.md │ ├── 3160-find-the-number-of-distinct-colors-among-the-balls.md │ ├── 3163-string-compression-iii.md │ ├── 3169-count-days-without-meetings.md │ ├── 3170-lexicographically-minimum-string-after-removing-stars.md │ ├── 3174-clear-digits.md │ ├── 3175-find-the-first-player-to-win-k-games-in-a-row.md │ ├── 3176-find-the-maximum-length-of-a-good-subsequence-i.md │ ├── 3177-find-the-maximum-length-of-a-good-subsequence-ii.md │ ├── 3179-find-the-n-th-value-after-k-seconds.md │ ├── 3186-maximum-total-damage-with-spell-casting.md │ ├── 3189-minimum-moves-to-get-a-peaceful-board.md │ ├── 3190-find-minimum-operations-to-make-all-elements-divisible-by-three.md │ ├── 3191-minimum-operations-to-make-binary-array-elements-equal-to-one-i.md │ ├── 3192-minimum-operations-to-make-binary-array-elements-equal-to-one-ii.md │ ├── 3195-find-the-minimum-area-to-cover-all-ones-i.md │ ├── 3197-find-the-minimum-area-to-cover-all-ones-ii.md │ ├── 3201-find-the-maximum-length-of-valid-subsequence-i.md │ ├── 3202-find-the-maximum-length-of-valid-subsequence-ii.md │ ├── 3203-find-minimum-diameter-after-merging-two-trees.md │ ├── 3208-alternating-groups-ii.md │ ├── 3211-generate-binary-strings-without-adjacent-zeros.md │ ├── 3217-delete-nodes-from-linked-list-present-in-array.md │ ├── 3223-minimum-length-of-string-after-operations.md │ ├── 3227-vowels-game-in-a-string.md │ ├── 3228-maximum-number-of-operations-to-move-ones-to-the-end.md │ ├── 3233-find-the-count-of-numbers-which-are-not-special.md │ ├── 3234-count-the-number-of-substrings-with-dominant-ones.md │ ├── 3239-minimum-number-of-flips-to-make-binary-grid-palindromic-i.md │ ├── 3243-shortest-distance-after-road-addition-queries-i.md │ ├── 3249-count-the-number-of-good-nodes.md │ ├── 3254-find-the-power-of-k-size-subarrays-i.md │ ├── 3259-maximum-energy-boost-from-two-drinks.md │ ├── 3264-final-array-state-after-k-multiplication-operations-i.md │ ├── 3271-hash-divided-string.md │ ├── 3272-find-the-count-of-good-integers.md │ ├── 3275-k-th-nearest-obstacle-queries.md │ ├── 3280-convert-date-to-binary.md │ ├── 3281-maximize-score-of-numbers-in-ranges.md │ ├── 3282-reach-end-of-array-with-max-score.md │ ├── 3285-find-indices-of-stable-mountains.md │ ├── 3286-find-a-safe-walk-through-a-grid.md │ ├── 3289-the-two-sneaky-numbers-of-digitville.md │ ├── 3290-maximum-multiplication-score.md │ ├── 3295-report-spam-message.md │ ├── 3296-minimum-number-of-seconds-to-make-mountain-height-zero.md │ ├── 3300-minimum-element-after-replacement-with-digit-sum.md │ ├── 3301-maximize-the-total-height-of-unique-towers.md │ ├── 3304-find-the-k-th-character-in-string-game-i.md │ ├── 3305-count-of-substrings-containing-every-vowel-and-k-consonants-i.md │ ├── 3306-count-of-substrings-containing-every-vowel-and-k-consonants-ii.md │ ├── 3307-find-the-k-th-character-in-string-game-ii.md │ ├── 3309-maximum-possible-number-by-binary-concatenation.md │ ├── 3310-remove-methods-from-project.md │ ├── 3314-construct-the-minimum-bitwise-array-i.md │ ├── 3315-construct-the-minimum-bitwise-array-ii.md │ ├── 3318-find-x-sum-of-all-k-long-subarrays-i.md │ ├── 3319-k-th-largest-perfect-subtree-size-in-binary-tree.md │ ├── 3321-find-x-sum-of-all-k-long-subarrays-ii.md │ ├── 3324-find-the-sequence-of-strings-appeared-on-the-screen.md │ ├── 3325-count-substrings-with-k-frequency-characters-i.md │ ├── 3330-find-the-original-typed-string-i.md │ ├── 3331-find-subtree-sizes-after-changes.md │ ├── 3333-find-the-original-typed-string-ii.md │ ├── 3334-find-the-maximum-factor-score-of-array.md │ ├── 3335-total-characters-in-string-after-transformations-i.md │ ├── 3337-total-characters-in-string-after-transformations-ii.md │ ├── 3340-check-balanced-string.md │ ├── 3341-find-minimum-time-to-reach-last-room-i.md │ ├── 3342-find-minimum-time-to-reach-last-room-ii.md │ ├── 3343-count-number-of-balanced-permutations.md │ ├── 3345-smallest-divisible-digit-product-i.md │ ├── 3346-maximum-frequency-of-an-element-after-performing-operations-i.md │ ├── 3347-maximum-frequency-of-an-element-after-performing-operations-ii.md │ ├── 3349-adjacent-increasing-subarrays-detection-i.md │ ├── 3350-adjacent-increasing-subarrays-detection-ii.md │ ├── 3354-make-array-elements-equal-to-zero.md │ ├── 3355-zero-array-transformation-i.md │ ├── 3356-zero-array-transformation-ii.md │ ├── 3360-stone-removal-game.md │ ├── 3361-shift-distance-between-two-strings.md │ ├── 3362-zero-array-transformation-iii.md │ ├── 3363-find-the-maximum-number-of-fruits-collected.md │ ├── 3364-minimum-positive-sum-subarray.md │ ├── 3365-rearrange-k-substrings-to-form-target-string.md │ ├── 3370-smallest-number-with-all-set-bits.md │ ├── 3371-identify-the-largest-outlier-in-an-array.md │ ├── 3372-maximize-the-number-of-target-nodes-after-connecting-trees-i.md │ ├── 3373-maximize-the-number-of-target-nodes-after-connecting-trees-ii.md │ ├── 3375-minimum-operations-to-make-array-values-equal-to-k.md │ ├── 3379-transformed-array.md │ ├── 3380-maximum-area-rectangle-with-point-constraints-i.md │ ├── 3381-maximum-subarray-sum-with-length-divisible-by-k.md │ ├── 3386-button-with-longest-push-time.md │ ├── 3387-maximize-amount-after-two-days-of-conversions.md │ ├── 3392-count-subarrays-of-length-three-with-a-condition.md │ ├── 3393-count-paths-with-the-given-xor-value.md │ ├── 3394-check-if-grid-can-be-cut-into-sections.md │ ├── 3396-minimum-number-of-operations-to-make-elements-in-array-distinct.md │ ├── 3397-maximum-number-of-distinct-elements-after-operations.md │ ├── 3402-minimum-operations-to-make-columns-strictly-increasing.md │ ├── 3403-find-the-lexicographically-largest-string-from-the-box-i.md │ ├── 3405-count-the-number-of-arrays-with-k-matching-adjacent-elements.md │ ├── 3407-substring-matching-pattern.md │ ├── 3408-design-task-manager.md │ ├── 3411-maximum-subarray-with-equal-products.md │ ├── 3412-find-mirror-score-of-a-string.md │ ├── 3417-zigzag-grid-traversal-with-skip.md │ ├── 3418-maximum-amount-of-money-robot-can-earn.md │ ├── 3423-maximum-difference-between-adjacent-elements-in-a-circular-array.md │ ├── 3424-minimum-cost-to-make-arrays-identical.md │ ├── 3427-sum-of-variable-length-subarrays.md │ ├── 3428-maximum-and-minimum-sums-of-at-most-size-k-subsequences.md │ ├── 3432-count-partitions-with-even-sum-difference.md │ ├── 3433-count-mentions-per-user.md │ ├── 3434-maximum-frequency-after-subarray-operation.md │ ├── 3438-find-valid-pair-of-adjacent-digits-in-string.md │ ├── 3439-reschedule-meetings-for-maximum-free-time-i.md │ ├── 3440-reschedule-meetings-for-maximum-free-time-i.md │ ├── 3442-maximum-difference-between-even-and-odd-frequency-i.md │ ├── 3443-maximum-manhattan-distance-after-k-changes.md │ ├── 3445-maximum-difference-between-even-and-odd-frequency-ii.md │ ├── 3446-sort-matrix-by-diagonals.md │ ├── 3447-assign-elements-to-groups-with-constraints.md │ ├── 3452-sum-of-good-numbers.md │ ├── 3453-separate-squares-i.md │ ├── 3454-separate-squares-ii.md │ ├── 3456-find-special-substring-of-length-k.md │ ├── 3457-eat-pizzas.md │ ├── 3459-length-of-longest-v-shaped-diagonal-segment.md │ ├── 3461-check-if-digits-are-equal-in-string-after-operations-i.md │ ├── 3462-maximum-sum-with-at-most-k-elements.md │ ├── 3467-transform-array-by-parity.md │ ├── 3468-find-the-number-of-copy-arrays.md │ ├── 3471-find-the-largest-almost-missing-integer.md │ ├── 3473-sum-of-k-subarrays-with-length-at-least-m.md │ ├── 3477-fruits-into-baskets-ii.md │ ├── 3478-choose-k-elements-with-maximum-sum.md │ ├── 3479-fruits-into-baskets-iii.md │ ├── 3483-unique-3-digit-even-numbers.md │ ├── 3484-design-spreadsheet.md │ ├── 3487-maximum-unique-subarray-sum-after-deletion.md │ ├── 3488-closest-equal-element-queries.md │ ├── 3489-zero-array-transformation-iv.md │ ├── 3492-maximum-containers-on-a-ship.md │ ├── 3493-properties-graph.md │ ├── 3494-find-the-minimum-amount-of-time-to-brew-potions.md │ ├── 3495-minimum-operations-to-make-array-elements-zero.md │ ├── 3498-reverse-degree-of-a-string.md │ ├── 3499-maximize-active-section-with-trade-i.md │ ├── 3502-minimum-cost-to-reach-every-position.md │ ├── 3503-longest-palindrome-after-substring-concatenation-i.md │ ├── 3507-minimum-pair-removal-to-sort-array-i.md │ ├── 3508-implement-router.md │ ├── 3510-minimum-pair-removal-to-sort-array-ii.md │ ├── 3512-minimum-operations-to-make-array-sum-divisible-by-k.md │ ├── 3513-number-of-unique-xor-triplets-i.md │ ├── 3514-number-of-unique-xor-triplets-ii.md │ ├── 3516-find-closest-person.md │ ├── 3517-smallest-palindromic-rearrangement-i.md │ ├── 3519-count-numbers-with-non-decreasing-digits.md │ ├── 3522-calculate-score-after-performing-instructions.md │ ├── 3523-make-array-non-decreasing.md │ ├── 3524-find-x-value-of-array-i.md │ ├── 3527-find-the-most-common-response.md │ ├── 3528-unit-conversion-i.md │ ├── 3531-count-covered-buildings.md │ ├── 3532-path-existence-queries-in-a-graph-i.md │ ├── 3536-maximum-product-of-two-digits.md │ ├── 3537-fill-a-special-grid.md │ ├── 3539-find-sum-of-array-product-of-magical-sequences.md │ ├── 3541-find-most-frequent-vowel-and-consonant.md │ ├── 3542-minimum-operations-to-convert-all-elements-to-zero.md │ ├── 3545-minimum-deletions-for-at-most-k-distinct-characters.md │ ├── 3546-equal-sum-grid-partition-i.md │ ├── 3550-minimum-swaps-to-sort-by-digit-sum.md │ ├── 3551-smallest-index-with-digit-sum-equal-to-index.md │ ├── 3556-sum-of-largest-prime-substrings.md │ ├── 3558-number-of-ways-to-assign-edge-weights-i.md │ ├── 3560-find-minimum-log-transportation-cost.md │ ├── 3561-resulting-string-after-adjacent-removals.md │ ├── 3562-maximum-profit-from-trading-stocks-with-discounts.md │ ├── 3566-partition-array-into-two-equal-product-subsets.md │ ├── 3567-minimum-moves-to-clean-the-classroom.md │ ├── 3568-maximize-count-of-distinct-primes-after-split.md │ ├── 3569-minimum-absolute-difference-in-sliding-submatrix.md │ ├── 3573-best-time-to-buy-and-sell-stock-v.md │ ├── 3574-maximize-ysum-by-picking-a-triplet-of-distinct-xvalues.md │ ├── 3576-transform-array-to-all-equal-elements.md │ ├── 3577-count-the-number-of-computer-unlocking-permutations.md │ ├── 3578-count-partitions-with-max-min-difference-at-most-k.md │ ├── 3582-generate-tag-for-video-caption.md │ ├── 3583-count-special-triplets.md │ ├── 3584-maximum-product-of-first-and-last-elements-of-a-subsequence.md │ ├── 3587-minimum-adjacent-swaps-to-alternate-parity.md │ ├── 3588-find-maximum-area-of-a-triangle.md │ ├── 3591-check-if-any-element-has-prime-frequency.md │ ├── 3592-inverse-coin-change.md │ ├── 3593-minimum-increments-to-equalize-leaf-paths.md │ ├── 3597-partition-string.md │ ├── 3599-partition-array-to-minimize-xor.md │ ├── 3602-hexadecimal-and-hexatrigesimal-conversion.md │ ├── 3603-minimum-cost-path-with-alternating-directions-ii.md │ ├── 3604-minimum-time-to-reach-destination-in-directed-graph.md │ ├── 3606-coupon-code-validator.md │ ├── 3607-power-grid-maintenance.md │ ├── 3608-minimum-time-for-k-connected-components.md │ ├── 3612-process-string-with-special-operations-i.md │ ├── 3613-minimize-maximum-component-cost.md │ ├── 3614-process-string-with-special-operations-ii.md │ ├── 3622-check-divisibility-by-digit-sum-and-product.md │ ├── 3623-count-number-of-trapezoids-i.md │ ├── 3624-number-of-integers-with-popcount-depth-equal-to-k-ii.md │ ├── 3625-count-number-of-trapezoids-ii.md │ ├── 3627-maximum-median-sum-of-subsequences-of-size-3.md │ ├── 3628-maximum-number-of-subsequences-after-one-inserting.md │ ├── 3633-earliest-finish-time-for-land-and-water-rides-i.md │ ├── 3634-minimum-removals-to-balance-array.md │ ├── 3635-earliest-finish-time-for-land-and-water-rides-ii.md │ ├── 3637-trionic-array-i.md │ ├── 3638-maximum-balanced-shipments.md │ ├── 3640-trionic-array-ii.md │ ├── 3643-flip-square-submatrix-vertically.md │ ├── 3644-maximum-k-to-sort-a-permutation.md │ ├── 3646-next-special-palindrome-number.md │ ├── 3648-minimum-sensors-to-cover-grid.md │ ├── 3649-number-of-perfect-pairs.md │ ├── 3650-minimum-cost-path-with-edge-reversals.md │ ├── 3651-minimum-cost-path-with-teleportations.md │ ├── 3652-best-time-to-buy-and-sell-stock-using-strategy.md │ ├── 3653-xor-after-range-multiplication-queries-i.md │ ├── 3654-minimum-sum-after-divisible-sum-deletions.md │ ├── 3658-gcd-of-odd-and-even-sums.md │ ├── 3659-partition-array-into-k-distinct-groups.md │ ├── 3663-find-the-least-frequent-digit.md │ ├── 3665-twisted-mirror-path-count.md │ ├── 3668-restore-finishing-order.md │ ├── 3669-balanced-k-factor-decomposition.md │ ├── 3674-minimum-operations-to-equalize-array.md │ ├── 3675-minimum-operations-to-transform-string.md │ ├── 3676-count-bowl-subarrays.md │ ├── 3678-smallest-absent-positive-greater-than-average.md │ ├── 3679-minimum-discards-to-balance-inventory.md │ ├── 3681-maximum-xor-of-subsequences.md │ ├── 3688-bitwise-or-of-even-numbers-in-an-array.md │ ├── 3689-maximum-total-subarray-value-i.md │ ├── 3690-split-and-merge-array-transformation.md │ ├── 3692-majority-frequency-characters.md │ ├── 3693-climbing-stairs-ii.md │ ├── 3694-distinct-points-reachable-after-substring-removal.md │ ├── 3697-compute-decimal-representation.md │ ├── 3698-split-array-with-minimum-difference.md │ ├── 3701-compute-alternating-sum.md │ ├── 3702-longest-subsequence-with-non-zero-bitwise-xor.md │ ├── 3703-remove-k-balanced-substrings.md │ ├── 3707-equal-score-substrings.md │ ├── 3708-longest-fibonacci-subarray.md │ ├── 3709-design-exam-scores-tracker.md │ ├── 3712-sum-of-elements-with-frequency-divisible-by-k.md │ ├── 3713-longest-balanced-substring-i.md │ ├── 3715-sum-of-perfect-square-ancestors.md │ ├── 3718-smallest-missing-multiple-of-k.md │ ├── 3719-longest-balanced-subarray-i.md │ ├── 3720-lexicographically-smallest-permutation-greater-than-target.md │ ├── 3721-longest-balanced-subarray-ii.md │ ├── 373-find-k-pairs-with-smallest-sums.md │ ├── 3731-find-missing-elements.md │ ├── 3732-maximum-product-of-three-elements-after-one-replacement.md │ ├── 3733-minimum-time-to-complete-all-deliveries.md │ ├── 3740-minimum-distance-between-three-equal-elements-i.md │ ├── 3741-minimum-distance-between-three-equal-elements-ii.md │ ├── 3742-maximum-path-score-in-a-grid.md │ ├── 3745-maximize-expression-of-three-elements.md │ ├── 3746-minimum-string-length-after-balanced-removals.md │ ├── 3747-count-distinct-integers-after-removing-zeros.md │ ├── 3748-sort-matrix-by-diagonals.md │ ├── 3750-minimum-number-of-flips-to-reverse-binary-string.md │ ├── 3751-total-waviness-of-numbers-in-range-i.md │ ├── 3752-lexicographically-smallest-negated-permutation-that-sums-to-target.md │ ├── 3765-complete-prime-number.md │ ├── 3766-minimum-operations-to-make-binary-palindrome.md │ ├── 3767-maximize-points-after-choosing-k-tasks.md │ ├── 3769-sort-integers-by-binary-reflection.md │ ├── 3770-largest-prime-from-consecutive-prime-sum.md │ ├── 3771-total-score-of-dungeon-runs.md │ ├── 3774-absolute-difference-between-maximum-and-minimum-k-elements.md │ ├── 3775-reverse-words-with-same-vowel-count.md │ ├── 3776-minimum-moves-to-balance-circular-array.md │ ├── 3779-minimum-number-of-operations-to-have-distinct-elements.md │ ├── 3780-maximum-sum-of-three-numbers-divisible-by-three.md │ ├── 3781-maximum-score-after-binary-swaps.md │ ├── 3783-mirror-distance-of-an-integer.md │ ├── 3784-minimum-deletion-cost-to-make-all-characters-equal.md │ ├── 3785-minimum-swaps-to-avoid-forbidden-values.md │ ├── 401-binary-watch.md │ ├── 480-sliding-window-median.md │ └── 661-49-group-anagrams.md ├── SQL/ │ ├── 0197-rising-temperature.sql │ ├── 0570-managers-with-at-least-5-direct-reports.sql │ ├── 0577-employee-bonus.sql │ ├── 0584-find-customer-referee.sql │ ├── 0595-big-countries.sql │ ├── 0620-not-boring-movies.sql │ ├── 1068-product-sales-analysis-i.sql │ ├── 1075-project-employees-i.sql │ ├── 1148-article-views-i.sql │ ├── 1251-average-selling-price.sql │ ├── 1280-students-and-examinations.sql │ ├── 1378-replace-employee-id-with-the-unique-identifier.sql │ ├── 1581-customer-who-visited-but-did-not-make-any-transactions.sql │ ├── 1633-percentage-of-users-attended-a-contest.sql │ ├── 1661-average-time-of-process-per-machine.sql │ ├── 1683-invalid-tweets.sql │ ├── 1757-recyclable-and-low-fat-products.sql │ ├── 1934-confirmation-rate.sql │ └── 2985-calculate-compressed-mean.sql ├── TypeScript/ │ ├── 0001-two-sum.ts │ ├── 2618-check-if-object-instance-of-class.ts │ ├── 2619-array-prototype-last.ts │ ├── 2620-counter.ts │ ├── 2621-sleep.ts │ ├── 2622-cache-with-time-limit.ts │ ├── 2623-memoize.ts │ ├── 2624-snail-traversal.ts │ ├── 2625-flatten-deeply-nested-array.ts │ ├── 2626-array-reduce-transformation.ts │ ├── 2627-debounce.ts │ ├── 2628-json-deep-equal.ts │ ├── 2629-function-composition.ts │ ├── 2630-memoize-ii.ts │ ├── 2631-group-by.ts │ ├── 2632-curry.ts │ ├── 2633-convert-object-to-json-string.ts │ ├── 2634-filter-elements-from-array.ts │ ├── 2635-apply-transform-over-each-element-in-array.ts │ ├── 2636-promise-pool.ts │ ├── 2637-promise-time-limit.ts │ ├── 2648-generate-fibonacci-sequence.ts │ ├── 2649-nested-array-generator.ts │ ├── 2650-design-cancellable-function.ts │ ├── 2665-counter-ii.ts │ ├── 2666-allow-one-function-call.ts │ ├── 2667-create-hello-world-function.ts │ ├── 2675-array-of-objects-to-matrix.ts │ ├── 2676-throttle.ts │ ├── 2677-chunk-array.ts │ ├── 2690-infinite-method-object.ts │ └── 2692-make-object-immutable.ts ├── organize.py ├── organize_and_clean.sh ├── package.json └── stats.json
Showing preview only (486K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (5055 symbols across 1919 files)
FILE: .github/scripts/update_leetcode.cjs
function updateLeetCodeCard (line 8) | async function updateLeetCodeCard() {
FILE: C++/0002-add-two-numbers.cpp
class Solution (line 11) | class Solution {
method ListNode (line 13) | ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
FILE: C++/0003-longest-substring-without-repeating-characters.cpp
class Solution (line 1) | class Solution {
method lengthOfLongestSubstring (line 3) | int lengthOfLongestSubstring(string s) {
FILE: C++/0009-palindrome-number.cpp
class Solution (line 1) | class Solution
method isPalindrome (line 4) | bool isPalindrome(int x)
FILE: C++/0013-roman-to-integer.cpp
class Solution (line 1) | class Solution
method romanToInt (line 4) | int romanToInt(string s)
FILE: C++/0014-longest-common-prefix.cpp
class Solution (line 1) | class Solution
method string (line 4) | string longestCommonPrefix(vector<string> &strs)
FILE: C++/0015-3sum.cpp
class Solution (line 1) | class Solution {
method twoSumII (line 2) | void twoSumII(vector<int>& nums, int i, vector<vector<int>>& res) {
method threeSum (line 18) | vector<vector<int>> threeSum(vector<int>& nums) {
FILE: C++/0019-remove-nth-node-from-end-of-list.cpp
class Solution (line 11) | class Solution {
method ListNode (line 13) | ListNode *removeNthFromEnd(ListNode *head, int n) {
FILE: C++/0020-valid-parentheses.cpp
class Solution (line 1) | class Solution
method isValid (line 4) | bool isValid(string s)
FILE: C++/0021-merge-two-sorted-lists.cpp
class Solution (line 11) | class Solution {
method ListNode (line 13) | ListNode* mergeTwoLists(ListNode* list1, ListNode* list2) {
FILE: C++/0035-search-insert-position.cpp
class Solution (line 1) | class Solution
method searchInsert (line 4) | int searchInsert(vector<int> &nums, int target)
FILE: C++/0036-valid-sudoku.cpp
class Solution (line 1) | class Solution {
method checkRow (line 2) | bool checkRow(vector<vector<char>> &board, int row) {
method checkCol (line 14) | bool checkCol(vector<vector<char>> &board, int col) {
method checkBox (line 26) | bool checkBox(vector<vector<char>> &board, int row, int col) {
method isValidSudoku (line 42) | bool isValidSudoku(vector<vector<char>> &board) {
FILE: C++/0045-jump-game-ii.cpp
class Solution (line 1) | class Solution {
method jump (line 3) | int jump(vector<int>& nums) {
FILE: C++/0046-permutations.cpp
class Solution (line 1) | class Solution {
method permute (line 3) | vector<vector<int>> permute(vector<int>& num) {
method permuteDFS (line 9) | void permuteDFS(vector<int>& num, int level, vector<int>& visited,
FILE: C++/0048-rotate-image.cpp
class Solution (line 1) | class Solution {
method rotate (line 3) | void rotate(vector<vector<int>>& matrix) {
method transpose (line 8) | void transpose(vector<vector<int>>& matrix) {
method reflect (line 19) | void reflect(vector<vector<int>>& matrix) {
FILE: C++/0054-spiral-matrix.cpp
class Solution (line 1) | class Solution {
method spiralOrder (line 3) | vector<int> spiralOrder(vector<vector<int>>& matrix) {
FILE: C++/0055-jump-game.cpp
class Solution (line 1) | class Solution {
method canJump (line 3) | bool canJump(vector<int>& nums) {
FILE: C++/0056-merge-intervals.cpp
class Solution (line 1) | class Solution {
method merge (line 3) | vector<vector<int>> merge(vector<vector<int>>& intervals) {
FILE: C++/0059-spiral-matrix-ii.cpp
class Solution (line 1) | class Solution {
method generateMatrix (line 3) | vector<vector<int>> generateMatrix(int n) {
FILE: C++/0070-climbing-stairs.cpp
class Solution (line 1) | class Solution {
method climbStairs (line 3) | int climbStairs(int n) {
FILE: C++/0074-search-a-2d-matrix.cpp
class Solution (line 1) | class Solution {
method searchMatrix (line 3) | bool searchMatrix(vector<vector<int>> &matrix, int target) {
FILE: C++/0075-sort-colors.cpp
class Solution (line 1) | class Solution {
method swap (line 2) | void swap(int *a, int *b) {
method Partition (line 7) | int Partition(vector<int> & arr, int front, int end) {
method QuickSort (line 20) | void QuickSort(vector<int> &arr, int front, int end) {
method sortColors (line 29) | void sortColors(vector<int> &nums) {
FILE: C++/0077-combinations.cpp
class Solution (line 1) | class Solution {
method findCombination (line 5) | void findCombination(int start, vector<int> &row) {
method combine (line 21) | vector<vector<int>> combine(int n, int k) {
FILE: C++/0083-remove-duplicates-from-sorted-list.cpp
class Solution (line 11) | class Solution {
method ListNode (line 13) | ListNode* deleteDuplicates(ListNode* head) {
FILE: C++/0088-merge-sorted-array.cpp
class Solution (line 1) | class Solution
method merge (line 4) | void merge(vector<int> &nums1, int m, vector<int> &nums2, int n)
FILE: C++/0094-binary-tree-inorder-traversal.cpp
class Solution (line 12) | class Solution {
method inorderTraversal (line 13) | void inorderTraversal(TreeNode *root, vector<int> &ans) {
method inorderTraversal (line 21) | vector<int> inorderTraversal(TreeNode *root) {
FILE: C++/0098-validate-binary-search-tree.cpp
class Solution (line 12) | class Solution {
method isValidBST (line 14) | bool isValidBST(TreeNode *root, TreeNode *min = NULL, TreeNode *max = ...
FILE: C++/0101-symmetric-tree.cpp
class Solution (line 12) | class Solution {
method isMirror (line 13) | bool isMirror(TreeNode *t1, TreeNode *t2) {
method isSymmetric (line 21) | bool isSymmetric(TreeNode *root) { return isMirror(root, root); }
FILE: C++/0102-binary-tree-level-order-traversal.cpp
class Solution (line 12) | class Solution {
method levelOrder (line 14) | vector<vector<int>> levelOrder(TreeNode *root) {
FILE: C++/0104-maximum-depth-of-binary-tree.cpp
class Solution (line 12) | class Solution {
method maxDepth (line 14) | int maxDepth(TreeNode *root) {
FILE: C++/0112-path-sum.cpp
class Solution (line 12) | class Solution {
method hasPathSum (line 14) | bool hasPathSum(TreeNode *root, int targetSum) {
FILE: C++/0116-populating-next-right-pointers-in-each-node.cpp
class Solution (line 19) | class Solution {
method Node (line 21) | Node* connect(Node* root) {
FILE: C++/0118-pascals-triangle.cpp
class Solution (line 1) | class Solution
method generate (line 4) | vector<vector<int> > generate(int numRows)
FILE: C++/0119-pascals-triangle-ii.cpp
class Solution (line 1) | class Solution {
method getRow (line 3) | vector<int> getRow(int rowIndex) {
FILE: C++/0120-triangle.cpp
class Solution (line 1) | class Solution {
method minimumTotal (line 3) | int minimumTotal(vector<vector<int>>& triangle) {
FILE: C++/0121-best-time-to-buy-and-sell-stock.cpp
class Solution (line 1) | class Solution
method maxProfit (line 4) | int maxProfit(vector<int> &prices)
FILE: C++/0136-single-number.cpp
class Solution (line 1) | class Solution {
method singleNumber (line 3) | int singleNumber(vector<int>& nums) {
FILE: C++/0141-linked-list-cycle.cpp
class Solution (line 9) | class Solution {
method hasCycle (line 11) | bool hasCycle(ListNode* head) {
FILE: C++/0144-binary-tree-preorder-traversal.cpp
class Solution (line 12) | class Solution {
method preorderTraversal (line 13) | void preorderTraversal(TreeNode *root, vector<int> &ans) {
method preorderTraversal (line 21) | vector<int> preorderTraversal(TreeNode *root) {
FILE: C++/0145-binary-tree-postorder-traversal.cpp
class Solution (line 12) | class Solution {
method postorderTraversal (line 13) | void postorderTraversal(TreeNode *root, vector<int> &ans) {
method postorderTraversal (line 21) | vector<int> postorderTraversal(TreeNode *root) {
FILE: C++/0167-two-sum-ii-input-array-is-sorted.cpp
class Solution (line 1) | class Solution
method twoSum (line 4) | vector<int> twoSum(vector<int> &nums, int target)
FILE: C++/0169-majority-element.cpp
class Solution (line 1) | class Solution {
method majorityElement (line 3) | int majorityElement(vector<int>& nums) {
FILE: C++/0189-rotate-array.cpp
class Solution (line 1) | class Solution
method rotate (line 4) | void rotate(vector<int> &nums, int k)
FILE: C++/0190-reverse-bits.cpp
class Solution (line 1) | class Solution {
method reverseBits (line 3) | uint32_t reverseBits(uint32_t n) {
FILE: C++/0191-number-of-1-bits.cpp
class Solution (line 1) | class Solution {
method hammingWeight (line 3) | int hammingWeight(uint32_t n) {
FILE: C++/0198-house-robber.cpp
class Solution (line 1) | class Solution {
method rob (line 3) | int rob(vector<int>& nums) {
FILE: C++/0203-remove-linked-list-elements.cpp
class Solution (line 11) | class Solution {
method ListNode (line 13) | ListNode* removeElements(ListNode* head, int val) {
FILE: C++/0206-reverse-linked-list.cpp
class Solution (line 11) | class Solution {
method ListNode (line 13) | ListNode* reverseList(ListNode* head) {
FILE: C++/0213-house-robber-ii.cpp
class Solution (line 1) | class Solution {
method rob_simple (line 2) | int rob_simple(vector<int>& nums, int start, int end) {
method rob (line 15) | int rob(vector<int>& nums) {
FILE: C++/0217-contains-duplicate.cpp
class Solution (line 1) | class Solution
method containsDuplicate (line 4) | bool containsDuplicate(vector<int> &nums)
FILE: C++/0231-power-of-two.cpp
class Solution (line 1) | class Solution {
method isPowerOfTwo (line 3) | bool isPowerOfTwo(int n) {
FILE: C++/0232-implement-queue-using-stacks.cpp
class MyQueue (line 1) | class MyQueue {
method push (line 6) | void push(int x) { stack_q.push(x); }
method pop (line 7) | int pop() {
method peek (line 18) | int peek() {
method empty (line 31) | bool empty() {
FILE: C++/0235-lowest-common-ancestor-of-a-binary-search-tree.cpp
class Solution (line 11) | class Solution {
method TreeNode (line 13) | TreeNode *lowestCommonAncestor(TreeNode *root, TreeNode *p, TreeNode *...
FILE: C++/0242-valid-anagram.cpp
class Solution (line 1) | class Solution {
method isAnagram (line 3) | bool isAnagram(string s, string t) {
FILE: C++/0278-first-bad-version.cpp
class Solution (line 4) | class Solution
method firstBadVersion (line 7) | int firstBadVersion(int n)
FILE: C++/0283-move-zeroes.cpp
class Solution (line 1) | class Solution
method moveZeroes (line 4) | void moveZeroes(vector<int> &nums)
FILE: C++/0344-reverse-string.cpp
class Solution (line 1) | class Solution {
method reverseString (line 3) | void reverseString(vector<char>& s) {
FILE: C++/0350-intersection-of-two-arrays-ii.cpp
class Solution (line 1) | class Solution
method intersect (line 4) | vector<int> intersect(vector<int> &nums1, vector<int> &nums2)
FILE: C++/0383-ransom-note.cpp
class Solution (line 1) | class Solution {
method canConstruct (line 3) | bool canConstruct(string ransomNote, string magazine) {
FILE: C++/0387-first-unique-character-in-a-string.cpp
class Solution (line 1) | class Solution {
method firstUniqChar (line 3) | int firstUniqChar(string s) {
FILE: C++/0509-fibonacci-number.cpp
class Solution (line 1) | class Solution {
method fib (line 3) | int fib(int n) {
FILE: C++/0542-01-matrix.cpp
class Solution (line 1) | class Solution {
method updateMatrix (line 3) | vector<vector<int>> updateMatrix(vector<vector<int>>& matrix) {
FILE: C++/0557-reverse-words-in-a-string-iii.cpp
class Solution (line 1) | class Solution {
method reverseString (line 2) | void reverseString(vector<char>& s) {
method string (line 12) | string reverseWords(string s) {
FILE: C++/0566-reshape-the-matrix.cpp
class Solution (line 1) | class Solution
method matrixReshape (line 4) | vector<vector<int> > matrixReshape(vector<vector<int> > &nums, int r, ...
FILE: C++/0567-permutation-in-string.cpp
class Solution (line 1) | class Solution {
method matches (line 2) | bool matches(int map1[],int map2[]){
method checkInclusion (line 11) | bool checkInclusion(string s1, string s2) {
FILE: C++/0617-merge-two-binary-trees.cpp
class Solution (line 12) | class Solution {
method TreeNode (line 14) | TreeNode *mergeTrees(TreeNode *root1, TreeNode *root2) {
FILE: C++/0653-two-sum-iv-input-is-a-bst.cpp
class Solution (line 12) | class Solution {
method Inorder (line 13) | void Inorder(TreeNode *current, vector<int> &output) {
method findTarget (line 23) | bool findTarget(TreeNode *root, int k) {
FILE: C++/0695-max-area-of-island.cpp
class Solution (line 1) | class Solution {
method findPath (line 2) | int findPath(vector<vector<int>>& grid, int x, int y) {
method maxAreaOfIsland (line 24) | int maxAreaOfIsland(vector<vector<int>>& grid) {
FILE: C++/0700-search-in-a-binary-search-tree.cpp
class Solution (line 12) | class Solution {
method TreeNode (line 14) | TreeNode *searchBST(TreeNode *root, int val) {
FILE: C++/0701-insert-into-a-binary-search-tree.cpp
class Solution (line 12) | class Solution {
method TreeNode (line 14) | TreeNode *insertIntoBST(TreeNode *root, int val) {
FILE: C++/0704-binary-search.cpp
class Solution (line 1) | class Solution
method search (line 4) | int search(vector<int> &nums, int target)
FILE: C++/0706-design-hashmap.cpp
class MyHashMap (line 1) | class MyHashMap {
method hash (line 3) | int hash(int key) { return key % size; }
method myFind (line 5) | list<pair<int, int>>::iterator myFind(int index, int key) {
method MyHashMap (line 11) | MyHashMap() : myhashmap(size, list<pair<int,int>>()) {}
method put (line 12) | void put(int key, int value) {
method get (line 21) | int get(int key) {
method remove (line 30) | void remove(int key) {
FILE: C++/0733-flood-fill.cpp
class Solution (line 1) | class Solution {
method floodFill (line 3) | vector<vector<int>> floodFill(vector<vector<int>>& image, int sr, int ...
FILE: C++/0746-min-cost-climbing-stairs.cpp
class Solution (line 1) | class Solution {
method minCostClimbingStairs (line 3) | int minCostClimbingStairs(vector<int>& cost) {
FILE: C++/0784-letter-case-permutation.cpp
class Solution (line 1) | class Solution {
method letterCasePermutation (line 3) | vector<string> letterCasePermutation(string S) {
FILE: C++/0876-middle-of-the-linked-list.cpp
class Solution (line 11) | class Solution {
method ListNode (line 13) | ListNode* middleNode(ListNode* head) {
FILE: C++/0977-squares-of-a-sorted-array.cpp
class Solution (line 1) | class Solution
method sortedSquares (line 4) | vector<int> sortedSquares(vector<int> &nums)
FILE: C++/0994-rotting-oranges.cpp
class Solution (line 1) | class Solution {
method orangesRotting (line 3) | int orangesRotting(vector<vector<int>>& grid) {
FILE: C++/1137-n-th-tribonacci-number.cpp
class Solution (line 1) | class Solution {
method tribonacci (line 3) | int tribonacci(int n) {
FILE: C++/1265-print-immutable-linked-list-in-reverse.cpp
class Solution (line 11) | class Solution
method printLinkedListInReverse (line 14) | void printLinkedListInReverse(ImmutableListNode *head)
FILE: C++/1920-build-array-from-permutation.cpp
class Solution (line 1) | class Solution
method buildArray (line 4) | vector<int> buildArray(vector<int> &nums)
FILE: JavaScript/0094-binary-tree-inorder-traversal.js
function inorder (line 17) | function inorder(node) {
FILE: JavaScript/0104-maximum-depth-of-binary-tree.js
function longestPath (line 14) | function longestPath(node) {
FILE: JavaScript/0144-binary-tree-preorder-traversal.js
function preorder (line 15) | function preorder(node) {
FILE: JavaScript/0145-binary-tree-postorder-traversal.js
function postorder (line 15) | function postorder(node) {
FILE: JavaScript/0226-invert-binary-tree.js
function TreeNode (line 2) | function TreeNode(val, left, right) {
function printBinaryTree (line 29) | function printBinaryTree(root) {
FILE: JavaScript/0572-subtree-of-another-tree.js
function isSameTree (line 15) | function isSameTree(root1, root2) {
function dfs (line 28) | function dfs(node) {
FILE: JavaScript/2621-sleep.js
function sleep (line 4) | async function sleep(millis) {
FILE: JavaScript/2623-memoize.js
function memoize (line 4) | function memoize(fn) {
FILE: JavaScript/2636-promise-pool.js
function helper (line 10) | function helper() {
FILE: JavaScript/2694-event-emitter.js
class EventEmitter (line 1) | class EventEmitter {
method constructor (line 2) | constructor() {
method subscribe (line 6) | subscribe(event, cb) {
method emit (line 21) | emit(event, args = []) {
FILE: JavaScript/2705-compact-object.js
function dfs (line 2) | function dfs(obj) {
FILE: JavaScript/2726-calculator-with-method-chaining.js
class Calculator (line 1) | class Calculator {
method constructor (line 2) | constructor(value) {
method add (line 5) | add(value) {
method subtract (line 9) | subtract(value) {
method multiply (line 13) | multiply(value) {
method divide (line 17) | divide(value) {
method power (line 22) | power(value) {
method getResult (line 26) | getResult() {
FILE: Python/0001-two-sum.py
class Solution (line 7) | class Solution:
method twoSum (line 8) | def twoSum(self, nums: List[int], target: int) -> List[int]:
method twoSum (line 19) | def twoSum(self, nums: List[int], target: int) -> List[int]:
method twoSum (line 34) | def twoSum(self, nums: List[int], target: int) -> List[List[int]]:
class Solution (line 18) | class Solution(object):
method twoSum (line 8) | def twoSum(self, nums: List[int], target: int) -> List[int]:
method twoSum (line 19) | def twoSum(self, nums: List[int], target: int) -> List[int]:
method twoSum (line 34) | def twoSum(self, nums: List[int], target: int) -> List[List[int]]:
class Solution (line 33) | class Solution(object):
method twoSum (line 8) | def twoSum(self, nums: List[int], target: int) -> List[int]:
method twoSum (line 19) | def twoSum(self, nums: List[int], target: int) -> List[int]:
method twoSum (line 34) | def twoSum(self, nums: List[int], target: int) -> List[List[int]]:
FILE: Python/0002-add-two-numbers.py
class Solution (line 7) | class Solution:
method addTwoNumbers (line 8) | def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]...
FILE: Python/0003-longest-substring-without-repeating-characters.py
class Solution (line 6) | class Solution:
method lengthOfLongestSubstring (line 7) | def lengthOfLongestSubstring(self, s: str) -> int:
FILE: Python/0004-median-of-two-sorted-arrays.py
class Solution (line 6) | class Solution:
method findMedianSortedArrays (line 7) | def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -...
method findMedianSortedArrays (line 39) | def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -...
class Solution (line 38) | class Solution:
method findMedianSortedArrays (line 7) | def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -...
method findMedianSortedArrays (line 39) | def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -...
FILE: Python/0005-longest-palindromic-substring.py
class Solution (line 4) | class Solution:
method longestPalindrome (line 5) | def longestPalindrome(self, s: str) -> str:
method longestPalindrome (line 36) | def longestPalindrome(self, s: str) -> str:
method longestPalindrome (line 56) | def longestPalindrome(self, s: str) -> str:
class Solution (line 35) | class Solution:
method longestPalindrome (line 5) | def longestPalindrome(self, s: str) -> str:
method longestPalindrome (line 36) | def longestPalindrome(self, s: str) -> str:
method longestPalindrome (line 56) | def longestPalindrome(self, s: str) -> str:
class Solution (line 55) | class Solution:
method longestPalindrome (line 5) | def longestPalindrome(self, s: str) -> str:
method longestPalindrome (line 36) | def longestPalindrome(self, s: str) -> str:
method longestPalindrome (line 56) | def longestPalindrome(self, s: str) -> str:
FILE: Python/0006-zigzag-conversion.py
class Solution (line 3) | class Solution:
method convert (line 4) | def convert(self, s: str, numRows: int) -> str:
FILE: Python/0007-reverse-integer.py
class Solution (line 3) | class Solution:
method reverse (line 4) | def reverse(self, x: int) -> int:
FILE: Python/0008-string-to-integer-atoi.py
class Solution (line 1) | class Solution:
method myAtoi (line 2) | def myAtoi(self, s: str) -> int:
FILE: Python/0010-regular-expression-matching.py
class Solution (line 6) | class Solution(object):
method isMatch (line 7) | def isMatch(self, text: str, pattern: str) -> bool:
method isMatch (line 19) | def isMatch(self, text: str, pattern: str) -> bool:
method isMatch (line 38) | def isMatch(self, text: str, pattern: str) -> bool:
class Solution (line 18) | class Solution(object):
method isMatch (line 7) | def isMatch(self, text: str, pattern: str) -> bool:
method isMatch (line 19) | def isMatch(self, text: str, pattern: str) -> bool:
method isMatch (line 38) | def isMatch(self, text: str, pattern: str) -> bool:
class Solution (line 37) | class Solution(object):
method isMatch (line 7) | def isMatch(self, text: str, pattern: str) -> bool:
method isMatch (line 19) | def isMatch(self, text: str, pattern: str) -> bool:
method isMatch (line 38) | def isMatch(self, text: str, pattern: str) -> bool:
FILE: Python/0011-container-with-most-water.py
class Solution (line 6) | class Solution:
method maxArea (line 7) | def maxArea(self, height: List[int]) -> int:
FILE: Python/0012-integer-to-roman.py
class Solution (line 3) | class Solution:
method intToRoman (line 4) | def intToRoman(self, num: int) -> str:
FILE: Python/0013-roman-to-integer.py
class Solution (line 3) | class Solution:
method romanToInt (line 4) | def romanToInt(self, s: str) -> int:
FILE: Python/0014-longest-common-prefix.py
class TrieNode (line 6) | class TrieNode:
method __init__ (line 7) | def __init__(self, char=""):
class Trie (line 13) | class Trie:
method __init__ (line 14) | def __init__(self):
method insert (line 17) | def insert(self, word):
class Solution (line 26) | class Solution:
method longestCommonPrefix (line 27) | def longestCommonPrefix(self, strs: List[str]) -> str:
FILE: Python/0015-3sum.py
class Solution (line 6) | class Solution:
method twoSumII (line 7) | def twoSumII(self, i: int, nums: List[int], result: List[List[int]]):
method twoSumI (line 22) | def twoSumI(self, nums: List[int], left: int, result: List[List[int]]):
method threeSum (line 34) | def threeSum(self, nums: List[int]) -> List[List[int]]:
method threeSum (line 47) | def threeSum(self, nums: List[int]) -> List[List[int]]:
class Solution (line 46) | class Solution:
method twoSumII (line 7) | def twoSumII(self, i: int, nums: List[int], result: List[List[int]]):
method twoSumI (line 22) | def twoSumI(self, nums: List[int], left: int, result: List[List[int]]):
method threeSum (line 34) | def threeSum(self, nums: List[int]) -> List[List[int]]:
method threeSum (line 47) | def threeSum(self, nums: List[int]) -> List[List[int]]:
FILE: Python/0016-3sum-closest.py
class Solution (line 6) | class Solution:
method threeSumClosest (line 7) | def threeSumClosest(self, nums: List[int], target: int) -> int:
FILE: Python/0017-letter-combinations-of-a-phone-number.py
class Solution (line 6) | class Solution:
method letterCombinations (line 7) | def letterCombinations(self, digits: str) -> List[str]:
FILE: Python/0018-4sum.py
class Solution (line 6) | class Solution:
method fourSum (line 7) | def fourSum(self, nums: List[int], target: int) -> List[List[int]]:
FILE: Python/0019-remove-nth-node-from-end-of-list.py
class ListNode (line 6) | class ListNode:
method __init__ (line 7) | def __init__(self, val=0, next=None):
class Solution (line 12) | class Solution:
method removeNthFromEnd (line 13) | def removeNthFromEnd(self, head: Optional[ListNode], n: int) -> Option...
FILE: Python/0020-valid-parentheses.py
class Solution (line 3) | class Solution:
method isValid (line 4) | def isValid(self, s: str) -> bool:
method isValid (line 18) | def isValid(self, s: str) -> bool:
class Solution (line 17) | class Solution:
method isValid (line 4) | def isValid(self, s: str) -> bool:
method isValid (line 18) | def isValid(self, s: str) -> bool:
FILE: Python/0021-merge-two-sorted-lists.py
class ListNode (line 2) | class ListNode(object):
method __init__ (line 3) | def __init__(self, val=0, next=None):
class Solution (line 8) | class Solution(object):
method mergeTwoLists (line 9) | def mergeTwoLists(self, list1, list2):
FILE: Python/0022-generate-parentheses.py
class Solution (line 6) | class Solution:
method generateParenthesis (line 7) | def generateParenthesis(self, n: int) -> List[str]:
FILE: Python/0023-merge-k-sorted-lists.py
class ListNode (line 5) | class ListNode:
method __init__ (line 6) | def __init__(self, val=0, next=None):
class Solution (line 11) | class Solution:
method mergeKLists (line 12) | def mergeKLists(self, lists: List[Optional[ListNode]]) -> Optional[Lis...
FILE: Python/0024-swap-nodes-in-pairs.py
class ListNode (line 6) | class ListNode:
method __init__ (line 7) | def __init__(self, val=0, next=None):
class Solution (line 12) | class Solution:
method swapPairs (line 13) | def swapPairs(self, head: Optional[ListNode]) -> Optional[ListNode]:
FILE: Python/0025-reverse-nodes-in-k-group.py
class ListNode (line 3) | class ListNode:
method __init__ (line 4) | def __init__(self, val=0, next=None):
class Solution (line 9) | class Solution:
method reverseKGroup (line 10) | def reverseKGroup(self, head: ListNode, k: int) -> ListNode:
FILE: Python/0026-remove-duplicates-from-sorted-array.py
class Solution (line 5) | class Solution:
method removeDuplicates (line 6) | def removeDuplicates(self, nums: List[int]) -> int:
FILE: Python/0027-remove-element.py
class Solution (line 4) | class Solution:
method removeElement (line 5) | def removeElement(self, nums: List[int], val: int) -> int:
FILE: Python/0028-find-the-index-of-the-first-occurrence-in-a-string.py
class Solution (line 3) | class Solution:
method strStr (line 4) | def strStr(self, haystack: str, needle: str) -> int:
FILE: Python/0029-divide-two-integers.py
class Solution (line 4) | class Solution:
method divide (line 5) | def divide(self, dividend: int, divisor: int) -> int:
FILE: Python/0030-substring-with-concatenation-of-all-words.py
class Solution (line 7) | class Solution:
method findSubstring (line 8) | def findSubstring(self, s: str, words: List[str]) -> List[int]:
FILE: Python/0031-next-permutation.py
class Solution (line 6) | class Solution:
method nextPermutation (line 7) | def nextPermutation(self, nums: List[int]) -> None:
FILE: Python/0032-longest-valid-parentheses.py
class Solution (line 3) | class Solution:
method longestValidParentheses (line 4) | def longestValidParentheses(self, s: str) -> int:
FILE: Python/0033-search-in-rotated-sorted-array.py
class Solution (line 6) | class Solution:
method search (line 7) | def search(self, nums: List[int], target: int) -> int:
FILE: Python/0034-find-first-and-last-position-of-element-in-sorted-array.py
class Solution (line 7) | class Solution:
method searchRange (line 8) | def searchRange(self, nums: List[int], target: int) -> List[int]:
method searchRange (line 44) | def searchRange(self, nums: List[int], target: int) -> List[int]:
method searchRange (line 55) | def searchRange(self, nums: List[int], target: int) -> List[int]:
class Solution (line 43) | class Solution:
method searchRange (line 8) | def searchRange(self, nums: List[int], target: int) -> List[int]:
method searchRange (line 44) | def searchRange(self, nums: List[int], target: int) -> List[int]:
method searchRange (line 55) | def searchRange(self, nums: List[int], target: int) -> List[int]:
class Solution (line 54) | class Solution:
method searchRange (line 8) | def searchRange(self, nums: List[int], target: int) -> List[int]:
method searchRange (line 44) | def searchRange(self, nums: List[int], target: int) -> List[int]:
method searchRange (line 55) | def searchRange(self, nums: List[int], target: int) -> List[int]:
FILE: Python/0035-search-insert-position.py
class Solution (line 6) | class Solution:
method searchInsert (line 7) | def searchInsert(self, nums: List[int], target: int) -> int:
FILE: Python/0036-valid-sudoku.py
class Solution (line 6) | class Solution:
method isValidSudoku (line 7) | def isValidSudoku(self, board: List[List[str]]) -> bool:
FILE: Python/0037-sudoku-solver.py
class Solution (line 7) | class Solution:
method solveSudoku (line 8) | def solveSudoku(self, board: List[List[str]]) -> None:
FILE: Python/0038-count-and-say.py
class Solution (line 7) | class Solution:
method RLE (line 8) | def RLE(self, countString: str):
method countAndSay (line 26) | def countAndSay(self, n: int) -> str:
FILE: Python/0039-combination-sum.py
class Solution (line 6) | class Solution:
method combinationSum (line 7) | def combinationSum(self, candidates: List[int], target: int) -> List[L...
method combinationSum (line 28) | def combinationSum(self, nums: List[int], target: int) -> List[List[in...
class Solution (line 27) | class Solution:
method combinationSum (line 7) | def combinationSum(self, candidates: List[int], target: int) -> List[L...
method combinationSum (line 28) | def combinationSum(self, nums: List[int], target: int) -> List[List[in...
FILE: Python/0040-combination-sum-ii.py
class Solution (line 6) | class Solution:
method combinationSum2 (line 7) | def combinationSum2(self, candidates: List[int], target: int) -> List[...
method backtrack (line 13) | def backtrack(self, candidates, target: int, totalIdx: int, path: List...
FILE: Python/0041-first-missing-positive.py
class Solution (line 6) | class Solution:
method firstMissingPositive (line 7) | def firstMissingPositive(self, nums: List[int]) -> int:
FILE: Python/0042-trapping-rain-water.py
class Solution (line 6) | class Solution:
method trap (line 7) | def trap(self, height: List[int]) -> int:
FILE: Python/0043-multiply-strings.py
class Solution (line 3) | class Solution:
method multiply (line 4) | def multiply(self, num1: str, num2: str) -> str:
FILE: Python/0044-wildcard-matching.py
class Solution (line 3) | class Solution:
method isMatch (line 4) | def isMatch(self, s: str, p: str) -> bool:
method isMatch (line 36) | def isMatch(self, s: str, p: str) -> bool:
method isMatch (line 66) | def isMatch(self, s: str, p: str) -> bool:
class Solution (line 35) | class Solution:
method isMatch (line 4) | def isMatch(self, s: str, p: str) -> bool:
method isMatch (line 36) | def isMatch(self, s: str, p: str) -> bool:
method isMatch (line 66) | def isMatch(self, s: str, p: str) -> bool:
class Solution (line 65) | class Solution:
method isMatch (line 4) | def isMatch(self, s: str, p: str) -> bool:
method isMatch (line 36) | def isMatch(self, s: str, p: str) -> bool:
method isMatch (line 66) | def isMatch(self, s: str, p: str) -> bool:
FILE: Python/0045-jump-game-ii.py
class Solution (line 5) | class Solution:
method jump (line 6) | def jump(self, nums: List[int]) -> int:
method jump (line 24) | def jump(self, nums: List[int]) -> int:
method jump (line 47) | def jump(self, nums: List[int]) -> int:
method jump (line 61) | def jump(self, nums: List[int]) -> int:
method jump (line 78) | def jump(self, nums: List[int]) -> int:
class Solution (line 23) | class Solution:
method jump (line 6) | def jump(self, nums: List[int]) -> int:
method jump (line 24) | def jump(self, nums: List[int]) -> int:
method jump (line 47) | def jump(self, nums: List[int]) -> int:
method jump (line 61) | def jump(self, nums: List[int]) -> int:
method jump (line 78) | def jump(self, nums: List[int]) -> int:
class Solution (line 46) | class Solution:
method jump (line 6) | def jump(self, nums: List[int]) -> int:
method jump (line 24) | def jump(self, nums: List[int]) -> int:
method jump (line 47) | def jump(self, nums: List[int]) -> int:
method jump (line 61) | def jump(self, nums: List[int]) -> int:
method jump (line 78) | def jump(self, nums: List[int]) -> int:
class Solution (line 60) | class Solution:
method jump (line 6) | def jump(self, nums: List[int]) -> int:
method jump (line 24) | def jump(self, nums: List[int]) -> int:
method jump (line 47) | def jump(self, nums: List[int]) -> int:
method jump (line 61) | def jump(self, nums: List[int]) -> int:
method jump (line 78) | def jump(self, nums: List[int]) -> int:
class Solution (line 77) | class Solution:
method jump (line 6) | def jump(self, nums: List[int]) -> int:
method jump (line 24) | def jump(self, nums: List[int]) -> int:
method jump (line 47) | def jump(self, nums: List[int]) -> int:
method jump (line 61) | def jump(self, nums: List[int]) -> int:
method jump (line 78) | def jump(self, nums: List[int]) -> int:
FILE: Python/0046-permutations.py
class Solution (line 7) | class Solution:
method permute (line 8) | def permute(self, nums: List[int]) -> List[List[int]]:
FILE: Python/0047-permutations-ii.py
class Solution (line 8) | class Solution:
method permuteUnique (line 9) | def permuteUnique(self, nums: List[int]) -> List[List[int]]:
method permuteUnique (line 31) | def permuteUnique(self, nums: List[int]) -> List[List[int]]:
class Solution (line 30) | class Solution:
method permuteUnique (line 9) | def permuteUnique(self, nums: List[int]) -> List[List[int]]:
method permuteUnique (line 31) | def permuteUnique(self, nums: List[int]) -> List[List[int]]:
FILE: Python/0048-rotate-image.py
class Solution (line 5) | class Solution:
method rotate (line 6) | def rotate(self, matrix: List[List[int]]) -> None:
method rotate (line 20) | def rotate(self, matrix: List[List[int]]) -> None:
method rotate (line 33) | def rotate(self, matrix: List[List[int]]) -> None:
class Solution (line 19) | class Solution:
method rotate (line 6) | def rotate(self, matrix: List[List[int]]) -> None:
method rotate (line 20) | def rotate(self, matrix: List[List[int]]) -> None:
method rotate (line 33) | def rotate(self, matrix: List[List[int]]) -> None:
class Solution (line 32) | class Solution:
method rotate (line 6) | def rotate(self, matrix: List[List[int]]) -> None:
method rotate (line 20) | def rotate(self, matrix: List[List[int]]) -> None:
method rotate (line 33) | def rotate(self, matrix: List[List[int]]) -> None:
FILE: Python/0049-group-anagrams.py
class Solution (line 7) | class Solution:
method groupAnagrams (line 8) | def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
method groupAnagrams (line 18) | def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
class Solution (line 17) | class Solution:
method groupAnagrams (line 8) | def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
method groupAnagrams (line 18) | def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
FILE: Python/0050-powx-n.py
class Solution (line 6) | class Solution:
method myPow (line 7) | def myPow(self, x: float, n: int) -> float:
method myPow (line 25) | def myPow(self, x: float, n: int) -> float:
class Solution (line 24) | class Solution:
method myPow (line 7) | def myPow(self, x: float, n: int) -> float:
method myPow (line 25) | def myPow(self, x: float, n: int) -> float:
FILE: Python/0051-n-queens.py
class Solution (line 6) | class Solution:
method solveNQueens (line 7) | def solveNQueens(self, n: int) -> List[List[str]]:
FILE: Python/0052-n-queens-ii.py
class Solution (line 6) | class Solution:
method totalNQueens (line 7) | def totalNQueens(self, n: int) -> int:
FILE: Python/0053-maximum-subarray.py
class Solution (line 6) | class Solution:
method maxSubArray (line 7) | def maxSubArray(self, nums: List[int]) -> int:
method maxSubArray (line 19) | def maxSubArray(self, nums: List[int]) -> int:
class Solution (line 18) | class Solution:
method maxSubArray (line 7) | def maxSubArray(self, nums: List[int]) -> int:
method maxSubArray (line 19) | def maxSubArray(self, nums: List[int]) -> int:
FILE: Python/0054-spiral-matrix.py
class Solution (line 6) | class Solution:
method spiralOrder (line 7) | def spiralOrder(self, matrix: List[List[int]]) -> List[int]:
FILE: Python/0055-jump-game.py
class Solution (line 6) | class Solution:
method canJump (line 7) | def canJump(self, nums: List[int]) -> bool:
method canJump (line 17) | def canJump(self, nums: List[int]) -> bool:
class Solution (line 16) | class Solution:
method canJump (line 7) | def canJump(self, nums: List[int]) -> bool:
method canJump (line 17) | def canJump(self, nums: List[int]) -> bool:
FILE: Python/0056-merge-intervals.py
class Solution (line 6) | class Solution:
method merge (line 7) | def merge(self, intervals: List[List[int]]) -> List[List[int]]:
FILE: Python/0057-insert-interval.py
class Solution (line 6) | class Solution:
method insert (line 7) | def insert(self, intervals: List[List[int]], newInterval: List[int]) -...
method insert (line 28) | def insert(self, intervals: List[List[int]], newInterval: List[int]) -...
class Solution (line 27) | class Solution:
method insert (line 7) | def insert(self, intervals: List[List[int]], newInterval: List[int]) -...
method insert (line 28) | def insert(self, intervals: List[List[int]], newInterval: List[int]) -...
FILE: Python/0058-length-of-last-word.py
class Solution (line 1) | class Solution:
method lengthOfLastWord (line 2) | def lengthOfLastWord(self, s: str) -> int:
FILE: Python/0059-spiral-matrix-ii.py
class Solution (line 6) | class Solution:
method generateMatrix (line 7) | def generateMatrix(self, n: int) -> List[List[int]]:
FILE: Python/0061-rotate-list.py
class ListNode (line 6) | class ListNode:
method __init__ (line 7) | def __init__(self, val=0, next=None):
class Solution (line 12) | class Solution:
method rotateRight (line 13) | def rotateRight(self, head: Optional[ListNode], k: int) -> Optional[Li...
FILE: Python/0062-unique-paths.py
class Solution (line 7) | class Solution:
method uniquePaths (line 9) | def uniquePaths(self, m: int, n: int) -> int:
method uniquePaths (line 16) | def uniquePaths(self, r: int, c: int) -> int:
method uniquePaths (line 28) | def uniquePaths(self, m: int, n: int) -> int:
class Solution (line 15) | class Solution:
method uniquePaths (line 9) | def uniquePaths(self, m: int, n: int) -> int:
method uniquePaths (line 16) | def uniquePaths(self, r: int, c: int) -> int:
method uniquePaths (line 28) | def uniquePaths(self, m: int, n: int) -> int:
class Solution (line 27) | class Solution:
method uniquePaths (line 9) | def uniquePaths(self, m: int, n: int) -> int:
method uniquePaths (line 16) | def uniquePaths(self, r: int, c: int) -> int:
method uniquePaths (line 28) | def uniquePaths(self, m: int, n: int) -> int:
FILE: Python/0063-unique-paths-ii.py
class Solution (line 7) | class Solution:
method uniquePathsWithObstacles (line 8) | def uniquePathsWithObstacles(self, obstacleGrid: List[List[int]]) -> int:
method uniquePathsWithObstacles (line 24) | def uniquePathsWithObstacles(self, obstacleGrid: List[List[int]]) -> int:
class Solution (line 23) | class Solution:
method uniquePathsWithObstacles (line 8) | def uniquePathsWithObstacles(self, obstacleGrid: List[List[int]]) -> int:
method uniquePathsWithObstacles (line 24) | def uniquePathsWithObstacles(self, obstacleGrid: List[List[int]]) -> int:
FILE: Python/0064-minimum-path-sum.py
class Solution (line 6) | class Solution:
method minPathSum (line 7) | def minPathSum(self, grid: List[List[int]]) -> int:
method minPathSum (line 22) | def minPathSum(self, grid: List[List[int]]) -> int:
class Solution (line 21) | class Solution:
method minPathSum (line 7) | def minPathSum(self, grid: List[List[int]]) -> int:
method minPathSum (line 22) | def minPathSum(self, grid: List[List[int]]) -> int:
FILE: Python/0066-plus-one.py
class Solution (line 4) | class Solution:
method plusOne (line 5) | def plusOne(self, digits: List[int]) -> List[int]:
FILE: Python/0067-add-binary.py
class Solution (line 1) | class Solution:
method addBinary (line 2) | def addBinary(self, a: str, b: str) -> str:
FILE: Python/0068-text-justification.py
class Solution (line 6) | class Solution:
method fullJustify (line 7) | def fullJustify(self, words: List[str], maxWidth: int) -> List[str]:
FILE: Python/0069-sqrtx.py
class Solution (line 3) | class Solution:
method mySqrt (line 4) | def mySqrt(self, x: int) -> int:
FILE: Python/0070-climbing-stairs.py
class Solution (line 7) | class Solution:
method climbStairs (line 8) | def climbStairs(self, n: int) -> int:
method climb_Stairs (line 15) | def climb_Stairs(self, i: int, n: int, memo: list) -> int:
method climbStairs (line 30) | def climbStairs(self, n: int):
method climbStairs (line 44) | def climbStairs(self, n: int) -> int:
method climbStairs (line 58) | def climbStairs(self, n: int) -> int:
class Solution (line 14) | class Solution:
method climbStairs (line 8) | def climbStairs(self, n: int) -> int:
method climb_Stairs (line 15) | def climb_Stairs(self, i: int, n: int, memo: list) -> int:
method climbStairs (line 30) | def climbStairs(self, n: int):
method climbStairs (line 44) | def climbStairs(self, n: int) -> int:
method climbStairs (line 58) | def climbStairs(self, n: int) -> int:
class Solution (line 29) | class Solution:
method climbStairs (line 8) | def climbStairs(self, n: int) -> int:
method climb_Stairs (line 15) | def climb_Stairs(self, i: int, n: int, memo: list) -> int:
method climbStairs (line 30) | def climbStairs(self, n: int):
method climbStairs (line 44) | def climbStairs(self, n: int) -> int:
method climbStairs (line 58) | def climbStairs(self, n: int) -> int:
class Solution (line 43) | class Solution:
method climbStairs (line 8) | def climbStairs(self, n: int) -> int:
method climb_Stairs (line 15) | def climb_Stairs(self, i: int, n: int, memo: list) -> int:
method climbStairs (line 30) | def climbStairs(self, n: int):
method climbStairs (line 44) | def climbStairs(self, n: int) -> int:
method climbStairs (line 58) | def climbStairs(self, n: int) -> int:
class Solution (line 56) | class Solution:
method climbStairs (line 8) | def climbStairs(self, n: int) -> int:
method climb_Stairs (line 15) | def climb_Stairs(self, i: int, n: int, memo: list) -> int:
method climbStairs (line 30) | def climbStairs(self, n: int):
method climbStairs (line 44) | def climbStairs(self, n: int) -> int:
method climbStairs (line 58) | def climbStairs(self, n: int) -> int:
FILE: Python/0071-simplify-path.py
class Solution (line 3) | class Solution:
method simplifyPath (line 4) | def simplifyPath(self, path: str) -> str:
FILE: Python/0072-edit-distance.py
class Solution (line 6) | class Solution:
method minDistance (line 7) | def minDistance(self, word1: str, word2: str) -> int:
method minDistance (line 28) | def minDistance(self, word1: str, word2: str) -> int:
class Solution (line 27) | class Solution:
method minDistance (line 7) | def minDistance(self, word1: str, word2: str) -> int:
method minDistance (line 28) | def minDistance(self, word1: str, word2: str) -> int:
FILE: Python/0073-set-matrix-zeroes.py
class Solution (line 6) | class Solution:
method setZeroes (line 7) | def setZeroes(self, matrix: List[List[int]]) -> None:
method setZeroes (line 23) | def setZeroes(self, matrix: List[List[int]]) -> None:
class Solution (line 22) | class Solution:
method setZeroes (line 7) | def setZeroes(self, matrix: List[List[int]]) -> None:
method setZeroes (line 23) | def setZeroes(self, matrix: List[List[int]]) -> None:
FILE: Python/0074-search-a-2d-matrix.py
class Solution (line 6) | class Solution:
method searchMatrix (line 7) | def searchMatrix(self, matrix: List[List[int]], target: int) -> bool:
FILE: Python/0075-sort-colors.py
class Solution (line 6) | class Solution:
method sortColors (line 7) | def sortColors(self, nums: List[int]) -> None:
FILE: Python/0076-minimum-window-substring.py
class Solution (line 6) | class Solution:
method minWindow (line 7) | def minWindow(self, s: str, t: str) -> str:
FILE: Python/0077-combinations.py
class Solution (line 5) | class Solution:
method combine (line 6) | def combine(self, n: int, k: int) -> List[List[int]]:
FILE: Python/0078-subsets.py
class Solution (line 7) | class Solution:
method subsets (line 8) | def subsets(self, nums: List[int]) -> List[List[int]]:
method subsets (line 24) | def subsets(self, nums):
method subsets (line 39) | def subsets(self, nums: List[int]) -> List[List[int]]:
method subsets (line 53) | def subsets(self, nums: List[int]) -> List[List[int]]:
method subsets (line 62) | def subsets(self, nums: List[int]) -> List[List[int]]:
class Solution (line 23) | class Solution:
method subsets (line 8) | def subsets(self, nums: List[int]) -> List[List[int]]:
method subsets (line 24) | def subsets(self, nums):
method subsets (line 39) | def subsets(self, nums: List[int]) -> List[List[int]]:
method subsets (line 53) | def subsets(self, nums: List[int]) -> List[List[int]]:
method subsets (line 62) | def subsets(self, nums: List[int]) -> List[List[int]]:
class Solution (line 38) | class Solution:
method subsets (line 8) | def subsets(self, nums: List[int]) -> List[List[int]]:
method subsets (line 24) | def subsets(self, nums):
method subsets (line 39) | def subsets(self, nums: List[int]) -> List[List[int]]:
method subsets (line 53) | def subsets(self, nums: List[int]) -> List[List[int]]:
method subsets (line 62) | def subsets(self, nums: List[int]) -> List[List[int]]:
class Solution (line 52) | class Solution:
method subsets (line 8) | def subsets(self, nums: List[int]) -> List[List[int]]:
method subsets (line 24) | def subsets(self, nums):
method subsets (line 39) | def subsets(self, nums: List[int]) -> List[List[int]]:
method subsets (line 53) | def subsets(self, nums: List[int]) -> List[List[int]]:
method subsets (line 62) | def subsets(self, nums: List[int]) -> List[List[int]]:
class Solution (line 61) | class Solution:
method subsets (line 8) | def subsets(self, nums: List[int]) -> List[List[int]]:
method subsets (line 24) | def subsets(self, nums):
method subsets (line 39) | def subsets(self, nums: List[int]) -> List[List[int]]:
method subsets (line 53) | def subsets(self, nums: List[int]) -> List[List[int]]:
method subsets (line 62) | def subsets(self, nums: List[int]) -> List[List[int]]:
FILE: Python/0079-word-search.py
class Solution (line 6) | class Solution:
method exist (line 8) | def exist(self, board: List[List[str]], word: str) -> bool:
FILE: Python/0080-remove-duplicates-from-sorted-array-ii.py
class Solution (line 6) | class Solution:
method removeDuplicates (line 7) | def removeDuplicates(self, nums: List[int]) -> int:
FILE: Python/0081-search-in-rotated-sorted-array-ii.py
class Solution (line 6) | class Solution:
method search (line 7) | def search(self, nums: List[int], target: int) -> bool:
FILE: Python/0082-remove-duplicates-from-sorted-list-ii.py
class ListNode (line 6) | class ListNode:
method __init__ (line 7) | def __init__(self, val=0, next=None):
class Solution (line 12) | class Solution:
method deleteDuplicates (line 13) | def deleteDuplicates(self, head: Optional[ListNode]) -> Optional[ListN...
function traverse (line 29) | def traverse(node: Optional[ListNode]):
FILE: Python/0083-remove-duplicates-from-sorted-list.py
class ListNode (line 6) | class ListNode:
method __init__ (line 7) | def __init__(self, val=0, next=None):
class Solution (line 12) | class Solution:
method deleteDuplicates (line 13) | def deleteDuplicates(self, head: Optional[ListNode]) -> Optional[ListN...
function traverse (line 23) | def traverse(node: Optional[ListNode]):
FILE: Python/0084-largest-rectangle-in-histogram.py
class Solution (line 6) | class Solution:
method largestRectangleArea (line 7) | def largestRectangleArea(self, heights: List[int]) -> int:
FILE: Python/0085-maximal-rectangle.py
class Solution (line 7) | class Solution:
method maximalRectangle (line 8) | def maximalRectangle(self, matrix: List[List[str]]) -> int:
method maximalRectangle (line 26) | def maximalRectangle(self, matrix: List[List[str]]) -> int:
class Solution (line 25) | class Solution:
method maximalRectangle (line 8) | def maximalRectangle(self, matrix: List[List[str]]) -> int:
method maximalRectangle (line 26) | def maximalRectangle(self, matrix: List[List[str]]) -> int:
FILE: Python/0086-partition-list.py
class ListNode (line 6) | class ListNode:
method __init__ (line 7) | def __init__(self, val=0, next=None):
class Solution (line 12) | class Solution:
method partition (line 13) | def partition(self, head: Optional[ListNode], x: int) -> Optional[List...
FILE: Python/0087-scramble-string.py
class Solution (line 3) | class Solution:
method isScramble (line 4) | def isScramble(self, s1: str, s2: str) -> bool:
FILE: Python/0088-merge-sorted-array.py
class Solution (line 6) | class Solution:
method merge (line 7) | def merge(self, nums1: List[int], m: int, nums2: List[int], n: int) ->...
FILE: Python/0089-gray-code.py
class Solution (line 6) | class Solution:
method grayCode (line 7) | def grayCode(self, n: int) -> List[int]:
method backtracking (line 13) | def backtracking(self, result: List[int], n: int, visited: dict):
FILE: Python/0090-subsets-ii.py
class Solution (line 7) | class Solution:
method subsetsWithDup (line 8) | def subsetsWithDup(self, nums: List[int]) -> List[List[int]]:
FILE: Python/0091-decode-ways.py
class Solution (line 6) | class Solution:
method numDecodings (line 7) | def numDecodings(self, s: str) -> int:
method numDecodings (line 27) | def numDecodings(self, s: str) -> int:
class Solution (line 26) | class Solution:
method numDecodings (line 7) | def numDecodings(self, s: str) -> int:
method numDecodings (line 27) | def numDecodings(self, s: str) -> int:
FILE: Python/0092-reverse-linked-list-ii.py
class ListNode (line 6) | class ListNode:
method __init__ (line 7) | def __init__(self, val=0, next=None):
class Solution (line 12) | class Solution:
method reverseBetween (line 13) | def reverseBetween(self, head: Optional[ListNode], left: int, right: i...
function traverse (line 39) | def traverse(node: Optional[ListNode]):
FILE: Python/0093-restore-ip-addresses.py
class Solution (line 6) | class Solution:
method restoreIpAddresses (line 7) | def restoreIpAddresses(self, s: str) -> List[str]:
FILE: Python/0095-unique-binary-search-trees-ii.py
class TreeNode (line 5) | class TreeNode:
method __init__ (line 6) | def __init__(self, val=0, left=None, right=None):
class Solution (line 12) | class Solution:
method allPossobleBST (line 13) | def allPossobleBST(self, start, end, memo):
method generateTrees (line 32) | def generateTrees(self, n: int) -> List[Optional[TreeNode]]:
FILE: Python/0096-unique-binary-search-trees.py
class TreeNode (line 4) | class TreeNode:
method __init__ (line 5) | def __init__(self, val=0, left=None, right=None):
class Solution (line 18) | class Solution:
method numTrees (line 19) | def numTrees(self, n: int) -> int:
FILE: Python/0097-interleaving-string.py
class Solution (line 6) | class Solution:
method isInterleave (line 7) | def isInterleave(self, s1: str, s2: str, s3: str) -> bool:
method isInterleave (line 28) | def isInterleave(self, s1: str, s2: str, s3: str) -> bool:
class Solution (line 27) | class Solution:
method isInterleave (line 7) | def isInterleave(self, s1: str, s2: str, s3: str) -> bool:
method isInterleave (line 28) | def isInterleave(self, s1: str, s2: str, s3: str) -> bool:
FILE: Python/0098-validate-binary-search-tree.py
class TreeNode (line 7) | class TreeNode:
method __init__ (line 8) | def __init__(self, val=0, left=None, right=None):
class Solution (line 14) | class Solution:
method isValidBST (line 15) | def isValidBST(self, root: Optional[TreeNode]) -> bool:
method isValidBST (line 28) | def isValidBST(self, root: Optional[TreeNode]) -> bool:
class Solution (line 27) | class Solution:
method isValidBST (line 15) | def isValidBST(self, root: Optional[TreeNode]) -> bool:
method isValidBST (line 28) | def isValidBST(self, root: Optional[TreeNode]) -> bool:
FILE: Python/0099-recover-binary-search-tree.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method recoverTree (line 14) | def recoverTree(self, root: Optional[TreeNode]) -> None:
FILE: Python/0100-same-tree.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method isSameTree (line 14) | def isSameTree(self, p: Optional[TreeNode], q: Optional[TreeNode]) -> ...
FILE: Python/0101-symmetric-tree.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method isSymmetric (line 14) | def isSymmetric(self, root: Optional[TreeNode]) -> bool:
FILE: Python/0102-binary-tree-level-order-traversal.py
class TreeNode (line 7) | class TreeNode:
method __init__ (line 8) | def __init__(self, val=0, left=None, right=None):
class Solution (line 14) | class Solution:
method levelOrder (line 15) | def levelOrder(self, root: Optional[TreeNode]) -> List[List[int]]:
method levelOrder (line 35) | def levelOrder(self, root: TreeNode) -> List[List[int]]:
class Solution (line 34) | class Solution:
method levelOrder (line 15) | def levelOrder(self, root: Optional[TreeNode]) -> List[List[int]]:
method levelOrder (line 35) | def levelOrder(self, root: TreeNode) -> List[List[int]]:
FILE: Python/0103-binary-tree-zigzag-level-order-traversal.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method zigzagLevelOrder (line 14) | def zigzagLevelOrder(self, root: Optional[TreeNode]) -> List[List[int]]:
FILE: Python/0104-maximum-depth-of-binary-tree.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method maxDepth (line 14) | def maxDepth(self, root: Optional[TreeNode]) -> int:
method __init__ (line 27) | def __init__(self):
method nextMaxDepth (line 31) | def nextMaxDepth(self):
method maxDepth (line 43) | def maxDepth(self, root):
method maxDepth (line 54) | def maxDepth(self, root: TreeNode) -> int:
class Solution (line 26) | class Solution:
method maxDepth (line 14) | def maxDepth(self, root: Optional[TreeNode]) -> int:
method __init__ (line 27) | def __init__(self):
method nextMaxDepth (line 31) | def nextMaxDepth(self):
method maxDepth (line 43) | def maxDepth(self, root):
method maxDepth (line 54) | def maxDepth(self, root: TreeNode) -> int:
class Solution (line 53) | class Solution:
method maxDepth (line 14) | def maxDepth(self, root: Optional[TreeNode]) -> int:
method __init__ (line 27) | def __init__(self):
method nextMaxDepth (line 31) | def nextMaxDepth(self):
method maxDepth (line 43) | def maxDepth(self, root):
method maxDepth (line 54) | def maxDepth(self, root: TreeNode) -> int:
FILE: Python/0105-construct-binary-tree-from-preorder-and-inorder-traversal.py
class Solution (line 7) | class Solution:
method buildTree (line 8) | def buildTree(self, preorder: List[int], inorder: List[int]) -> Option...
FILE: Python/0106-construct-binary-tree-from-inorder-and-postorder-traversal.py
class Solution (line 7) | class Solution:
method buildTree (line 8) | def buildTree(self, inorder: List[int], postorder: List[int]) -> Optio...
FILE: Python/0107-binary-tree-level-order-traversal-ii.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method levelOrderBottom (line 14) | def levelOrderBottom(self, root: Optional[TreeNode]) -> List[List[int]]:
FILE: Python/0108-convert-sorted-array-to-binary-search-tree.py
class Solution (line 9) | class Solution:
method traverse (line 10) | def traverse(self, node: Optional[TreeNode]):
method sortedArrayToBST (line 17) | def sortedArrayToBST(self, nums: List[int]) -> Optional[TreeNode]:
FILE: Python/0110-balanced-binary-tree.py
class TreeNode (line 3) | class TreeNode(object):
method __init__ (line 4) | def __init__(self, val=0, left=None, right=None):
class Solution (line 10) | class Solution(object):
method height (line 11) | def height(self, node: TreeNode):
method isBalanced (line 16) | def isBalanced(self, node: TreeNode):
method isBalancedHelper (line 26) | def isBalancedHelper(self, root: TreeNode):
method isBalanced (line 39) | def isBalanced(self, root: TreeNode) -> bool:
class Solution (line 25) | class Solution:
method height (line 11) | def height(self, node: TreeNode):
method isBalanced (line 16) | def isBalanced(self, node: TreeNode):
method isBalancedHelper (line 26) | def isBalancedHelper(self, root: TreeNode):
method isBalanced (line 39) | def isBalanced(self, root: TreeNode) -> bool:
FILE: Python/0111-minimum-depth-of-binary-tree.py
class TreeNode (line 7) | class TreeNode:
method __init__ (line 8) | def __init__(self, val=0, left=None, right=None):
class Solution (line 14) | class Solution:
method minDepth (line 15) | def minDepth(self, root: Optional[TreeNode]) -> int:
FILE: Python/0112-path-sum.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method hasPathSum (line 14) | def hasPathSum(self, root: Optional[TreeNode], targetSum: int) -> bool:
FILE: Python/0113-path-sum-ii.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method helper (line 14) | def helper(self, node: TreeNode, remainingSum: int, pathNode: List[int...
method pathSum (line 25) | def pathSum(self, root: Optional[TreeNode], targetSum: int) -> List[Li...
FILE: Python/0114-flatten-binary-tree-to-linked-list.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method flatten (line 14) | def flatten(self, root: Optional[TreeNode]) -> None:
method flatten (line 30) | def flatten(self, root: TreeNode) -> TreeNode:
class Solution (line 29) | class Solution:
method flatten (line 14) | def flatten(self, root: Optional[TreeNode]) -> None:
method flatten (line 30) | def flatten(self, root: TreeNode) -> TreeNode:
FILE: Python/0115-distinct-subsequences.py
class Solution (line 5) | class Solution:
method numDistinct (line 6) | def numDistinct(self, s: str, t: str) -> int:
method numDistinct (line 20) | def numDistinct(self, s: str, t: str) -> int:
class Solution (line 19) | class Solution:
method numDistinct (line 6) | def numDistinct(self, s: str, t: str) -> int:
method numDistinct (line 20) | def numDistinct(self, s: str, t: str) -> int:
FILE: Python/0116-populating-next-right-pointers-in-each-node.py
class Node (line 7) | class Node:
method __init__ (line 8) | def __init__(self, val: int = 0, left: 'Node' = None, right: 'Node' = ...
class Solution (line 15) | class Solution:
method connect (line 16) | def connect(self, root: Optional[Node]) -> Optional[Node]:
FILE: Python/0117-populating-next-right-pointers-in-each-node-ii.py
class Node (line 6) | class Node:
method __init__ (line 7) | def __init__(self, val: int = 0, left: 'Node' = None, right: 'Node' = ...
class Solution (line 14) | class Solution:
method processChild (line 16) | def processChild(self, childNode, prev, leftmost):
method connect (line 26) | def connect(self, root: Optional["Node"]) -> Optional["Node"]:
FILE: Python/0118-pascals-triangle.py
class Solution (line 4) | class Solution:
method generate (line 5) | def generate(self, numRows: int) -> List[List[int]]:
FILE: Python/0119-pascals-triangle-ii.py
class Solution (line 4) | class Solution:
method getRow (line 5) | def getRow(self, rowIndex: int) -> List[int]:
FILE: Python/0120-triangle.py
class Solution (line 6) | class Solution:
method minimumTotal (line 7) | def minimumTotal(self, triangle: List[List[int]]) -> int:
FILE: Python/0121-best-time-to-buy-and-sell-stock.py
class Solution (line 6) | class Solution(object):
method maxProfit (line 7) | def maxProfit(self, prices: List[int]) -> int:
FILE: Python/0122-best-time-to-buy-and-sell-stock-ii.py
class Solution (line 6) | class Solution:
method maxProfit (line 7) | def maxProfit(self, prices: List[int]) -> int:
FILE: Python/0123-best-time-to-buy-and-sell-stock-iii.py
class Solution (line 6) | class Solution(object):
method maxProfit (line 7) | def maxProfit(self, prices: List[int]) -> int:
method maxProfit (line 29) | def maxProfit(self, prices: List[int]) -> int:
class Solution (line 28) | class Solution(object):
method maxProfit (line 7) | def maxProfit(self, prices: List[int]) -> int:
method maxProfit (line 29) | def maxProfit(self, prices: List[int]) -> int:
FILE: Python/0124-binary-tree-maximum-path-sum.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method maxPathSum (line 14) | def maxPathSum(self, root: Optional[TreeNode]) -> int:
FILE: Python/0125-valid-palindrome.py
class Solution (line 3) | class Solution(object):
method isPalindrome (line 4) | def isPalindrome(self, s: str) -> bool:
method isPalindrome (line 20) | def isPalindrome(self, s: str) -> bool:
class Solution (line 19) | class Solution:
method isPalindrome (line 4) | def isPalindrome(self, s: str) -> bool:
method isPalindrome (line 20) | def isPalindrome(self, s: str) -> bool:
FILE: Python/0126-word-ladder-ii.py
class Solution (line 7) | class Solution:
method __init__ (line 8) | def __init__(self):
method findNeighbors (line 13) | def findNeighbors(self, word: str, wordSet: Set[str]) -> List[str]:
method backtrack (line 27) | def backtrack(self, source: str, destination: str):
method bfs (line 41) | def bfs(self, beginWord: str, endWord: str, wordSet: Set[str]):
method findLadders (line 61) | def findLadders(
FILE: Python/0127-word-ladder.py
class Solution (line 7) | class Solution:
method ladderLength (line 8) | def ladderLength(self, beginWord: str, endWord: str, wordList: List[st...
FILE: Python/0128-longest-consecutive-sequence.py
class Solution (line 6) | class Solution:
method longestConsecutive (line 7) | def longestConsecutive(self, nums: List[int]) -> int:
method longestConsecutive (line 59) | def longestConsecutive(self, nums: List[int]) -> int:
method longestConsecutive (line 72) | def longestConsecutive(self, nums: List[int]) -> int:
class UnionFind (line 27) | class UnionFind:
method __init__ (line 28) | def __init__(self, nums):
method find (line 33) | def find(self, num):
method union (line 38) | def union(self, node1, node2):
class Solution (line 58) | class Solution:
method longestConsecutive (line 7) | def longestConsecutive(self, nums: List[int]) -> int:
method longestConsecutive (line 59) | def longestConsecutive(self, nums: List[int]) -> int:
method longestConsecutive (line 72) | def longestConsecutive(self, nums: List[int]) -> int:
class Solution (line 71) | class Solution:
method longestConsecutive (line 7) | def longestConsecutive(self, nums: List[int]) -> int:
method longestConsecutive (line 59) | def longestConsecutive(self, nums: List[int]) -> int:
method longestConsecutive (line 72) | def longestConsecutive(self, nums: List[int]) -> int:
FILE: Python/0129-sum-root-to-leaf-numbers.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method sumNumbers (line 14) | def sumNumbers(self, root: Optional[TreeNode]) -> List[int]:
FILE: Python/0130-surrounded-regions.py
class Solution (line 7) | class Solution:
method solve (line 8) | def solve(self, board: List[List[str]]) -> None:
method solve (line 42) | def solve(self, board: List[List[str]]) -> None:
method solve (line 74) | def solve(self, board: List[List[str]]) -> None:
class Solution (line 41) | class Solution:
method solve (line 8) | def solve(self, board: List[List[str]]) -> None:
method solve (line 42) | def solve(self, board: List[List[str]]) -> None:
method solve (line 74) | def solve(self, board: List[List[str]]) -> None:
class Solution (line 73) | class Solution:
method solve (line 8) | def solve(self, board: List[List[str]]) -> None:
method solve (line 42) | def solve(self, board: List[List[str]]) -> None:
method solve (line 74) | def solve(self, board: List[List[str]]) -> None:
FILE: Python/0131-palindrome-partitioning.py
class Solution (line 6) | class Solution:
method partition (line 7) | def partition(self, s: str) -> List[List[str]]:
method partition (line 27) | def partition(self, s: str) -> List[List[str]]:
class Solution (line 26) | class Solution:
method partition (line 7) | def partition(self, s: str) -> List[List[str]]:
method partition (line 27) | def partition(self, s: str) -> List[List[str]]:
FILE: Python/0132-palindrome-partitioning-ii.py
class Solution (line 3) | class Solution:
method minCut (line 4) | def minCut(self, s: str) -> int:
method __init__ (line 28) | def __init__(self):
method minCut (line 32) | def minCut(self, s: str) -> int:
method findMinimumCut (line 37) | def findMinimumCut(self, s, start, end, minimumCut):
method isPalindrome (line 54) | def isPalindrome(self, s, start, end):
class Solution (line 27) | class Solution:
method minCut (line 4) | def minCut(self, s: str) -> int:
method __init__ (line 28) | def __init__(self):
method minCut (line 32) | def minCut(self, s: str) -> int:
method findMinimumCut (line 37) | def findMinimumCut(self, s, start, end, minimumCut):
method isPalindrome (line 54) | def isPalindrome(self, s, start, end):
FILE: Python/0133-clone-graph.py
class Node (line 7) | class Node:
method __init__ (line 8) | def __init__(self, val=0, neighbors=None):
class Solution (line 13) | class Solution:
method __init__ (line 14) | def __init__(self):
method cloneGraph (line 17) | def cloneGraph(self, node: 'Node') -> 'Node':
method cloneGraph (line 34) | def cloneGraph(self, node: Optional['Node']) -> Optional['Node']:
class Solution (line 33) | class Solution:
method __init__ (line 14) | def __init__(self):
method cloneGraph (line 17) | def cloneGraph(self, node: 'Node') -> 'Node':
method cloneGraph (line 34) | def cloneGraph(self, node: Optional['Node']) -> Optional['Node']:
FILE: Python/0134-gas-station.py
class Solution (line 1) | class Solution:
method canCompleteCircuit (line 2) | def canCompleteCircuit(self, gas: List[int], cost: List[int]) -> int:
FILE: Python/0135-candy.py
class Solution (line 4) | class Solution:
method candy (line 5) | def candy(self, ratings: List[int]) -> int:
FILE: Python/0136-single-number.py
class Solution (line 6) | class Solution:
method singleNumber (line 7) | def singleNumber(self, nums: List[int]) -> int:
FILE: Python/0137-single-number-ii.py
class Solution (line 6) | class Solution:
method singleNumber (line 7) | def singleNumber(self, nums: List[int]) -> int:
FILE: Python/0138-copy-list-with-random-pointer.py
function buildLinkedList (line 6) | def buildLinkedList(arr):
class Node (line 19) | class Node:
method __init__ (line 20) | def __init__(self, x: int, next: 'Node' = None, random: 'Node' = None):
class Solution (line 26) | class Solution():
method __init__ (line 27) | def __init__(self):
method copyRandomList (line 30) | def copyRandomList(self, head: Optional[Node]):
FILE: Python/0139-word-break.py
class Solution (line 4) | class Solution:
method wordBreak (line 5) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 42) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 69) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 95) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 114) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
class TrieNode (line 35) | class TrieNode:
method __init__ (line 36) | def __init__(self):
class Solution (line 41) | class Solution:
method wordBreak (line 5) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 42) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 69) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 95) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 114) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
class Solution (line 68) | class Solution:
method wordBreak (line 5) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 42) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 69) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 95) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 114) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
class Solution (line 94) | class Solution:
method wordBreak (line 5) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 42) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 69) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 95) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 114) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
class Solution (line 113) | class Solution:
method wordBreak (line 5) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 42) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 69) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 95) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
method wordBreak (line 114) | def wordBreak(self, s: str, wordDict: List[str]) -> bool:
FILE: Python/0140-word-break-ii.py
class Solution (line 6) | class Solution:
method wordBreak (line 7) | def wordBreak(self, s: str, wordDict: List[str]) -> List[str]:
method dp (line 11) | def dp(self, remainingStr: str, wordSet: set, memoization: dict) -> Li...
method wordBreak (line 30) | def wordBreak(self, s: str, wordDict: List[str]) -> List[str]:
class Solution (line 29) | class Solution:
method wordBreak (line 7) | def wordBreak(self, s: str, wordDict: List[str]) -> List[str]:
method dp (line 11) | def dp(self, remainingStr: str, wordSet: set, memoization: dict) -> Li...
method wordBreak (line 30) | def wordBreak(self, s: str, wordDict: List[str]) -> List[str]:
FILE: Python/0141-linked-list-cycle.py
class ListNode (line 5) | class ListNode:
method __init__ (line 6) | def __init__(self, x):
class Solution (line 11) | class Solution:
method hasCycle (line 12) | def hasCycle(self, head: Optional[ListNode]) -> bool:
FILE: Python/0142-linked-list-cycle-ii.py
class ListNode (line 6) | class ListNode:
method __init__ (line 7) | def __init__(self, x):
class Solution (line 12) | class Solution:
method detectCycle (line 13) | def detectCycle(self, head: Optional[ListNode]) -> Optional[ListNode]:
method detectCycle (line 26) | def detectCycle(self, head: Optional[ListNode]) -> Optional[ListNode]:
class Solution (line 25) | class Solution:
method detectCycle (line 13) | def detectCycle(self, head: Optional[ListNode]) -> Optional[ListNode]:
method detectCycle (line 26) | def detectCycle(self, head: Optional[ListNode]) -> Optional[ListNode]:
FILE: Python/0143-reorder-list.py
class ListNode (line 6) | class ListNode:
method __init__ (line 7) | def __init__(self, val=0, next=None):
class Solution (line 12) | class Solution:
method reorderList (line 13) | def reorderList(self, head: Optional[ListNode]) -> None:
FILE: Python/0145-binary-tree-postorder-traversal.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method postorderTraversal (line 14) | def postorderTraversal(self, root: Optional[TreeNode]) -> List[int]:
FILE: Python/0146-lru-cache.py
class ListNode (line 6) | class ListNode:
method __init__ (line 7) | def __init__(self, key, val):
class LRUCache (line 14) | class LRUCache:
method __init__ (line 16) | def __init__(self, capacity: int):
method get (line 25) | def get(self, key: int) -> int:
method put (line 34) | def put(self, key: int, value: int) -> None:
method add (line 48) | def add(self, node):
method remove (line 57) | def remove(self, node):
method __init__ (line 78) | def __init__(self, capacity: int):
method get (line 82) | def get(self, key: int) -> int:
method put (line 88) | def put(self, key: int, value: int) -> None:
class LRUCache (line 76) | class LRUCache:
method __init__ (line 16) | def __init__(self, capacity: int):
method get (line 25) | def get(self, key: int) -> int:
method put (line 34) | def put(self, key: int, value: int) -> None:
method add (line 48) | def add(self, node):
method remove (line 57) | def remove(self, node):
method __init__ (line 78) | def __init__(self, capacity: int):
method get (line 82) | def get(self, key: int) -> int:
method put (line 88) | def put(self, key: int, value: int) -> None:
FILE: Python/0148-sort-list.py
class ListNode (line 6) | class ListNode:
method __init__ (line 7) | def __init__(self, val=0, next=None):
class Solution (line 12) | class Solution:
method sortList (line 13) | def sortList(self, head: Optional[ListNode]) -> Optional[ListNode]:
method merge (line 21) | def merge(self, list1: Optional[ListNode], list2: Optional[ListNode]) ...
method getMid (line 35) | def getMid(self, head: Optional[ListNode]) -> Optional[ListNode]:
function printLinkedList (line 46) | def printLinkedList(head):
FILE: Python/0149-max-points-on-a-line.py
class Solution (line 8) | class Solution:
method maxPoints (line 9) | def maxPoints(self, points: List[List[int]]) -> int:
FILE: Python/0150-evaluate-reverse-polish-notation.py
class Solution (line 6) | class Solution:
method evalRPN (line 7) | def evalRPN(self, tokens: List[str]) -> int:
FILE: Python/0151-reverse-words-in-a-string.py
class Solution (line 3) | class Solution:
method reverseWords (line 4) | def reverseWords(self, s: str) -> str:
FILE: Python/0152-maximum-product-subarray.py
class Solution (line 6) | class Solution:
method maxProduct (line 7) | def maxProduct(self, nums: List[int]) -> int:
FILE: Python/0153-find-minimum-in-rotated-sorted-array.py
class Solution (line 6) | class Solution:
method findMin (line 7) | def findMin(self, nums: List[int]) -> int:
FILE: Python/0155-min-stack.py
class MinStack (line 3) | class MinStack:
method __init__ (line 5) | def __init__(self):
method push (line 9) | def push(self, val: int) -> None:
method pop (line 14) | def pop(self) -> None:
method top (line 19) | def top(self) -> int:
method getMin (line 22) | def getMin(self) -> int:
FILE: Python/0159-longest-substring-with-at-most-two-distinct-characters.py
class Solution (line 6) | class Solution:
method lengthOfLongestSubstringTwoDistinct (line 7) | def lengthOfLongestSubstringTwoDistinct(self, s: 'str') -> 'int':
FILE: Python/0160-intersection-of-two-linked-lists.py
class ListNode (line 6) | class ListNode:
method __init__ (line 7) | def __init__(self, x):
class Solution (line 12) | class Solution:
method getIntersectionNode (line 13) | def getIntersectionNode(self, headA: Optional[ListNode], headB: Option...
FILE: Python/0162-find-peak-element.py
class Solution (line 6) | class Solution:
method findPeakElement (line 7) | def findPeakElement(self, nums: List[int]) -> int:
FILE: Python/0165-compare-version-numbers.py
class Solution (line 3) | class Solution:
method compareVersion (line 4) | def compareVersion(self, version1: str, version2: str) -> int:
FILE: Python/0166-fraction-to-recurring-decimal.py
class Solution (line 3) | class Solution:
method fractionToDecimal (line 4) | def fractionToDecimal(self, numerator: int, denominator: int) -> str:
FILE: Python/0167-two-sum-ii-input-array-is-sorted.py
class Solution (line 6) | class Solution:
method twoSum (line 7) | def twoSum(self, numbers: List[int], target: int) -> List[int]:
FILE: Python/0168-excel-sheet-column-title.py
class Solution (line 1) | class Solution:
method convertToTitle (line 2) | def convertToTitle(self, columnNumber: int) -> str:
FILE: Python/0169-majority-element.py
class Solution (line 7) | class Solution:
method majorityElement (line 8) | def majorityElement(self, nums: List[int]) -> int:
FILE: Python/0170-two-sum-iii-data-structure-design.py
class TwoSum (line 3) | class TwoSum:
method __init__ (line 5) | def __init__(self):
method add (line 8) | def add(self, number: int) -> None:
method find (line 14) | def find(self, value: int) -> bool:
FILE: Python/0172-factorial-trailing-zeroes.py
class Solution (line 3) | class Solution:
method trailingZeroes (line 4) | def trailingZeroes(self, n: int) -> int:
FILE: Python/0173-binary-search-tree-iterator.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class BSTIterator (line 13) | class BSTIterator:
method __init__ (line 15) | def __init__(self, root: Optional[TreeNode]):
method traverse (line 21) | def traverse(self, node: Optional[TreeNode]):
method next (line 28) | def next(self) -> int:
method hasNext (line 32) | def hasNext(self) -> bool:
FILE: Python/0179-largest-number.py
class Solution (line 7) | class Solution:
method largestNumber (line 8) | def largestNumber(self, nums: List[int]) -> str:
FILE: Python/0187-repeated-dna-sequences.py
class Solution (line 6) | class Solution:
method findRepeatedDnaSequences (line 7) | def findRepeatedDnaSequences(self, s: str) -> List[str]:
FILE: Python/0188-best-time-to-buy-and-sell-stock-iv.py
class Solution (line 6) | class Solution:
method maxProfit (line 7) | def maxProfit(self, k: int, prices: List[int]) -> int:
method maxProfit (line 22) | def maxProfit(self, k: int, prices: List[int]) -> int:
class Solution (line 21) | class Solution:
method maxProfit (line 7) | def maxProfit(self, k: int, prices: List[int]) -> int:
method maxProfit (line 22) | def maxProfit(self, k: int, prices: List[int]) -> int:
FILE: Python/0190-reverse-bits.py
class Solution (line 3) | class Solution:
method reverseBits (line 4) | def reverseBits(self, n: int) -> int:
FILE: Python/0191-number-of-1-bits.py
class Solution (line 3) | class Solution:
method hammingWeight (line 4) | def hammingWeight(self, n: int) -> int:
FILE: Python/0198-house-robber.py
class Solution (line 7) | class Solution:
method rob (line 8) | def rob(self, nums: List[int]) -> int:
method rob (line 22) | def rob(self, nums: List[int]) -> int:
class Solution (line 21) | class Solution:
method rob (line 8) | def rob(self, nums: List[int]) -> int:
method rob (line 22) | def rob(self, nums: List[int]) -> int:
FILE: Python/0199-binary-tree-right-side-view.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method rightSideView (line 14) | def rightSideView(self, root: Optional[TreeNode]) -> List[int]:
method rightSideView (line 33) | def rightSideView(self, root: Optional[TreeNode]) -> List[int]:
class Solution (line 32) | class Solution:
method rightSideView (line 14) | def rightSideView(self, root: Optional[TreeNode]) -> List[int]:
method rightSideView (line 33) | def rightSideView(self, root: Optional[TreeNode]) -> List[int]:
FILE: Python/0200-number-of-islands.py
class Solution (line 7) | class Solution:
method dfs (line 8) | def dfs(self, grid: List[List[str]], r: int, c: int) -> None:
method numIslands (line 21) | def numIslands(self, grid: List[List[str]]) -> int:
method numIslands (line 73) | def numIslands(self, grid: List[List[str]]) -> int:
method numIslands (line 90) | def numIslands(self, grid: List[List[str]]) -> int:
class UnionFind (line 33) | class UnionFind:
method __init__ (line 34) | def __init__(self, grid):
method find (line 49) | def find(self, i):
method union (line 54) | def union(self, x, y):
method getCount (line 68) | def getCount(self):
class Solution (line 72) | class Solution:
method dfs (line 8) | def dfs(self, grid: List[List[str]], r: int, c: int) -> None:
method numIslands (line 21) | def numIslands(self, grid: List[List[str]]) -> int:
method numIslands (line 73) | def numIslands(self, grid: List[List[str]]) -> int:
method numIslands (line 90) | def numIslands(self, grid: List[List[str]]) -> int:
class Solution (line 89) | class Solution:
method dfs (line 8) | def dfs(self, grid: List[List[str]], r: int, c: int) -> None:
method numIslands (line 21) | def numIslands(self, grid: List[List[str]]) -> int:
method numIslands (line 73) | def numIslands(self, grid: List[List[str]]) -> int:
method numIslands (line 90) | def numIslands(self, grid: List[List[str]]) -> int:
FILE: Python/0201-bitwise-and-of-numbers-range.py
class Solution (line 3) | class Solution:
method rangeBitwiseAnd (line 4) | def rangeBitwiseAnd(self, left: int, right: int) -> int:
FILE: Python/0202-happy-number.py
class Solution (line 3) | class Solution:
method isHappy (line 4) | def isHappy(self, n: int) -> bool:
FILE: Python/0203-remove-linked-list-elements.py
class ListNode (line 6) | class ListNode:
method __init__ (line 7) | def __init__(self, val=0, next=None):
class Solution (line 12) | class Solution:
method removeElements (line 13) | def removeElements(self, head: Optional[ListNode], val: int) -> Option...
FILE: Python/0205-isomorphic-strings.py
class Solution (line 4) | class Solution:
method isIsomorphic (line 5) | def isIsomorphic(self, s: str, t: str) -> bool:
FILE: Python/0206-reverse-linked-list.py
class ListNode (line 6) | class ListNode:
method __init__ (line 7) | def __init__(self, val=0, next=None):
class Solution (line 12) | class Solution:
method reverseList (line 13) | def reverseList(self, head: Optional[ListNode]) -> Optional[ListNode]:
method reverseList (line 26) | def reverseList(self, head: ListNode) -> ListNode:
class Solution (line 25) | class Solution:
method reverseList (line 13) | def reverseList(self, head: Optional[ListNode]) -> Optional[ListNode]:
method reverseList (line 26) | def reverseList(self, head: ListNode) -> ListNode:
FILE: Python/0207-course-schedule.py
class Solution (line 7) | class Solution:
method canFinish (line 8) | def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -...
FILE: Python/0208-implement-trie-prefix-tree.py
class TrieNode (line 10) | class TrieNode:
method __init__ (line 11) | def __init__(self, char: str = ""):
class Trie (line 17) | class Trie:
method __init__ (line 18) | def __init__(self):
method insert (line 21) | def insert(self, word: str):
method search (line 32) | def search(self, word: str):
method startsWith (line 40) | def startsWith(self, prefix: str):
FILE: Python/0209-minimum-size-subarray-sum.py
class Solution (line 6) | class Solution:
method minSubArrayLen (line 7) | def minSubArrayLen(self, target: int, nums: List[int]) -> int:
method minSubArrayLen (line 22) | def minSubArrayLen(self, target: int, nums: List[int]) -> int:
class Solution (line 21) | class Solution:
method minSubArrayLen (line 7) | def minSubArrayLen(self, target: int, nums: List[int]) -> int:
method minSubArrayLen (line 22) | def minSubArrayLen(self, target: int, nums: List[int]) -> int:
FILE: Python/0210-course-schedule-ii.py
class Solution (line 7) | class Solution:
method findOrder (line 8) | def findOrder(self, numCourses: int, prerequisites: List[List[int]]) -...
FILE: Python/0211-design-add-and-search-words-data-structure.py
class TrieNode (line 1) | class TrieNode:
method __init__ (line 2) | def __init__(self):
class WordDictionary (line 6) | class WordDictionary:
method __init__ (line 7) | def __init__(self):
method addWord (line 12) | def addWord(self, word: str) -> None:
method search (line 24) | def search(self, word: str) -> bool:
FILE: Python/0212-word-search-ii.py
class Solution (line 6) | class Solution:
method findWords (line 7) | def findWords(self, board: List[List[str]], words: List[str]) -> List[...
method findWords (line 91) | def findWords(self, board: List[List[str]], words: List[str]) -> List[...
class TrieNode (line 48) | class TrieNode:
method __init__ (line 49) | def __init__(self, char=""):
class Trie (line 55) | class Trie:
method __init__ (line 56) | def __init__(self):
method insert (line 59) | def insert(self, word):
method startWith (line 67) | def startWith(self, prefix):
method removeChar (line 75) | def removeChar(self, word):
class Solution (line 90) | class Solution:
method findWords (line 7) | def findWords(self, board: List[List[str]], words: List[str]) -> List[...
method findWords (line 91) | def findWords(self, board: List[List[str]], words: List[str]) -> List[...
FILE: Python/0213-house-robber-ii.py
class Solution (line 7) | class Solution:
method rob (line 8) | def rob(self, nums: List[int]) -> int:
method rob (line 27) | def rob(self, nums: List[int]) -> int:
class Solution (line 26) | class Solution:
method rob (line 8) | def rob(self, nums: List[int]) -> int:
method rob (line 27) | def rob(self, nums: List[int]) -> int:
FILE: Python/0214-shortest-palindrome.py
class Solution (line 3) | class Solution:
method shortestPalindrome (line 4) | def shortestPalindrome(self, s: str) -> str:
method preprocessString (line 34) | def preprocessString(self, s: str) -> str:
FILE: Python/0215-kth-largest-element-in-an-array.py
class Solution (line 7) | class Solution:
method findKthLargest (line 8) | def findKthLargest(self, nums: List[int], k: int) -> int:
FILE: Python/0216-combination-sum-iii.py
class Solution (line 6) | class Solution:
method combinationSum3 (line 7) | def combinationSum3(self, k: int, n: int) -> List[List[int]]:
FILE: Python/0217-contains-duplicate.py
class Solution (line 6) | class Solution:
method containsDuplicate (line 7) | def containsDuplicate(self, nums: List[int]) -> bool:
FILE: Python/0218-the-skyline-problem.py
class UnionFind (line 6) | class UnionFind:
method __init__ (line 7) | def __init__(self, n):
method find (line 10) | def find(self, num):
method union (line 15) | def union(self, x, y):
class Solution (line 19) | class Solution:
method getSkyline (line 20) | def getSkyline(self, buildings: List[List[int]]) -> List[List[int]]:
FILE: Python/0219-contains-duplicate-ii.py
class Solution (line 6) | class Solution:
method containsNearbyDuplicate (line 7) | def containsNearbyDuplicate(self, nums: List[int], k: int) -> bool:
FILE: Python/0221-maximal-square.py
class Solution (line 6) | class Solution:
method maximalSquare (line 7) | def maximalSquare(self, matrix: List[List[str]]) -> int:
FILE: Python/0222-count-complete-tree-nodes.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method countNodes (line 14) | def countNodes(self, root: Optional[TreeNode]) -> int:
FILE: Python/0224-basic-calculator.py
class Solution (line 6) | class Solution:
method calculate (line 7) | def calculate(self, s: str) -> int:
FILE: Python/0225-implement-stack-using-queues.py
class MyStack (line 4) | class MyStack:
method __init__ (line 6) | def __init__(self):
method push (line 9) | def push(self, x: int) -> None:
method pop (line 12) | def pop(self) -> int:
method top (line 15) | def top(self) -> int:
method empty (line 18) | def empty(self) -> bool:
FILE: Python/0226-invert-binary-tree.py
class Solution (line 1) | class Solution(object):
method invertTree (line 2) | def invertTree(self, root):
FILE: Python/0227-basic-calculator-ii.py
class Solution (line 6) | class Solution:
method calculate (line 7) | def calculate(self, s: str) -> int:
FILE: Python/0228-summary-ranges.py
class Solution (line 6) | class Solution:
method summaryRanges (line 7) | def summaryRanges(self, nums: List[int]) -> List[str]:
FILE: Python/0229-majority-element-ii.py
class Solution (line 5) | class Solution:
method majorityElement (line 6) | def majorityElement(self, nums: List[int]) -> List[int]:
FILE: Python/0230-kth-smallest-element-in-a-bst.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method addToArr (line 14) | def addToArr(self, node: Optional[TreeNode], treeList: List[int]) -> N...
method kthSmallest (line 20) | def kthSmallest(self, root: Optional[TreeNode], k: int) -> int:
method kthSmallest (line 28) | def kthSmallest(self, root: Optional[TreeNode], k: int) -> int:
class Solution (line 27) | class Solution:
method addToArr (line 14) | def addToArr(self, node: Optional[TreeNode], treeList: List[int]) -> N...
method kthSmallest (line 20) | def kthSmallest(self, root: Optional[TreeNode], k: int) -> int:
method kthSmallest (line 28) | def kthSmallest(self, root: Optional[TreeNode], k: int) -> int:
FILE: Python/0231-power-of-two.py
class Solution (line 3) | class Solution:
method isPowerOfTwo (line 4) | def isPowerOfTwo(self, n: int) -> bool:
FILE: Python/0232-implement-queue-using-stacks.py
class MyQueue (line 1) | class MyQueue:
method __init__ (line 3) | def __init__(self):
method push (line 9) | def push(self, x: int) -> None:
method pop (line 19) | def pop(self) -> int:
method peek (line 24) | def peek(self) -> int:
method empty (line 29) | def empty(self) -> bool:
FILE: Python/0234-palindrome-linked-list.py
class ListNode (line 6) | class ListNode:
method __init__ (line 7) | def __init__(self, val=0, next=None):
method __init__ (line 54) | def __init__(self, val=0, next=None):
class Solution (line 12) | class Solution:
method isPalindrome (line 13) | def isPalindrome(self, head: ListNode) -> bool:
method endOfFirstHalf (line 31) | def endOfFirstHalf(self, head: ListNode) -> ListNode:
method reverseList (line 39) | def reverseList(self, head: ListNode) -> ListNode:
method isPalindrome (line 60) | def isPalindrome(self, head: Optional[ListNode]) -> bool:
class ListNode (line 53) | class ListNode:
method __init__ (line 7) | def __init__(self, val=0, next=None):
method __init__ (line 54) | def __init__(self, val=0, next=None):
class Solution (line 59) | class Solution:
method isPalindrome (line 13) | def isPalindrome(self, head: ListNode) -> bool:
method endOfFirstHalf (line 31) | def endOfFirstHalf(self, head: ListNode) -> ListNode:
method reverseList (line 39) | def reverseList(self, head: ListNode) -> ListNode:
method isPalindrome (line 60) | def isPalindrome(self, head: Optional[ListNode]) -> bool:
FILE: Python/0235-lowest-common-ancestor-of-a-binary-search-tree.py
class Solution (line 8) | class Solution:
method lowestCommonAncestor (line 9) | def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'Tr...
FILE: Python/0236-lowest-common-ancestor-of-a-binary-tree.py
class TreeNode (line 3) | class TreeNode:
method __init__ (line 4) | def __init__(self, x):
class Solution (line 10) | class Solution:
method lowestCommonAncestor (line 11) | def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'Tr...
method lowestCommonAncestor (line 26) | def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'Tr...
class Solution (line 25) | class Solution:
method lowestCommonAncestor (line 11) | def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'Tr...
method lowestCommonAncestor (line 26) | def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'Tr...
FILE: Python/0237-delete-node-in-a-linked-list.py
class Solution (line 3) | class Solution:
method deleteNode (line 4) | def deleteNode(self, node):
FILE: Python/0238-product-of-array-except-self.py
class Solution (line 6) | class Solution:
method productExceptSelf (line 7) | def productExceptSelf(self, nums: List[int]) -> List[int]:
FILE: Python/0239-sliding-window-maximum.py
class Solution (line 7) | class Solution:
method maxSlidingWindow (line 8) | def maxSlidingWindow(self, nums: List[int], k: int) -> List[int]:
FILE: Python/0240-search-a-2d-matrix-ii.py
class Solution (line 6) | class Solution:
method binarySearch (line 7) | def binarySearch(self, matrix, target, start, vertical):
method searchMatrix (line 28) | def searchMatrix(self, matrix: List[List[int]], target: int) -> bool:
FILE: Python/0241-different-ways-to-add-parentheses.py
class Solution (line 6) | class Solution:
method diffWaysToCompute (line 7) | def diffWaysToCompute(self, expression: str) -> List[int]:
FILE: Python/0242-valid-anagram.py
class Solution (line 5) | class Solution(object):
method isAnagram (line 6) | def isAnagram(self, s, t):
FILE: Python/0244-shortest-word-distance-ii.py
class WordDistance (line 7) | class WordDistance:
method __init__ (line 9) | def __init__(self, wordsDict: List[str]):
method shortest (line 15) | def shortest(self, word1: str, word2: str) -> int:
FILE: Python/0246-strobogrammatic-number.py
class Solution (line 3) | class Solution:
method isStrobogrammatic (line 4) | def isStrobogrammatic(self, num: str) -> bool:
FILE: Python/0249-group-shifted-strings.py
class Solution (line 7) | class Solution:
method convertString (line 8) | def convertString(self, string: str):
method groupStrings (line 16) | def groupStrings(self, strings: List[str]) -> List[List[str]]:
FILE: Python/0250-count-univalue-subtrees.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method countUnivalSubtrees (line 14) | def countUnivalSubtrees(self, root: Optional[TreeNode]) -> int:
FILE: Python/0252-meeting-rooms.py
class Solution (line 6) | class Solution:
method canAttendMeetings (line 7) | def canAttendMeetings(self, intervals: List[List[int]]) -> bool:
FILE: Python/0253-meeting-rooms-ii.py
class Solution (line 7) | class Solution:
method minMeetingRooms (line 8) | def minMeetingRooms(self, intervals: List[List[int]]) -> int:
FILE: Python/0254-factor-combinations.py
class Solution (line 6) | class Solution:
method getFactors (line 7) | def getFactors(self, n: int) -> List[List[int]]:
FILE: Python/0255-verify-preorder-sequence-in-binary-search-tree.py
class Solution (line 7) | class Solution:
method verifyPreorder (line 8) | def verifyPreorder(self, preorder: List[int]) -> bool:
FILE: Python/0256-paint-house.py
class Solution (line 7) | class Solution:
method minCost (line 8) | def minCost(self, costs: List[List[int]]) -> int:
method minCost (line 29) | def minCost(self, costs: List[List[int]]) -> int:
class Solution (line 28) | class Solution:
method minCost (line 8) | def minCost(self, costs: List[List[int]]) -> int:
method minCost (line 29) | def minCost(self, costs: List[List[int]]) -> int:
FILE: Python/0257-binary-tree-paths.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method binaryTreePaths (line 14) | def binaryTreePaths(self, root: Optional[TreeNode]) -> List[str]:
FILE: Python/0259-3sum-smaller.py
class Solution (line 6) | class Solution:
method threeSumSmaller (line 7) | def threeSumSmaller(self, nums: List[int], target: int) -> int:
method twoSumSmaller (line 14) | def twoSumSmaller(self, nums: List[int], startIdx: int, target: int) -...
FILE: Python/0260-single-number-iii.py
class Solution (line 6) | class Solution:
method singleNumber (line 7) | def singleNumber(self, nums: List[int]) -> List[int]:
FILE: Python/0261-graph-valid-tree.py
class UnionFind (line 7) | class UnionFind:
method __init__ (line 8) | def __init__(self, size):
method find (line 12) | def find(self, node):
method union (line 17) | def union(self, node1, node2):
class Solution (line 33) | class Solution:
method validTree (line 34) | def validTree(self, n: int, edges: List[List[int]]) -> bool:
method validTree (line 45) | def validTree(self, n: int, edges: List[List[int]]) -> bool:
method validTree (line 69) | def validTree(self, n: int, edges: List[List[int]]) -> bool:
class Solution (line 44) | class Solution:
method validTree (line 34) | def validTree(self, n: int, edges: List[List[int]]) -> bool:
method validTree (line 45) | def validTree(self, n: int, edges: List[List[int]]) -> bool:
method validTree (line 69) | def validTree(self, n: int, edges: List[List[int]]) -> bool:
class Solution (line 68) | class Solution:
method validTree (line 34) | def validTree(self, n: int, edges: List[List[int]]) -> bool:
method validTree (line 45) | def validTree(self, n: int, edges: List[List[int]]) -> bool:
method validTree (line 69) | def validTree(self, n: int, edges: List[List[int]]) -> bool:
FILE: Python/0263-ugly-number.py
class Solution (line 3) | class Solution:
method isUgly (line 4) | def isUgly(self, n: int) -> bool:
FILE: Python/0264-ugly-number-ii.py
class Solution (line 3) | class Solution:
method nthUglyNumber (line 4) | def nthUglyNumber(self, n: int) -> int:
FILE: Python/0265-paint-house-ii.py
class Solution (line 6) | class Solution:
method minCostII (line 7) | def minCostII(self, costs: List[List[int]]) -> int:
FILE: Python/0266-palindrome-permutation.py
class Solution (line 6) | class Solution:
method canPermutePalindrome (line 7) | def canPermutePalindrome(self, s: str) -> bool:
FILE: Python/0268-missing-number.py
class Solution (line 6) | class Solution:
method missingNumber (line 7) | def missingNumber(self, nums: List[int]) -> int:
FILE: Python/0269-alien-dictionary.py
class Solution (line 7) | class Solution:
method alienOrder (line 8) | def alienOrder(self, words: List[str]) -> str:
method alienOrder (line 40) | def alienOrder(self, words: List[str]) -> str:
class Solution (line 39) | class Solution:
method alienOrder (line 8) | def alienOrder(self, words: List[str]) -> str:
method alienOrder (line 40) | def alienOrder(self, words: List[str]) -> str:
FILE: Python/0270-closest-binary-search-tree-value.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method closestValue (line 14) | def closestValue(self, root: Optional[TreeNode], target: float) -> int:
FILE: Python/0271-encode-and-decode-strings.py
class Codec (line 6) | class Codec:
method __init__ (line 7) | def __init__(self):
method encode (line 10) | def encode(self, strs: List[str]) -> str:
method decode (line 17) | def decode(self, s: str) -> List[str]:
FILE: Python/0272-closest-binary-search-tree-value-ii.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method closestKValues (line 14) | def closestKValues(self, root: Optional[TreeNode], target: float, k: i...
FILE: Python/0273-integer-to-english-words.py
class Solution (line 1) | class Solution:
method numberToWords (line 2) | def numberToWords(self, num: int) -> str:
FILE: Python/0274-h-index.py
class Solution (line 6) | class Solution:
method hIndex (line 7) | def hIndex(self, citations: List[int]) -> int:
FILE: Python/0276-paint-fence.py
class Solution (line 6) | class Solution:
method numWays (line 7) | def numWays(self, n: int, k: int) -> int:
FILE: Python/0277-find-the-celebrity.py
function knows (line 6) | def knows(a: int, b: int) -> bool:
class Solution (line 10) | class Solution:
method findCelebrity (line 11) | def findCelebrity(self, n: int) -> int:
method isCelebrity (line 21) | def isCelebrity(self, i):
FILE: Python/0278-first-bad-version.py
function isBadVersion (line 3) | def isBadVersion(version: int) -> bool:
class Solution (line 9) | class Solution:
method firstBadVersion (line 10) | def firstBadVersion(self, n: int) -> int:
FILE: Python/0279-perfect-squares.py
class Solution (line 6) | class Solution(object):
method numSquares (line 7) | def numSquares(self, n):
method numSquares (line 26) | def numSquares(self, n: int) -> int:
method numSquares (line 41) | def numSquares(self, n):
method numSquares (line 59) | def numSquares(self, n):
method isSquare (line 82) | def isSquare(self, n: int) -> bool:
method numSquares (line 86) | def numSquares(self, n: int) -> int:
class Solution (line 25) | class Solution:
method numSquares (line 7) | def numSquares(self, n):
method numSquares (line 26) | def numSquares(self, n: int) -> int:
method numSquares (line 41) | def numSquares(self, n):
method numSquares (line 59) | def numSquares(self, n):
method isSquare (line 82) | def isSquare(self, n: int) -> bool:
method numSquares (line 86) | def numSquares(self, n: int) -> int:
class Solution (line 40) | class Solution:
method numSquares (line 7) | def numSquares(self, n):
method numSquares (line 26) | def numSquares(self, n: int) -> int:
method numSquares (line 41) | def numSquares(self, n):
method numSquares (line 59) | def numSquares(self, n):
method isSquare (line 82) | def isSquare(self, n: int) -> bool:
method numSquares (line 86) | def numSquares(self, n: int) -> int:
class Solution (line 58) | class Solution:
method numSquares (line 7) | def numSquares(self, n):
method numSquares (line 26) | def numSquares(self, n: int) -> int:
method numSquares (line 41) | def numSquares(self, n):
method numSquares (line 59) | def numSquares(self, n):
method isSquare (line 82) | def isSquare(self, n: int) -> bool:
method numSquares (line 86) | def numSquares(self, n: int) -> int:
class Solution (line 81) | class Solution:
method numSquares (line 7) | def numSquares(self, n):
method numSquares (line 26) | def numSquares(self, n: int) -> int:
method numSquares (line 41) | def numSquares(self, n):
method numSquares (line 59) | def numSquares(self, n):
method isSquare (line 82) | def isSquare(self, n: int) -> bool:
method numSquares (line 86) | def numSquares(self, n: int) -> int:
FILE: Python/0283-move-zeroes.py
class Solution (line 6) | class Solution:
method moveZeroes (line 7) | def moveZeroes(self, nums: List[int]) -> None:
FILE: Python/0285-inorder-successor-in-bst.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, x):
class Solution (line 13) | class Solution:
method inorderSuccessor (line 14) | def inorderSuccessor(self, root: TreeNode, p: TreeNode) -> Optional[Tr...
FILE: Python/0286-walls-and-gates.py
class Solution (line 7) | class Solution:
method wallsAndGates (line 8) | def wallsAndGates(self, rooms: List[List[int]]) -> None:
FILE: Python/0287-find-the-duplicate-number.py
class Solution (line 6) | class Solution:
method findDuplicate (line 7) | def findDuplicate(self, nums: List[int]) -> int:
method findDuplicate (line 24) | def findDuplicate(self, nums: List[int]) -> int:
class Solution (line 23) | class Solution:
method findDuplicate (line 7) | def findDuplicate(self, nums: List[int]) -> int:
method findDuplicate (line 24) | def findDuplicate(self, nums: List[int]) -> int:
FILE: Python/0289-game-of-life.py
class Solution (line 6) | class Solution:
method gameOfLife (line 7) | def gameOfLife(self, board: List[List[int]]) -> None:
FILE: Python/0290-word-pattern.py
class Solution (line 3) | class Solution:
method wordPattern (line 4) | def wordPattern(self, pattern: str, s: str) -> bool:
FILE: Python/0291-word-pattern-ii.py
class Solution (line 6) | class Solution:
method wordPatternMatch (line 7) | def wordPatternMatch(self, pattern: str, s: str) -> bool:
FILE: Python/0293-flip-game.py
class Solution (line 6) | class Solution:
method generatePossibleNextMoves (line 7) | def generatePossibleNextMoves(self, currentState: str) -> List[str]:
FILE: Python/0295-find-median-from-data-stream.py
class MedianFinder (line 6) | class MedianFinder:
method __init__ (line 8) | def __init__(self):
method addNum (line 13) | def addNum(self, num: int) -> None:
method findMedian (line 19) | def findMedian(self) -> float:
FILE: Python/0296-best-meeting-point.py
class Solution (line 4) | class Solution:
method minTotalDistance (line 5) | def minTotalDistance(self, grid: List[List[int]]) -> int:
FILE: Python/0297-serialize-and-deserialize-binary-tree.py
class Codec (line 9) | class Codec:
method serialize (line 10) | def serialize(self, root: Optional[TreeNode]) -> str:
method deserialize (line 26) | def deserialize(self, data: str) -> Optional[TreeNode]:
FILE: Python/0298-binary-tree-longest-consecutive-sequence.py
class TreeNode (line 7) | class TreeNode:
method __init__ (line 8) | def __init__(self, val=0, left=None, right=None):
class Solution (line 14) | class Solution:
method longestConsecutive (line 15) | def longestConsecutive(self, root: Optional[TreeNode]) -> int:
FILE: Python/0299-bulls-and-cows.py
class Solution (line 6) | class Solution:
method getHint (line 7) | def getHint(self, secret: str, guess: str) -> str:
FILE: Python/0300-longest-increasing-subsequence.py
class Solution (line 7) | class Solution:
method lengthOfLIS (line 8) | def lengthOfLIS(self, nums: List[int]) -> int:
method lengthOfLIS (line 21) | def lengthOfLIS(self, nums: List[int]) -> int:
method lengthOfLIS (line 31) | def lengthOfLIS(self, nums: List[int]) -> int:
class Solution (line 20) | class Solution:
method lengthOfLIS (line 8) | def lengthOfLIS(self, nums: List[int]) -> int:
method lengthOfLIS (line 21) | def lengthOfLIS(self, nums: List[int]) -> int:
method lengthOfLIS (line 31) | def lengthOfLIS(self, nums: List[int]) -> int:
class Solution (line 30) | class Solution:
method lengthOfLIS (line 8) | def lengthOfLIS(self, nums: List[int]) -> int:
method lengthOfLIS (line 21) | def lengthOfLIS(self, nums: List[int]) -> int:
method lengthOfLIS (line 31) | def lengthOfLIS(self, nums: List[int]) -> int:
FILE: Python/0301-remove-invalid-parentheses.py
class Solution (line 6) | class Solution:
method removeInvalidParentheses (line 7) | def removeInvalidParentheses(self, s: str) -> List[str]:
FILE: Python/0302-smallest-rectangle-enclosing-black-pixels.py
class Solution (line 6) | class Solution:
method minArea (line 7) | def minArea(self, image: List[List[str]], x: int, y: int) -> int:
FILE: Python/0303-range-sum-query-immutable.py
class NumArray (line 6) | class NumArray:
method __init__ (line 8) | def __init__(self, nums: List[int]):
method sumRange (line 13) | def sumRange(self, left: int, right: int) -> int:
method __init__ (line 21) | def __init__(self, nums: List[int]):
method buildTree (line 26) | def buildTree(self, idx, start, end, nums):
method rangeSumQuery (line 40) | def rangeSumQuery(self, idx, left, right, start, end):
method sumRange (line 53) | def sumRange(self, left: int, right: int) -> int:
class NumArray (line 20) | class NumArray:
method __init__ (line 8) | def __init__(self, nums: List[int]):
method sumRange (line 13) | def sumRange(self, left: int, right: int) -> int:
method __init__ (line 21) | def __init__(self, nums: List[int]):
method buildTree (line 26) | def buildTree(self, idx, start, end, nums):
method rangeSumQuery (line 40) | def rangeSumQuery(self, idx, left, right, start, end):
method sumRange (line 53) | def sumRange(self, left: int, right: int) -> int:
FILE: Python/0304-range-sum-query-2d-immutable.py
class NumMatrix (line 6) | class NumMatrix:
method __init__ (line 8) | def __init__(self, matrix: List[List[int]]):
method sumRegion (line 19) | def sumRegion(self, row1: int, col1: int, row2: int, col2: int) -> int:
FILE: Python/0305-number-of-islands-ii.py
class Solution (line 6) | class Solution:
class UnionFind (line 7) | class UnionFind:
method __init__ (line 8) | def __init__(self, size):
method find (line 13) | def find(self, node):
method union (line 18) | def union(self, node1, node2):
method numIslands2 (line 31) | def numIslands2(self, m: int, n: int, positions: List[List[int]]) -> L...
FILE: Python/0307-range-sum-query-mutable.py
class NumArray (line 8) | class NumArray:
method __init__ (line 10) | def __init__(self, nums: List[int]):
method buildTree (line 15) | def buildTree(self, nums, nodeIdx, start, end):
method update (line 29) | def update(self, index: int, val: int, nodeIdx = 0, start = 0, end = N...
method sumRange (line 47) | def sumRange(self, left: int, right: int, nodeIdx = 0, start = 0, end ...
FILE: Python/0309-best-time-to-buy-and-sell-stock-with-cooldown.py
class Solution (line 7) | class Solution:
method maxProfit (line 8) | def maxProfit(self, prices: List[int]) -> int:
FILE: Python/0310-minimum-height-trees.py
class Solution (line 6) | class Solution:
method findMinHeightTrees (line 7) | def findMinHeightTrees(self, n: int, edges: List[List[int]]) -> List[i...
FILE: Python/0311-sparse-matrix-multiplication.py
class Solution (line 6) | class Solution:
method multiply (line 7) | def multiply(self, mat1: List[List[int]], mat2: List[List[int]]) -> Li...
FILE: Python/0312-burst-balloons.py
class Solution (line 7) | class Solution:
method maxCoins (line 8) | def maxCoins(self, nums: List[int]) -> int:
method maxCoins (line 30) | def maxCoins(self, nums: List[int]) -> int:
class Solution (line 29) | class Solution:
method maxCoins (line 8) | def maxCoins(self, nums: List[int]) -> int:
method maxCoins (line 30) | def maxCoins(self, nums: List[int]) -> int:
FILE: Python/0314-binary-tree-vertical-order-traversal.py
class TreeNode (line 7) | class TreeNode:
method __init__ (line 8) | def __init__(self, val=0, left=None, right=None):
class Solution (line 14) | class Solution:
method verticalOrder (line 15) | def verticalOrder(self, root: Optional[TreeNode]) -> List[List[int]]:
FILE: Python/0315-count-of-smaller-numbers-after-self.py
class SegmentTree (line 6) | class SegmentTree:
method __init__ (line 7) | def __init__(self, size: int):
method update (line 11) | def update(self, idx: int, val: int, nodeIdx=0, start=0, end=None):
method query (line 29) | def query(self, left: int, right: int, nodeIdx=0, start=0, end=None) -...
class Solution (line 43) | class Solution:
method countSmaller (line 44) | def countSmaller(self, nums: List[int]) -> List[int]:
FILE: Python/0316-remove-duplicate-letters.py
class Solution (line 3) | class Solution:
method removeDuplicateLetters (line 4) | def removeDuplicateLetters(self, s: str) -> str:
FILE: Python/0317-shortest-distance-from-all-buildings.py
class Solution (line 7) | class Solution:
method shortestDistance (line 8) | def shortestDistance(self, grid: List[List[int]]) -> int:
FILE: Python/0320-generalized-abbreviation.py
class Solution (line 6) | class Solution:
method storeAbbreviations (line 7) | def storeAbbreviations(
method generateAbbreviations (line 35) | def generateAbbreviations(self, word: str) -> List[str]:
FILE: Python/0322-coin-change.py
class Solution (line 7) | class Solution:
method coinChange (line 8) | def coinChange(self, coins: List[int], amount: int) -> int:
method coinChange (line 17) | def coinChange(self, coins: List[int], amount: int) -> int:
class Solution (line 16) | class Solution:
method coinChange (line 8) | def coinChange(self, coins: List[int], amount: int) -> int:
method coinChange (line 17) | def coinChange(self, coins: List[int], amount: int) -> int:
FILE: Python/0323-number-of-connected-components-in-an-undirected-graph.py
class UnionFind (line 6) | class UnionFind():
method __init__ (line 7) | def __init__(self, n):
method find (line 11) | def find(self, node):
method union (line 16) | def union(self, node1, node2):
class Solution (line 29) | class Solution:
method countComponents (line 30) | def countComponents(self, n: int, edges: List[List[int]]) -> int:
FILE: Python/0325-maximum-size-subarray-sum-equals-k.py
class Solution (line 7) | class Solution:
method maxSubArrayLen (line 8) | def maxSubArrayLen(self, nums: List[int], k: int) -> int:
FILE: Python/0326-power-of-three.py
class Solution (line 3) | class Solution:
method isPowerOfThree (line 4) | def isPowerOfThree(self, n: int) -> bool:
FILE: Python/0327-count-of-range-sum.py
class SegmentTree (line 6) | class SegmentTree:
method __init__ (line 7) | def __init__(self, size: int):
method update (line 11) | def update(self, idx: int, val: int, nodeIdx=0, start=0, end=None):
method query (line 29) | def query(self, left: int, right: int, nodeIdx=0, start=0, end=None) -...
class Solution (line 43) | class Solution:
method countRangeSum (line 44) | def countRangeSum(self, nums: List[int], lower: int, upper: int) -> int:
FILE: Python/0328-odd-even-linked-list.py
class ListNode (line 6) | class ListNode:
method __init__ (line 7) | def __init__(self, val=0, next=None):
class Solution (line 12) | class Solution:
method oddEvenList (line 13) | def oddEvenList(self, head: Optional[ListNode]) -> Optional[ListNode]:
FILE: Python/0329-longest-increasing-path-in-a-matrix.py
class Solution (line 6) | class Solution:
method longestIncreasingPath (line 7) | def longestIncreasingPath(self, matrix: List[List[int]]) -> int:
FILE: Python/0330-patching-array.py
class Solution (line 6) | class Solution:
method minPatches (line 7) | def minPatches(self, nums: List[int], n: int) -> int:
FILE: Python/0331-verify-preorder-serialization-of-a-binary-tree.py
class Solution (line 3) | class Solution:
method isValidSerialization (line 4) | def isValidSerialization(self, preorder: str) -> bool:
FILE: Python/0332-reconstruct-itinerary.py
class Solution (line 7) | class Solution:
method findItinerary (line 8) | def findItinerary(self, tickets: List[List[str]]) -> List[str]:
FILE: Python/0333-largest-bst-subtree.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method isValid (line 14) | def isValid(self, root: Optional[TreeNode]) -> bool:
method countNode (line 24) | def countNode(self, root: Optional[TreeNode]) -> int:
method largestBSTSubtree (line 29) | def largestBSTSubtree(self, root: Optional[TreeNode]) -> int:
FILE: Python/0334-increasing-triplet-subsequence.py
class Solution (line 6) | class Solution:
method increasingTriplet (line 7) | def increasingTriplet(self, nums: List[int]) -> bool:
FILE: Python/0337-house-robber-iii.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method rob (line 14) | def rob(self, root: Optional[TreeNode]) -> int:
FILE: Python/0338-counting-bits.py
class Solution (line 6) | class Solution:
method countBits (line 7) | def countBits(self, n: int) -> List[int]:
method countBits (line 15) | def countBits(self, n: int) -> List[int]:
class Solution (line 14) | class Solution:
method countBits (line 7) | def countBits(self, n: int) -> List[int]:
method countBits (line 15) | def countBits(self, n: int) -> List[int]:
FILE: Python/0339-nested-list-weight-sum.py
class Solution (line 46) | class Solution:
method depthSum (line 47) | def depthSum(self, nestedList: List[NestedInteger]) -> int:
FILE: Python/0340-longest-substring-with-at-most-k-distinct-characters.py
class Solution (line 6) | class Solution:
method lengthOfLongestSubstringKDistinct (line 7) | def lengthOfLongestSubstringKDistinct(self, s: str, k: int) -> int:
FILE: Python/0341-flatten-nested-list-iterator.py
class NestedIterator (line 1) | class NestedIterator:
method __init__ (line 2) | def __init__(self, nestedList: [NestedInteger]):
method next (line 13) | def next(self) -> int:
method hasNext (line 17) | def hasNext(self) -> bool:
FILE: Python/0342-power-of-four.py
class Solution (line 3) | class Solution:
method isPowerOfFour (line 4) | def isPowerOfFour(self, n: int) -> bool:
FILE: Python/0343-integer-break.py
class Solution (line 4) | class Solution:
method integerBreak (line 5) | def integerBreak(self, n: int) -> int:
FILE: Python/0344-reverse-string.py
class Solution (line 6) | class Solution:
method reverseString (line 7) | def reverseString(self, s: List[str]) -> None:
FILE: Python/0345-reverse-vowels-of-a-string.py
class Solution (line 3) | class Solution:
method reverseVowels (line 4) | def reverseVowels(self, s: str) -> str:
FILE: Python/0346-moving-average-from-data-stream.py
class MovingAverage (line 3) | class MovingAverage:
method __init__ (line 5) | def __init__(self, size: int):
method next (line 9) | def next(self, val: int) -> float:
FILE: Python/0347-top-k-frequent-elements.py
class Solution (line 8) | class Solution:
method topKFrequent (line 9) | def topKFrequent(self, nums: List[int], k: int) -> List[int]:
FILE: Python/0348-design-tic-tac-toe.py
class TicTacToe (line 3) | class TicTacToe:
method __init__ (line 5) | def __init__(self, n: int):
method move (line 11) | def move(self, row: int, col: int, player: int) -> int:
FILE: Python/0349-intersection-of-two-arrays.py
class Solution (line 6) | class Solution:
method intersection (line 7) | def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
method intersection (line 13) | def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
method intersection (line 19) | def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
method intersection (line 39) | def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
class Solution (line 12) | class Solution:
method intersection (line 7) | def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
method intersection (line 13) | def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
method intersection (line 19) | def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
method intersection (line 39) | def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
class Solution (line 18) | class Solution:
method intersection (line 7) | def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
method intersection (line 13) | def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
method intersection (line 19) | def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
method intersection (line 39) | def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
class Solution (line 38) | class Solution:
method intersection (line 7) | def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
method intersection (line 13) | def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
method intersection (line 19) | def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
method intersection (line 39) | def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
FILE: Python/0350-intersection-of-two-arrays-ii.py
class Solution (line 6) | class Solution:
method intersect (line 7) | def intersect(self, nums1: List[int], nums2: List[int]) -> List[int]:
FILE: Python/0351-android-unlock-patterns.py
class Solution (line 3) | class Solution:
method __init__ (line 4) | def __init__(self):
method validSelection (line 15) | def validSelection(self, candidate, keyPadNum):
method backtracking (line 22) | def backtracking(self, keyPadNum, numberOfPresses, keyPressesNeeded):
method numberOfPatterns (line 34) | def numberOfPatterns(self, m: int, n: int) -> int:
FILE: Python/0352-data-stream-as-disjoint-intervals.py
class SummaryRanges (line 6) | class SummaryRanges:
method __init__ (line 8) | def __init__(self):
method addNum (line 11) | def addNum(self, value: int) -> None:
method getIntervals (line 14) | def getIntervals(self) -> List[List[int]]:
FILE: Python/0353-domino-and-tromino-tiling.py
class Solution (line 6) | class Solution:
method numTilings (line 7) | def numTilings(self, n: int) -> int:
FILE: Python/0354-russian-doll-envelopes.py
class Solution (line 6) | class Solution:
method maxEnvelopes (line 7) | def maxEnvelopes(self, envelopes: List[List[int]]) -> int:
FILE: Python/0355-design-twitter.py
class Twitter (line 7) | class Twitter:
method __init__ (line 9) | def __init__(self):
method postTweet (line 14) | def postTweet(self, userId: int, tweetId: int) -> None:
method getNewsFeed (line 18) | def getNewsFeed(self, userId: int) -> List[int]:
method follow (line 30) | def follow(self, followerId: int, followeeId: int) -> None:
method unfollow (line 34) | def unfollow(self, followerId: int, followeeId: int) -> None:
FILE: Python/0358-rearrange-string-k-distance-apart.py
class Solution (line 5) | class Solution:
method rearrangeString (line 6) | def rearrangeString(self, s: str, k: int) -> str:
FILE: Python/0359-logger-rate-limiter.py
class Logger (line 6) | class Logger:
method __init__ (line 8) | def __init__(self):
method shouldPrintMessage (line 11) | def shouldPrintMessage(self, timestamp: int, message: str) -> bool:
FILE: Python/0361-bomb-enemy.py
class Solution (line 6) | class Solution:
method maxKilledEnemies (line 7) | def maxKilledEnemies(self, grid: List[List[str]]) -> int:
FILE: Python/0362-design-hit-counter.py
class HitCounter (line 1) | class HitCounter:
method __init__ (line 3) | def __init__(self):
method hit (line 6) | def hit(self, timestamp: int) -> None:
method getHits (line 9) | def getHits(self, timestamp: int) -> int:
FILE: Python/0364-nested-list-weight-sum-ii.py
class Solution (line 49) | class Solution:
method depthSumInverse (line 50) | def depthSumInverse(self, nestedList: List[NestedInteger]) -> int:
FILE: Python/0366-find-leaves-of-binary-tree.py
class TreeNode (line 7) | class TreeNode:
method __init__ (line 8) | def __init__(self, val=0, left=None, right=None):
class Solution (line 14) | class Solution:
method findLeaves (line 15) | def findLeaves(self, root: Optional[TreeNode]) -> List[List[int]]:
FILE: Python/0368-largest-divisible-subset.py
class Solution (line 6) | class Solution:
method largestDivisibleSubset (line 7) | def largestDivisibleSubset(self, nums: List[int]) -> List[int]:
FILE: Python/0370-range-addition.py
class Solution (line 6) | class Solution:
method getModifiedArray (line 7) | def getModifiedArray(self, length: int, updates: List[List[int]]) -> L...
FILE: Python/0371-sum-of-two-integers.py
class Solution (line 3) | class Solution:
method getSum (line 4) | def getSum(self, a: int, b: int) -> int:
method getSum (line 68) | def getSum(self, a: int, b: int) -> int:
class Solution (line 67) | class Solution:
method getSum (line 4) | def getSum(self, a: int, b: int) -> int:
method getSum (line 68) | def getSum(self, a: int, b: int) -> int:
FILE: Python/0373-find-k-pairs-with-smallest-sums.py
class Solution (line 7) | class Solution:
method kSmallestPairs (line 8) | def kSmallestPairs(self, nums1: List[int], nums2: List[int], k: int) -...
FILE: Python/0374-guess-number-higher-or-lower.py
function guess (line 3) | def guess(mid: int) -> int:
class Solution (line 12) | class Solution:
method guessNumber (line 13) | def guessNumber(self, n: int) -> int:
FILE: Python/0377-combination-sum-iv.py
class Solution (line 5) | class Solution:
method combinationSum4 (line 6) | def combinationSum4(self, nums: List[int], target: int) -> int:
FILE: Python/0378-kth-smallest-element-in-a-sorted-matrix.py
class Solution (line 7) | class Solution:
method kthSmallest (line 8) | def kthSmallest(self, matrix: List[List[int]], k: int) -> int:
FILE: Python/0380-insert-delete-getrandom-o1.py
class RandomizedSet (line 6) | class RandomizedSet:
method __init__ (line 8) | def __init__(self):
method insert (line 12) | def insert(self, val: int) -> bool:
method remove (line 19) | def remove(self, val: int) -> bool:
method getRandom (line 29) | def getRandom(self) -> int:
FILE: Python/0383-ransom-note.py
class Solution (line 5) | class Solution:
method canConstruct (line 6) | def canConstruct(self, ransomNote: str, magazine: str) -> bool:
FILE: Python/0386-lexicographical-numbers.py
class Solution (line 6) | class Solution:
method lexicalOrder (line 7) | def lexicalOrder(self, n: int) -> List[int]:
method generateLexicalNumbers (line 13) | def generateLexicalNumbers(self, currentNumber: int, limit: int, resul...
method lexicalOrder (line 26) | def lexicalOrder(self, n: int) -> List[int]:
class Solution (line 25) | class Solution:
method lexicalOrder (line 7) | def lexicalOrder(self, n: int) -> List[int]:
method generateLexicalNumbers (line 13) | def generateLexicalNumbers(self, currentNumber: int, limit: int, resul...
method lexicalOrder (line 26) | def lexicalOrder(self, n: int) -> List[int]:
FILE: Python/0387-first-unique-character-in-a-string.py
class Solution (line 6) | class Solution:
method firstUniqChar (line 7) | def firstUniqChar(self, s: str) -> int:
FILE: Python/0388-longest-absolute-file-path.py
class Solution (line 6) | class Solution:
method lengthLongestPath (line 7) | def lengthLongestPath(self, input: str) -> int:
FILE: Python/0389-find-the-difference.py
class Solution (line 6) | class Solution:
method findTheDifference (line 7) | def findTheDifference(self, s: str, t: str) -> str:
FILE: Python/0390-elimination-game.py
class Solution (line 3) | class Solution:
method lastRemaining (line 4) | def lastRemaining(self, n: int) -> int:
FILE: Python/0391-perfect-rectangle.py
class Solution (line 7) | class Solution:
method isRectangleCover (line 8) | def isRectangleCover(self, rectangles: List[List[int]]) -> bool:
FILE: Python/0392-is-subsequence.py
class Solution (line 6) | class Solution:
method isSubsequence (line 7) | def isSubsequence(self, s: str, t: str) -> bool:
FILE: Python/0393-utf-8-validation.py
class Solution (line 6) | class Solution:
method validUtf8 (line 7) | def validUtf8(self, data: List[int]) -> bool:
FILE: Python/0394-decode-string.py
class Solution (line 3) | class Solution:
method decodeString (line 4) | def decodeString(self, s: str) -> str:
FILE: Python/0395-longest-substring-with-at-least-k-repeating-characters.py
class Solution (line 3) | class Solution:
method longestSubstring (line 4) | def longestSubstring(self, s: str, k: int) -> int:
FILE: Python/0396-rotate-function.py
class Solution (line 6) | class Solution:
method maxRotateFunction (line 7) | def maxRotateFunction(self, nums: List[int]) -> int:
FILE: Python/0397-integer-replacement.py
class Solution (line 3) | class Solution:
method integerReplacement (line 4) | def integerReplacement(self, n: int) -> int:
FILE: Python/0398-random-pick-index.py
class Solution (line 8) | class Solution:
method __init__ (line 9) | def __init__(self, nums: List[int]):
method pick (line 14) | def pick(self, target: int) -> int:
FILE: Python/0399-evaluate-division.py
class Solution (line 7) | class Solution:
method calcEquation (line 8) | def calcEquation(self, equations: List[List[str]], values: List[float]...
FILE: Python/0400-nth-digit.py
class Solution (line 3) | class Solution:
method findNthDigit (line 4) | def findNthDigit(self, n: int) -> int:
FILE: Python/0401-binary-watch.py
class Solution (line 6) | class Solution:
method readBinaryWatch (line 7) | def readBinaryWatch(self, turnedOn: int) -> List[str]:
FILE: Python/0402-remove-k-digits.py
class Solution (line 3) | class Solution:
method removeKdigits (line 4) | def removeKdigits(self, num: str, k: int) -> str:
FILE: Python/0403-frog-jump.py
class Solution (line 8) | class Solution:
method canCross (line 9) | def canCross(self, stones: List[int]) -> bool:
FILE: Python/0404-sum-of-left-leaves.py
class TreeNode (line 4) | class TreeNode:
method __init__ (line 5) | def __init__(self, val=0, left=None, right=None):
class Solution (line 11) | class Solution:
method sumOfLeftLeaves (line 12) | def sumOfLeftLeaves(self, root: Optional[TreeNode]) -> int:
FILE: Python/0405-convert-a-number-to-hexadecimal.py
class Solution (line 3) | class Solution:
method toHex (line 4) | def toHex(self, num: int) -> str:
FILE: Python/0406-queue-reconstruction-by-height.py
class Solution (line 6) | class Solution:
method reconstructQueue (line 7) | def reconstructQueue(self, people: List[List[int]]) -> List[List[int]]:
FILE: Python/0407-trapping-rain-water-ii.py
class Solution (line 7) | class Solution:
method trapRainWater (line 8) | def trapRainWater(self, heightMap: List[List[int]]) -> int:
FILE: Python/0408-valid-word-abbreviation.py
class Solution (line 3) | class Solution:
method validWordAbbreviation (line 4) | def validWordAbbreviation(self, word: str, abbr: str) -> bool:
FILE: Python/0409-longest-palindrome.py
class Solution (line 6) | class Solution:
method longestPalindrome (line 7) | def longestPalindrome(self, s: str) -> int:
FILE: Python/0410-split-array-largest-sum.py
class Solution (line 6) | class Solution:
method splitArray (line 7) | def splitArray(self, nums: List[int], k: int) -> int:
FILE: Python/0414-third-maximum-number.py
class Solution (line 7) | class Solution:
method thirdMax (line 8) | def thirdMax(self, nums: List[int]) -> int:
FILE: Python/0416-partition-equal-subset-sum.py
class Solution (line 8) | class Solution:
method canPartition (line 9) | def canPartition(self, nums: List[int]) -> bool:
method canPartition (line 27) | def canPartition(self, nums: List[int]) -> bool:
class Solution (line 26) | class Solution:
method canPartition (line 9) | def canPartition(self, nums: List[int]) -> bool:
method canPartition (line 27) | def canPartition(self, nums: List[int]) -> bool:
FILE: Python/0417-pacific-atlantic-water-flow.py
class Solution (line 7) | class Solution:
method pacificAtlantic (line 8) | def pacificAtlantic(self, heights: List[List[int]]) -> List[List[int]]:
FILE: Python/0424-longest-repeating-character-replacement.py
class Solution (line 6) | class Solution:
method characterReplacement (line 7) | def characterReplacement(self, s: str, k: int) -> int:
FILE: Python/0425-word-squares.py
class Solution (line 7) | class Solution:
method wordSquares (line 9) | def wordSquares(self, words: List[str]) -> List[List[str]]:
FILE: Python/0426-convert-binary-search-tree-to-sorted-doubly-linked-list.py
class Node (line 3) | class Node:
method __init__ (line 4) | def __init__(self, val, left=None, right=None):
class Solution (line 10) | class Solution:
method treeToDoublyList (line 11) | def treeToDoublyList(self, root: 'Node') -> 'Node':
FILE: Python/0427-construct-quad-tree.py
class Node (line 6) | class Node:
method __init__ (line 7) | def __init__(self, val, isLeaf, topLeft=None, topRight=None, bottomLef...
class Solution (line 16) | class Solution:
method construct (line 17) | def construct(self, grid: List[List[int]]) -> 'Node':
method helper (line 20) | def helper(self, grid, i, j, w):
method allSame (line 31) | def allSame(self, grid, i, j, w):
FILE: Python/0432-all-oone-data-structure.py
class Node (line 1) | class Node:
method __init__ (line 2) | def __init__(self, freq):
class AllOne (line 9) | class AllOne:
method __init__ (line 10) | def __init__(self):
method inc (line 17) | def inc(self, key: str) -> None:
method dec (line 55) | def dec(self, key: str) -> None:
method getMaxKey (line 85) | def getMaxKey(self) -> str:
method getMinKey (line 92) | def getMinKey(self) -> str:
method removeNode (line 99) | def removeNode(self, node):
FILE: Python/0433-minimum-genetic-mutation.py
class Solution (line 7) | class Solution:
method minMutation (line 8) | def minMutation(self, startGene: str, endGene: str, bank: List[str]) -...
FILE: Python/0435-non-overlapping-intervals.py
class Solution (line 6) | class Solution:
method eraseOverlapIntervals (line 7) | def eraseOverlapIntervals(self, intervals: List[List[int]]) -> int:
FILE: Python/0436-find-right-interval.py
class Solution (line 7) | class Solution:
method findRightInterval (line 8) | def findRightInterval(self, intervals: List[List[int]]) -> List[int]:
FILE: Python/0437-path-sum-iii.py
class TreeNode (line 7) | class TreeNode:
method __init__ (line 8) | def __init__(self, val=0, left=None, right=None):
class Solution (line 14) | class Solution:
method pathSum (line 16) | def pathSum(self, root: Optional[TreeNode], targetSum: int) -> int:
FILE: Python/0438-find-all-anagrams-in-a-string.py
class Solution (line 6) | class Solution:
method findAnagrams (line 7) | def findAnagrams(self, original: str, target: str) -> List[int]:
FILE: Python/0439-ternary-expression-parser.py
class Solution (line 1) | class Solution:
method parseTernary (line 2) | def parseTernary(self, expression: str) -> str:
FILE: Python/0440-k-th-smallest-in-lexicographical-order.py
class Solution (line 3) | class Solution(object):
method findKthNumber (line 4) | def findKthNumber(self, n, k):
method countSteps (line 19) | def countSteps(self, n, prefix1, prefix2):
FILE: Python/0442-find-all-duplicates-in-an-array.py
class Solution (line 7) | class Solution:
method findDuplicates (line 8) | def findDuplicates(self, nums: List[int]) -> List[int]:
method findDuplicates (line 18) | def findDuplicates(self, nums: List[int]) -> List[int]:
class Solution (line 17) | class Solution:
method findDuplicates (line 8) | def findDuplicates(self, nums: List[int]) -> List[int]:
method findDuplicates (line 18) | def findDuplicates(self, nums: List[int]) -> List[int]:
FILE: Python/0443-string-compression.py
class Solution (line 6) | class Solution:
method compress (line 7) | def compress(self, chars: List[str]) -> int:
FILE: Python/0444-sequence-reconstruction.py
class Solution (line 7) | class Solution:
method sequenceReconstruction (line 8) | def sequenceReconstruction(self, nums: List[int], sequences: List[List...
FILE: Python/0445-add-two-numbers-ii.py
class Solution (line 9) | class Solution:
method reverseList (line 10) | def reverseList(self, node: Optional[ListNode]) -> Optional[ListNode]:
method addTwoNumbers (line 19) | def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]...
FILE: Python/0446-arithmetic-slices-ii-subsequence.py
class Solution (line 5) | class Solution:
method numberOfArithmeticSlices (line 6) | def numberOfArithmeticSlices(self, nums: List[int]) -> int:
FILE: Python/0448-find-all-numbers-disappeared-in-an-array.py
class Solution (line 6) | class Solution:
method findDisappearedNumbers (line 7) | def findDisappearedNumbers(self, nums: List[int]) -> List[int]:
FILE: Python/0449-serialize-and-deserialize-bst.py
class Codec (line 9) | class Codec:
method serialize (line 10) | def serialize(self, root: Optional[TreeNode]) -> str:
method deserialize (line 15) | def deserialize(self, data: str) -> Optional[TreeNode]:
FILE: Python/0450-delete-node-in-a-bst.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method traverse (line 14) | def traverse(self, node: Optional[TreeNode]):
method deleteNode (line 21) | def deleteNode(self, root: Optional[TreeNode], key: int) -> Optional[T...
FILE: Python/0451-sort-characters-by-frequency.py
class Solution (line 6) | class Solution:
method frequencySort (line 7) | def frequencySort(self, s: str) -> str:
FILE: Python/0452-minimum-number-of-arrows-to-burst-balloons.py
class Solution (line 6) | class Solution:
method findMinArrowShots (line 7) | def findMinArrowShots(self, points: List[List[int]]) -> int:
FILE: Python/0455-assign-cookies.py
class Solution (line 6) | class Solution:
method findContentChildren (line 7) | def findContentChildren(self, greedyChildren: List[int], cookiesSize: ...
FILE: Python/0456-132-pattern.py
class Solution (line 5) | class Solution:
method find132pattern (line 6) | def find132pattern(self, nums: List[int]) -> bool:
FILE: Python/0457-circular-array-loop.py
class Solution (line 6) | class Solution:
method circularArrayLoop (line 7) | def circularArrayLoop(self, nums: List[int]) -> bool:
FILE: Python/0458-poor-pigs.py
class Solution (line 4) | class Solution:
method poorPigs (line 5) | def poorPigs(self, buckets: int, minutesToDie: int, minutesToTest: int...
FILE: Python/0459-repeated-substring-pattern.py
class Solution (line 1) | class Solution:
method repeatedSubstringPattern (line 2) | def repeatedSubstringPattern(self, s: str) -> bool:
FILE: Python/0460-lfu-cache.py
class LFUCache (line 6) | class LFUCache:
method __init__ (line 7) | def __init__(self, capacity: int):
method insert (line 13) | def insert(self, key, frequency, value):
method get (line 17) | def get(self, key: int) -> int:
method put (line 29) | def put(self, key: int, value: int) -> None:
FILE: Python/0463-island-perimeter.py
class Solution (line 6) | class Solution:
method islandPerimeter (line 7) | def islandPerimeter(self, grid: List[List[int]]) -> int:
FILE: Python/0465-optimal-account-balancing.py
class Solution (line 7) | class Solution:
method minTransfers (line 8) | def minTransfers(self, transactions: List[List[int]]) -> int:
FILE: Python/0473-matchsticks-to-square.py
class Solution (line 6) | class Solution:
method makesquare (line 7) | def makesquare(self, matchsticks: List[int]) -> bool:
FILE: Python/0474-ones-and-zeroes.py
class Solution (line 7) | class Solution:
method findMaxForm (line 8) | def findMaxForm(self, strs: List[str], m: int, n: int) -> int:
method findMaxForm (line 25) | def findMaxForm(self, strs: List[str], m: int, n: int) -> int:
class Solution (line 24) | class Solution:
method findMaxForm (line 8) | def findMaxForm(self, strs: List[str], m: int, n: int) -> int:
method findMaxForm (line 25) | def findMaxForm(self, strs: List[str], m: int, n: int) -> int:
FILE: Python/0475-heaters.py
class Solution (line 6) | class Solution:
method findRadius (line 7) | def findRadius(self, houses: List[int], heaters: List[int]) -> int:
FILE: Python/0476-number-complement.py
class Solution (line 3) | class Solution:
method findComplement (line 4) | def findComplement(self, num: int) -> int:
FILE: Python/0485-max-consecutive-ones.py
class Solution (line 6) | class Solution:
method findMaxConsecutiveOnes (line 7) | def findMaxConsecutiveOnes(self, nums: List[int]) -> int:
FILE: Python/0486-predict-the-winner.py
class Solution (line 5) | class Solution:
method PredictTheWinner (line 6) | def PredictTheWinner(self, nums: List[int]) -> bool:
FILE: Python/0487-max-consecutive-ones-ii.py
class Solution (line 6) | class Solution:
method findMaxConsecutiveOnes (line 7) | def findMaxConsecutiveOnes(self, nums: List[int]) -> int:
FILE: Python/0489-robot-room-cleaner.py
class Solution (line 35) | class Solution:
method cleanRoom (line 36) | def cleanRoom(self, robot):
FILE: Python/0490-the-maze.py
class Solution (line 7) | class Solution:
method hasPath (line 8) | def hasPath(self, maze: List[List[int]], start: List[int], destination...
FILE: Python/0491-non-decreasing-subsequences.py
class Solution (line 6) | class Solution:
method findSubsequences (line 7) | def findSubsequences(self, nums: List[int]) -> List[List[int]]:
FILE: Python/0493-reverse-pairs.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, start, end, val=0, left=None, right=None):
class SegmentTree (line 15) | class SegmentTree:
method __init__ (line 16) | def __init__(self, n):
method build (line 19) | def build(self, l, r):
method update (line 26) | def update(self, root, index, value):
method query (line 36) | def query(self, root, l, r) -> int:
class Solution (line 44) | class Solution:
method reversePairs (line 45) | def reversePairs(self, nums: List[int]) -> int:
FILE: Python/0494-target-sum.py
class Solution (line 5) | class Solution:
method findTargetSumWays (line 6) | def findTargetSumWays(self, nums: List[int], target: int) -> int:
method findTargetSumWays (line 25) | def findTargetSumWays(self, nums: List[int], target: int) -> int:
method findTargetSumWays (line 44) | def findTargetSumWays(self, nums: List[int], target: int) -> int:
class Solution (line 24) | class Solution:
method findTargetSumWays (line 6) | def findTargetSumWays(self, nums: List[int], target: int) -> int:
method findTargetSumWays (line 25) | def findTargetSumWays(self, nums: List[int], target: int) -> int:
method findTargetSumWays (line 44) | def findTargetSumWays(self, nums: List[int], target: int) -> int:
class Solution (line 43) | class Solution:
method findTargetSumWays (line 6) | def findTargetSumWays(self, nums: List[int], target: int) -> int:
method findTargetSumWays (line 25) | def findTargetSumWays(self, nums: List[int], target: int) -> int:
method findTargetSumWays (line 44) | def findTargetSumWays(self, nums: List[int], target: int) -> int:
FILE: Python/0496-next-greater-element-i.py
class Solution (line 7) | class Solution:
method nextGreaterElement (line 8) | def nextGreaterElement(self, nums1: List[int], nums2: List[int]) -> Li...
FILE: Python/0498-diagonal-traverse.py
class Solution (line 7) | class Solution:
method findDiagonalOrder (line 8) | def findDiagonalOrder(self, mat: List[List[int]]) -> List[int]:
FILE: Python/0499-the-maze-iii.py
class Solution (line 7) | class Solution:
method findShortestWay (line 8) | def findShortestWay(self, maze: List[List[int]], ball: List[int], hole...
FILE: Python/0501-find-mode-in-binary-search-tree.py
class TreeNode (line 9) | class TreeNode:
method __init__ (line 10) | def __init__(self, val=0, left=None, right=None):
class Solution (line 16) | class Solution:
method findMode (line 17) | def findMode(self, root: Optional[TreeNode]) -> List[int]:
FILE: Python/0502-ipo.py
class Solution (line 7) | class Solution:
method findMaximizedCapital (line 8) | def findMaximizedCapital(self, k: int, w: int, profits: List[int], cap...
FILE: Python/0505-the-maze-ii.py
class Solution (line 8) | class Solution:
method shortestDistance (line 9) | def shortestDistance(self, maze: List[List[int]], start: List[int], de...
FILE: Python/0506-relative-ranks.py
class Solution (line 7) | class Solution:
method findRelativeRanks (line 8) | def findRelativeRanks(self, scores: List[int]) -> List[str]:
method findRelativeRanks (line 24) | def findRelativeRanks(self, score: List[int]) -> List[str]:
class Solution (line 23) | class Solution:
method findRelativeRanks (line 8) | def findRelativeRanks(self, scores: List[int]) -> List[str]:
method findRelativeRanks (line 24) | def findRelativeRanks(self, score: List[int]) -> List[str]:
FILE: Python/0509-fibonacci-number.py
class Solution (line 1) | class Solution:
method fib (line 2) | def fib(self, n: int) -> int:
FILE: Python/0510-inorder-successor-in-bst-ii.py
class Node (line 6) | class Node:
method __init__ (line 7) | def __init__(self, val):
class Solution (line 14) | class Solution:
method inorderSuccessor (line 15) | def inorderSuccessor(self, node: 'Node') -> 'Optional[Node]':
FILE: Python/0513-find-bottom-left-tree-value.py
class TreeNode (line 7) | class TreeNode:
method __init__ (line 8) | def __init__(self, val=0, left=None, right=None):
class Solution (line 14) | class Solution:
method findBottomLeftValue (line 15) | def findBottomLeftValue(self, root: Optional[TreeNode]) -> int:
FILE: Python/0514-freedom-trail.py
class Solution (line 6) | class Solution:
method findRotateSteps (line 7) | def findRotateSteps(self, ring: str, key: str) -> int:
FILE: Python/0515-find-largest-value-in-each-tree-row.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method largestValues (line 14) | def largestValues(self, root: Optional[TreeNode]) -> List[int]:
FILE: Python/0516-longest-palindromic-subsequence.py
class Solution (line 3) | class Solution:
method longestPalindromeSubseq (line 4) | def longestPalindromeSubseq(self, s: str) -> int:
method longestCommonSubsequence (line 20) | def longestCommonSubsequence(self, s: str, t: str) -> int:
method longestPalindromeSubseq (line 33) | def longestPalindromeSubseq(self, s: str) -> int:
class Solution (line 19) | class Solution:
method longestPalindromeSubseq (line 4) | def longestPalindromeSubseq(self, s: str) -> int:
method longestCommonSubsequence (line 20) | def longestCommonSubsequence(self, s: str, t: str) -> int:
method longestPalindromeSubseq (line 33) | def longestPalindromeSubseq(self, s: str) -> int:
FILE: Python/0518-coin-change-ii.py
class Solution (line 6) | class Solution:
method change (line 7) | def change(self, amount: int, coins: List[int]) -> int:
method change (line 35) | def change(self, amount: int, coins: List[int]) -> int:
class Solution (line 34) | class Solution:
method change (line 7) | def change(self, amount: int, coins: List[int]) -> int:
method change (line 35) | def change(self, amount: int, coins: List[int]) -> int:
FILE: Python/0523-continuous-subarray-sum.py
class Solution (line 6) | class Solution:
method checkSubarraySum (line 7) | def checkSubarraySum(self, nums: List[int], k: int) -> bool:
FILE: Python/0525-contiguous-array.py
class Solution (line 6) | class Solution:
method findMaxLength (line 7) | def findMaxLength(self, nums: List[int]) -> int:
FILE: Python/0527-word-abbreviation.py
class Solution (line 6) | class Solution:
method wordsAbbreviation (line 7) | def wordsAbbreviation(self, words: List[str]) -> List[str]:
FILE: Python/0528-random-pick-with-weight.py
class Solution (line 7) | class Solution:
method __init__ (line 9) | def __init__(self, w: List[int]):
method pickIndex (line 17) | def pickIndex(self) -> int:
method __init__ (line 27) | def __init__(self, w: List[int]):
method pickIndex (line 35) | def pickIndex(self) -> int:
class Solution (line 25) | class Solution:
method __init__ (line 9) | def __init__(self, w: List[int]):
method pickIndex (line 17) | def pickIndex(self) -> int:
method __init__ (line 27) | def __init__(self, w: List[int]):
method pickIndex (line 35) | def pickIndex(self) -> int:
FILE: Python/0530-minimum-absolute-difference-in-bst.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method getMinimumDifference (line 14) | def getMinimumDifference(self, root: Optional[TreeNode]) -> int:
FILE: Python/0532-k-diff-pairs-in-an-array.py
class Solution (line 4) | class Solution:
method findPairs (line 5) | def findPairs(self, nums: List[int], k: int) -> int:
FILE: Python/0539-minimum-time-difference.py
class Solution (line 6) | class Solution:
method findMinDifference (line 7) | def findMinDifference(self, timePoints: List[str]) -> int:
FILE: Python/0540-single-element-in-a-sorted-array.py
class Solution (line 6) | class Solution:
method singleNonDuplicate (line 7) | def singleNonDuplicate(self, nums: List[int]) -> int:
FILE: Python/0542-01-matrix.py
class Solution (line 9) | class Solution:
method updateMatrix (line 10) | def updateMatrix(self, matrix: List[List[int]]) -> List[List[int]]:
method updateMatrix (line 34) | def updateMatrix(self, matrix: List[List[int]]) -> List[List[int]]:
method updateMatrix (line 56) | def updateMatrix(self, mat: List[List[int]]) -> List[List[int]]:
class Solution (line 33) | class Solution:
method updateMatrix (line 10) | def updateMatrix(self, matrix: List[List[int]]) -> List[List[int]]:
method updateMatrix (line 34) | def updateMatrix(self, matrix: List[List[int]]) -> List[List[int]]:
method updateMatrix (line 56) | def updateMatrix(self, mat: List[List[int]]) -> List[List[int]]:
class Solution (line 55) | class Solution:
method updateMatrix (line 10) | def updateMatrix(self, matrix: List[List[int]]) -> List[List[int]]:
method updateMatrix (line 34) | def updateMatrix(self, matrix: List[List[int]]) -> List[List[int]]:
method updateMatrix (line 56) | def updateMatrix(self, mat: List[List[int]]) -> List[List[int]]:
FILE: Python/0543-diameter-of-binary-tree.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method diameterOfBinaryTree (line 14) | def diameterOfBinaryTree(self, root: Optional[TreeNode]) -> int:
FILE: Python/0545-boundary-of-binary-tree.py
class TreeNode (line 4) | class TreeNode:
method __init__ (line 5) | def __init__(self, val=0, left=None, right=None):
class Solution (line 11) | class Solution:
method boundaryOfBinaryTree (line 12) | def boundaryOfBinaryTree(self, root: Optional[TreeNode]) -> List[int]:
FILE: Python/0547-number-of-provinces.py
class Solution (line 6) | class Solution:
method findCircleNum (line 7) | def findCircleNum(self, isConnected: List[List[int]]) -> int:
method findCircleNum (line 56) | def findCircleNum(self, grid: List[List[int]]) -> int:
class UnionFind (line 26) | class UnionFind:
method __init__ (line 27) | def __init__(self, n):
method find (line 32) | def find(self, num):
method union (line 38) | def union(self, x, y):
class Solution (line 55) | class Solution:
method findCircleNum (line 7) | def findCircleNum(self, isConnected: List[List[int]]) -> int:
method findCircleNum (line 56) | def findCircleNum(self, grid: List[List[int]]) -> int:
FILE: Python/0549-binary-tree-longest-consecutive-sequence-ii.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method longestConsecutive (line 14) | def longestConsecutive(self, root: Optional[TreeNode]) -> int:
FILE: Python/0552-student-attendance-record-ii.py
class Solution (line 3) | class Solution:
method checkRecord (line 4) | def checkRecord(self, n: int) -> int:
FILE: Python/0560-subarray-sum-equals-k.py
class Solution (line 6) | class Solution:
method subarraySum (line 7) | def subarraySum(self, nums: List[int], k: int) -> int:
FILE: Python/0561-array-partition.py
class Solution (line 4) | class Solution:
method arrayPairSum (line 5) | def arrayPairSum(self, nums: List[int]) -> int:
FILE: Python/0564-find-the-closest-palindrome.py
class Solution (line 3) | class Solution:
method nearestPalindromic (line 4) | def nearestPalindromic(self, n: str) -> str:
method halfToPalindrome (line 34) | def halfToPalindrome(self, left: int, even: bool) -> int:
FILE: Python/0567-permutation-in-string.py
class Solution (line 6) | class Solution:
method checkInclusion (line 7) | def checkInclusion(self, s1: str, s2: str) -> bool:
FILE: Python/0572-subtree-of-another-tree.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method isSameTree (line 14) | def isSameTree(self, root1: Optional[TreeNode], root2: Optional[TreeNo...
method isSubtree (line 23) | def isSubtree(self, root: Optional[TreeNode], subRoot: Optional[TreeNo...
FILE: Python/0573-squirrel-simulation.py
class Solution (line 6) | class Solution:
method minDistance (line 7) | def minDistance(self, height: int, width: int, tree: List[int], squirr...
FILE: Python/0576-out-of-boundary-paths.py
class Solution (line 3) | class Solution:
method findPaths (line 4) | def findPaths(self, row: int, col: int, maxMove: int, startRow: int, s...
FILE: Python/0588-design-in-memory-file-system.py
class Dir (line 11) | class Dir:
method __init__ (line 12) | def __init__(self):
class FileSystem (line 16) | class FileSystem:
method __init__ (line 18) | def __init__(self):
method ls (line 21) | def ls(self, path: str) -> List[str]:
method mkdir (line 39) | def mkdir(self, path: str) -> None:
method addContentToFile (line 47) | def addContentToFile(self, filePath: str, content: str) -> None:
method readContentFromFile (line 56) | def readContentFromFile(self, filePath: str) -> str:
FILE: Python/0590-n-ary-tree-postorder-traversal.py
class Node (line 6) | class Node:
method __init__ (line 7) | def __init__(self, val=None, children=None):
class Solution (line 12) | class Solution:
method postorder (line 13) | def postorder(self, root: "Node") -> List[int]:
FILE: Python/0592-fraction-addition-and-subtraction.py
class Solution (line 6) | class Solution:
method fractionAddition (line 7) | def fractionAddition(self, expression: str) -> str:
method findGcd (line 22) | def findGcd(self, a: int, b: int) -> int:
FILE: Python/0594-longest-harmonious-subsequence.py
class Solution (line 4) | class Solution:
method findLHS (line 5) | def findLHS(self, nums: List[int]) -> int:
FILE: Python/0605-can-place-flowers.py
class Solution (line 6) | class Solution:
method canPlaceFlowers (line 7) | def canPlaceFlowers(self, flowerbed: List[int], n: int) -> bool:
FILE: Python/0606-construct-string-from-binary-tree.py
class TreeNode (line 4) | class TreeNode:
method __init__ (line 5) | def __init__(self, val=0, left=None, right=None):
class Solution (line 11) | class Solution(object):
method tree2str (line 12) | def tree2str(self, root: Optional[TreeNode]) -> str:
method dfs (line 17) | def dfs(self, root: Optional[TreeNode], res: []):
FILE: Python/0609-find-duplicate-file-in-system.py
class Solution (line 7) | class Solution:
method findDuplicate (line 8) | def findDuplicate(self, paths: List[str]) -> List[List[str]]:
FILE: Python/0611-valid-triangle-number.py
class Solution (line 6) | class Solution:
method triangleNumber (line 7) | def triangleNumber(self, nums: List[int]) -> int:
FILE: Python/0616-add-bold-tag-in-string.py
class Solution (line 6) | class Solution:
method addBoldTag (line 7) | def addBoldTag(self, s: str, words: List[str]) -> str:
FILE: Python/0621-task-scheduler.py
class Solution (line 7) | class Solution:
method leastInterval (line 8) | def leastInterval(self, tasks: List[str], n: int) -> int:
FILE: Python/0623-add-one-row-to-tree.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method add (line 14) | def add(self, root: Optional[TreeNode], val: int, depth: int, curr: int):
method addOneRow (line 32) | def addOneRow(self, root: Optional[TreeNode], val: int, depth: int) ->...
FILE: Python/0624-maximum-distance-in-arrays.py
class Solution (line 4) | class Solution:
method maxDistance (line 5) | def maxDistance(self, arrays: List[List[int]]) -> int:
FILE: Python/0629-k-inverse-pairs-array.py
class Solution (line 3) | class Solution:
method kInversePairs (line 4) | def kInversePairs(self, n: int, k: int) -> int:
FILE: Python/0632-smallest-range-covering-elements-from-k-lists.py
class Solution (line 7) | class Solution:
method smallestRange (line 8) | def smallestRange(self, nums: List[List[int]]) -> List[int]:
FILE: Python/0633-sum-of-square-numbers.py
class Solution (line 6) | class Solution:
method judgeSquareSum (line 7) | def judgeSquareSum(self, c: int) -> bool:
FILE: Python/0636-exclusive-time-of-functions.py
class Solution (line 6) | class Solution:
method exclusiveTime (line 7) | def exclusiveTime(self, n: int, logs: List[str]) -> List[int]:
FILE: Python/0637-average-of-levels-in-binary-tree.py
class TreeNode (line 7) | class TreeNode:
method __init__ (line 8) | def __init__(self, val=0, left=None, right=None):
class Solution (line 14) | class Solution:
method averageOfLevels (line 15) | def averageOfLevels(self, root: Optional[TreeNode]) -> List[float]:
FILE: Python/0641-design-circular-deque.py
class MyCircularDeque (line 1) | class MyCircularDeque:
method __init__ (line 3) | def __init__(self, k: int):
method insertFront (line 10) | def insertFront(self, value: int) -> bool:
method insertLast (line 18) | def insertLast(self, value: int) -> bool:
method deleteFront (line 26) | def deleteFront(self) -> bool:
method deleteLast (line 33) | def deleteLast(self) -> bool:
method getFront (line 40) | def getFront(self) -> int:
method getRear (line 45) | def getRear(self) -> int:
method isEmpty (line 51) | def isEmpty(self) -> bool:
method isFull (line 54) | def isFull(self) -> bool:
FILE: Python/0643-maximum-average-subarray-i.py
class Solution (line 6) | class Solution:
method findMaxAverage (line 7) | def findMaxAverage(self, nums: List[int], k: int) -> float:
FILE: Python/0645-set-mismatch.py
class Solution (line 6) | class Solution:
method findErrorNums (line 7) | def findErrorNums(self, nums: List[int]) -> List[int]:
FILE: Python/0646-maximum-length-of-pair-chain.py
class Solution (line 4) | class Solution:
method findLongestChain (line 5) | def findLongestChain(self, pairs: List[List[int]]) -> int:
FILE: Python/0647-palindromic-substrings.py
class Solution (line 3) | class Solution:
method countSubstrings (line 4) | def countSubstrings(self, s: str) -> int:
FILE: Python/0648-replace-words.py
class Solution (line 6) | class Solution:
method replaceWords (line 7) | def replaceWords(self, dictionary: List[str], sentence: str) -> str:
method replaceWords (line 53) | def replaceWords(self, dictionary: List[str], sentence: str) -> str:
class TrieNode (line 21) | class TrieNode:
method __init__ (line 22) | def __init__(self, char=""):
class Trie (line 28) | class Trie:
method __init__ (line 29) | def __init__(self):
method insert (line 32) | def insert(self, word: str):
method replace (line 40) | def replace(self, word: str):
class Solution (line 52) | class Solution:
method replaceWords (line 7) | def replaceWords(self, dictionary: List[str], sentence: str) -> str:
method replaceWords (line 53) | def replaceWords(self, dictionary: List[str], sentence: str) -> str:
FILE: Python/0649-dota2-senate.py
class Solution (line 6) | class Solution:
method predictPartyVictory (line 7) | def predictPartyVictory(self, senate: str) -> str:
FILE: Python/0650-2-keys-keyboard.py
class Solution (line 3) | class Solution:
method minSteps (line 4) | def minSteps(self, n: int) -> int:
method minStepsHelper (line 12) | def minStepsHelper(self, currLen: int, pasteLen: int) -> int:
FILE: Python/0653-two-sum-iv-input-is-a-bst.py
class TreeNode (line 7) | class TreeNode:
method __init__ (line 8) | def __init__(self, val=0, left=None, right=None):
class Solution (line 14) | class Solution:
method findTarget (line 15) | def findTarget(self, root: Optional[TreeNode], k: int) -> bool:
FILE: Python/0656-coin-path.py
class Solution (line 7) | class Solution:
method cheapestJump (line 8) | def cheapestJump(self, coins: List[int], maxJump: int) -> List[int]:
FILE: Python/0658-find-k-closest-elements.py
class Solution (line 6) | class Solution:
method findClosestElements (line 7) | def findClosestElements(self, nums: List[int], k: int, target: int) ->...
FILE: Python/0661-image-smoother.py
class Solution (line 6) | class Solution:
method imageSmoother (line 7) | def imageSmoother(self, img: List[List[int]]) -> List[List[int]]:
FILE: Python/0662-maximum-width-of-binary-tree.py
class TreeNode (line 7) | class TreeNode:
method __init__ (line 8) | def __init__(self, val=0, left=None, right=None):
class Solution (line 14) | class Solution:
method widthOfBinaryTree (line 15) | def widthOfBinaryTree(self, root: Optional[TreeNode]) -> int:
FILE: Python/0663-equal-tree-partition.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method checkEqualTree (line 14) | def checkEqualTree(self, root: Optional[TreeNode]) -> bool:
FILE: Python/0664-strange-printer.py
class Solution (line 1) | class Solution:
method strangePrinter (line 2) | def strangePrinter(self, s: str) -> int:
FILE: Python/0666-path-sum-iv.py
class Solution (line 6) | class Solution:
method pathSum (line 7) | def pathSum(self, nums: List[int]) -> int:
FILE: Python/0670-maximum-swap.py
class Solution (line 3) | class Solution:
method maximumSwap (line 4) | def maximumSwap(self, num: int) -> int:
FILE: Python/0677-map-sum-pairs.py
class MapSum (line 6) | class MapSum:
method __init__ (line 7) | def __init__(self):
method insert (line 10) | def insert(self, key: str, val: int) -> None:
method sum (line 13) | def sum(self, prefix: str) -> int:
FILE: Python/0678-valid-parenthesis-string.py
class Solution (line 6) | class Solution:
method checkValidString (line 7) | def checkValidString(self, s: str) -> bool:
method checkValidString (line 30) | def checkValidString(self, s: str) -> bool:
method checkValidString (line 55) | def checkValidString(self, s: str) -> bool:
method checkValidString (line 81) | def checkValidString(self, s: str) -> bool:
class Solution (line 29) | class Solution:
method checkValidString (line 7) | def checkValidString(self, s: str) -> bool:
method checkValidString (line 30) | def checkValidString(self, s: str) -> bool:
method checkValidString (line 55) | def checkValidString(self, s: str) -> bool:
method checkValidString (line 81) | def checkValidString(self, s: str) -> bool:
class Solution (line 54) | class Solution:
method checkValidString (line 7) | def checkValidString(self, s: str) -> bool:
method checkValidString (line 30) | def checkValidString(self, s: str) -> bool:
method checkValidString (line 55) | def checkValidString(self, s: str) -> bool:
method checkValidString (line 81) | def checkValidString(self, s: str) -> bool:
class Solution (line 80) | class Solution:
method checkValidString (line 7) | def checkValidString(self, s: str) -> bool:
method checkValidString (line 30) | def checkValidString(self, s: str) -> bool:
method checkValidString (line 55) | def checkValidString(self, s: str) -> bool:
method checkValidString (line 81) | def checkValidString(self, s: str) -> bool:
FILE: Python/0679-24-game.py
class Solution (line 6) | class Solution:
method generate_possible_results (line 7) | def generate_possible_results(self, a: float, b: float) -> List[float]:
method checkIfResultReached (line 15) | def checkIfResultReached(self, cards: List[float]) -> bool:
method judgePoint24 (line 30) | def judgePoint24(self, cards: List[int]) -> bool:
FILE: Python/0680-valid-palindrome-ii.py
class Solution (line 3) | class Solution:
method validPalindrome (line 4) | def validPalindrome(self, s: str) -> bool:
FILE: Python/0683-k-empty-slots.py
class Solution (line 7) | class Solution:
method kEmptySlots (line 8) | def kEmptySlots(self, bulbs: List[int], k: int) -> int:
FILE: Python/0684-redundant-connection.py
class UnionFind (line 6) | class UnionFind:
method __init__ (line 7) | def __init__(self, countNodes: int) -> None:
method find (line 11) | def find(self, node: int) -> int:
method union (line 17) | def union(self, nodeX: int, nodeY: int) -> bool:
class Solution (line 30) | class Solution:
method findRedundantConnection (line 31) | def findRedundantConnection(self, edges: List[List[int]]) -> List[int]:
FILE: Python/0689-maximum-sum-of-3-non-overlapping-subarrays.py
class Solution (line 6) | class Solution:
method maxSumOfThreeSubarrays (line 7) | def maxSumOfThreeSubarrays(self, nums: List[int], k: int) -> List[int]:
method dp (line 22) | def dp(self, sums, k, idx, rem, memo):
method dfs (line 36) | def dfs(self, sums, k, idx, rem, memo, indices):
FILE: Python/0692-top-k-frequent-words.py
class Solution (line 7) | class Solution:
method topKFrequent (line 8) | def topKFrequent(self, words: List[str], k: int) -> List[str]:
FILE: Python/0694-number-of-distinct-islands.py
class Solution (line 6) | class Solution:
method numDistinctIslands (line 7) | def numDistinctIslands(self, grid: List[List[int]]) -> int:
FILE: Python/0695-max-area-of-island.py
class Solution (line 7) | class Solution:
method maxAreaOfIsland (line 8) | def maxAreaOfIsland(self, grid: List[List[int]]) -> int:
FILE: Python/0702-search-in-a-sorted-array-of-unknown-size.py
class ArrayReader (line 3) | class ArrayReader:
method get (line 4) | def get(self, index: int) -> int:
class Solution (line 8) | class Solution:
method search (line 9) | def search(self, reader: ArrayReader, target: int) -> int:
FILE: Python/0703-kth-largest-element-in-a-stream.py
class KthLargest (line 7) | class KthLargest:
method __init__ (line 8) | def __init__(self, k: int, nums: List[int]):
method add (line 14) | def add(self, val: int) -> int:
FILE: Python/0704-binary-search.py
class Solution (line 6) | class Solution:
method search (line 7) | def search(self, nums: List[int], target: int) -> int:
FILE: Python/0705-design-hashset.py
class Node (line 3) | class Node:
method __init__ (line 4) | def __init__(self, value, nextNode=None):
class Bucket (line 9) | class Bucket:
method __init__ (line 10) | def __init__(self):
method insert (line 13) | def insert(self, newValue):
method delete (line 18) | def delete(self, value):
method exists (line 28) | def exists(self, value):
class MyHashSet (line 37) | class MyHashSet:
method __init__ (line 39) | def __init__(self):
method hash (line 43) | def hash(self, key):
method add (line 46) | def add(self, key: int) -> None:
method remove (line 50) | def remove(self, key: int) -> None:
method contains (line 54) | def contains(self, key: int) -> bool:
FILE: Python/0706-design-hashmap.py
class Bucket (line 5) | class Bucket:
method __init__ (line 6) | def __init__(self):
method get (line 9) | def get(self, key):
method update (line 15) | def update(self, key, value):
method remove (line 26) | def remove(self, key):
class MyHashMap (line 32) | class MyHashMap(object):
method __init__ (line 34) | def __init__(self):
method put (line 39) | def put(self, key, value):
method get (line 45) | def get(self, key):
method remove (line 50) | def remove(self, key):
method __init__ (line 64) | def __init__(self):
method hash (line 67) | def hash(self, key):
method put (line 70) | def put(self, key: int, value: int) -> None:
method get (line 79) | def get(self, key: int) -> int:
method remove (line 87) | def remove(self, key: int) -> None:
method __init__ (line 98) | def __init__(self):
method put (line 101) | def put(self, key: int, value: int) -> None:
method get (line 105) | def get(self, key: int) -> int:
method remove (line 112) | def remove(self, key: int) -> None:
class ListNode (line 56) | class ListNode:
method __init__ (line 57) | def __init__(self, key=-1, val=-1, next=None):
class MyHashMap (line 63) | class MyHashMap:
method __init__ (line 34) | def __init__(self):
method put (line 39) | def put(self, key, value):
method get (line 45) | def get(self, key):
method remove (line 50) | def remove(self, key):
method __init__ (line 64) | def __init__(self):
method hash (line 67) | def hash(self, key):
method put (line 70) | def put(self, key: int, value: int) -> None:
method get (line 79) | def get(self, key: int) -> int:
method remove (line 87) | def remove(self, key: int) -> None:
method __init__ (line 98) | def __init__(self):
method put (line 101) | def put(self, key: int, value: int) -> None:
method get (line 105) | def get(self, key: int) -> int:
method remove (line 112) | def remove(self, key: int) -> None:
class MyHashMap (line 96) | class MyHashMap:
method __init__ (line 34) | def __init__(self):
method put (line 39) | def put(self, key, value):
method get (line 45) | def get(self, key):
method remove (line 50) | def remove(self, key):
method __init__ (line 64) | def __init__(self):
method hash (line 67) | def hash(self, key):
method put (line 70) | def put(self, key: int, value: int) -> None:
method get (line 79) | def get(self, key: int) -> int:
method remove (line 87) | def remove(self, key: int) -> None:
method __init__ (line 98) | def __init__(self):
method put (line 101) | def put(self, key: int, value: int) -> None:
method get (line 105) | def get(self, key: int) -> int:
method remove (line 112) | def remove(self, key: int) -> None:
FILE: Python/0712-minimum-ascii-delete-sum-for-two-strings.py
class Solution (line 1) | class Solution:
method minimumDeleteSum (line 2) | def minimumDeleteSum(self, s1: str, s2: str) -> int:
FILE: Python/0713-subarray-product-less-than-k.py
class Solution (line 6) | class Solution:
method numSubarrayProductLessThanK (line 7) | def numSubarrayProductLessThanK(self, nums: List[int], k: int) -> int:
FILE: Python/0714-best-time-to-buy-and-sell-stock-with-transaction-fee.py
class Solution (line 6) | class Solution:
method maxProfit (line 7) | def maxProfit(self, prices: List[int], fee: int) -> int:
FILE: Python/0715-range-module.py
class RangeModule (line 13) | class RangeModule:
method __init__ (line 15) | def __init__(self):
method checkIntervals (line 18) | def checkIntervals(self, left: int, right: int):
method addRange (line 30) | def addRange(self, left: int, right: int) -> None:
method queryRange (line 45) | def queryRange(self, left: int, right: int) -> bool:
method removeRange (line 51) | def removeRange(self, left: int, right: int) -> None:
FILE: Python/0716-max-stack.py
class MaxStack (line 4) | class MaxStack:
method __init__ (line 6) | def __init__(self):
method push (line 12) | def push(self, x: int) -> None:
method pop (line 17) | def pop(self) -> int:
method top (line 24) | def top(self) -> int:
method peekMax (line 29) | def peekMax(self) -> int:
method popMax (line 34) | def popMax(self) -> int:
FILE: Python/0717-1-bit-and-2-bit-characters.py
class Solution (line 6) | class Solution:
method isOneBitCharacter (line 7) | def isOneBitCharacter(self, bits: List[int]) -> bool:
FILE: Python/0718-maximum-length-of-repeated-subarray.py
class Solution (line 6) | class Solution:
method findLength (line 7) | def findLength(self, nums1: List[int], nums2: List[int]) -> int:
FILE: Python/0719-find-k-th-smallest-pair-distance.py
class Solution (line 6) | class Solution:
method smallestDistancePair (line 7) | def smallestDistancePair(self, numbers: List[int], k: int) -> int:
FILE: Python/0721-accounts-merge.py
class Solution (line 6) | class Solution:
method __init__ (line 7) | def __init__(self):
method DFS (line 11) | def DFS(self, merged_account: List[str], email: str) -> None:
method accountsMerge (line 19) | def accountsMerge(self, account_list: List[List[str]]) -> List[List[st...
method accountsMerge (line 61) | def accountsMerge(self, accountList: List[List[str]]) -> List[List[str]]:
class UnionFind (line 44) | class UnionFind:
method __init__ (line 45) | def __init__(self, n):
method find (line 48) | def find(self, node):
method union (line 53) | def union(self, x, y):
class Solution (line 60) | class Solution:
method __init__ (line 7) | def __init__(self):
method DFS (line 11) | def DFS(self, merged_account: List[str], email: str) -> None:
method accountsMerge (line 19) | def accountsMerge(self, account_list: List[List[str]]) -> List[List[st...
method accountsMerge (line 61) | def accountsMerge(self, accountList: List[List[str]]) -> List[List[str]]:
FILE: Python/0723-candy-crush.py
class Solution (line 4) | class Solution:
method candyCrush (line 5) | def candyCrush(self, board: List[List[int]]) -> List[List[int]]:
FILE: Python/0724-find-pivot-index.py
class Solution (line 6) | class Solution:
method pivotIndex (line 7) | def pivotIndex(self, nums: List[int]) -> int:
FILE: Python/0725-split-linked-list-in-parts.py
class ListNode (line 6) | class ListNode:
method __init__ (line 7) | def __init__(self, val=0, next=None):
class Solution (line 12) | class Solution:
method splitListToParts (line 13) | def splitListToParts(self, head: Optional[ListNode], k: int) -> List[O...
FILE: Python/0726-number-of-atoms.py
class Solution (line 7) | class Solution:
method countOfAtoms (line 8) | def countOfAtoms(self, formula: str) -> str:
FILE: Python/0727-minimum-window-subsequence.py
class Solution (line 3) | class Solution:
method minWindow (line 4) | def minWindow(self, s1: str, s2: str) -> str:
FILE: Python/0729-my-calendar-i.py
class MyCalendar (line 1) | class MyCalendar:
method __init__ (line 3) | def __init__(self):
method book (line 6) | def book(self, start: int, end: int) -> bool:
FILE: Python/0731-my-calendar-ii.py
class MyCalendarTwo (line 3) | class MyCalendarTwo:
method __init__ (line 5) | def __init__(self):
method book (line 9) | def book(self, start: int, end: int) -> bool:
method does_overlap (line 22) | def does_overlap(self, start1: int, end1: int, start2: int, end2: int)...
method get_overlapped (line 25) | def get_overlapped(self, start1: int, end1: int, start2: int, end2: in...
FILE: Python/0733-flood-fill.py
class Solution (line 7) | class Solution:
method floodFill (line 8) | def floodFill(self, image: List[List[int]], sr: int, sc: int, color: i...
FILE: Python/0734-sentence-similarity.py
class Solution (line 7) | class Solution:
method areSentencesSimilar (line 8) | def areSentencesSimilar(self, sentence1: List[str], sentence2: List[st...
FILE: Python/0735-asteroid-collision.py
class Solution (line 6) | class Solution:
method asteroidCollision (line 7) | def asteroidCollision(self, asteroids: List[int]) -> List[int]:
FILE: Python/0737-sentence-similarity-ii.py
class UnionFind (line 7) | class UnionFind:
method __init__ (line 8) | def __init__(self, words: set):
method find (line 12) | def find(self, node: str):
method union (line 17) | def union(self, nodeX: str, nodeY: str):
class Solution (line 26) | class Solution:
method areSentencesSimilarTwo (line 27) | def areSentencesSimilarTwo(self, sentence1: List[str], sentence2: List...
FILE: Python/0739-daily-temperatures.py
class Solution (line 6) | class Solution:
method dailyTemperatures (line 7) | def dailyTemperatures(self, temperatures: List[int]) -> List[int]:
FILE: Python/0740-delete-and-earn.py
class Solution (line 8) | class Solution:
method deleteAndEarn (line 9) | def deleteAndEarn(self, nums: List[int]) -> int:
FILE: Python/0741-cherry-pickup.py
class Solution (line 6) | class Solution(object):
method cherryPickup (line 7) | def cherryPickup(self, grid: List[List[int]]) -> int:
FILE: Python/0743-network-delay-time.py
class Solution (line 8) | class Solution:
method networkDelayTime (line 9) | def networkDelayTime(self, times: List[List[int]], n: int, k: int) -> ...
FILE: Python/0744-find-smallest-letter-greater-than-target.py
class Solution (line 6) | class Solution:
method nextGreatestLetter (line 7) | def nextGreatestLetter(self, letters: List[str], target: str) -> str:
FILE: Python/0746-min-cost-climbing-stairs.py
class Solution (line 5) | class Solution:
method minCostClimbingStairs (line 6) | def minCostClimbingStairs(self, cost: List[int]) -> int:
FILE: Python/0752-open-the-lock.py
class Solution (line 7) | class Solution:
method openLock (line 8) | def openLock(self, deadends: List[str], target: str) -> int:
method getNeighbors (line 23) | def getNeighbors(self, s):
FILE: Python/0756-pyramid-transition-matrix.py
class Solution (line 6) | class Solution:
method pyramidTransition (line 7) | def pyramidTransition(self, bottom: str, allowed: List[str]) -> bool:
FILE: Python/0757-set-intersection-size-at-least-two.py
class Solution (line 6) | class Solution:
method intersectionSizeTwo (line 7) | def intersectionSizeTwo(self, intervals: List[List[int]]) -> int:
FILE: Python/0758-bold-words-in-string.py
class Solution (line 6) | class Solution:
method boldWords (line 7) | def boldWords(self, words: List[str], S: str) -> str:
FILE: Python/0759-employee-free-time.py
class Interval (line 7) | class Interval:
method __init__ (line 8) | def __init__(self, start: int = None, end: int = None):
class Solution (line 13) | class Solution:
method employeeFreeTime (line 14) | def employeeFreeTime(self, schedule: List[List[Interval]]) -> List[Int...
FILE: Python/0763-partition-labels.py
class Solution (line 6) | class Solution:
method partitionLabels (line 7) | def partitionLabels(self, s: str) -> List[int]:
FILE: Python/0767-reorganize-string.py
class Solution (line 7) | class Solution:
method reorganizeString (line 8) | def reorganizeString(self, s: str) -> str:
FILE: Python/0768-partition-labels.py
class Solution (line 6) | class Solution:
method partitionLabels (line 7) | def partitionLabels(self, s: str) -> List[int]:
method partitionLabels (line 22) | def partitionLabels(self, s: str) -> List[int]:
class Solution (line 21) | class Solution:
method partitionLabels (line 7) | def partitionLabels(self, s: str) -> List[int]:
method partitionLabels (line 22) | def partitionLabels(self, s: str) -> List[int]:
FILE: Python/0769-max-chunks-to-make-sorted.py
class Solution (line 6) | class Solution:
method maxChunksToSorted (line 7) | def maxChunksToSorted(self, arr: List[int]) -> int:
FILE: Python/0773-sliding-puzzle.py
class Solution (line 6) | class Solution:
method slidingPuzzle (line 16) | def slidingPuzzle(self, board: List[List[int]]) -> int:
FILE: Python/0774-minimize-max-distance-to-gas-station.py
class Solution (line 6) | class Solution:
method minmaxGasDist (line 7) | def minmaxGasDist(self, stations: List[int], k: int) -> float:
FILE: Python/0775-global-and-local-inversions.py
class Solution (line 6) | class Solution:
method isIdealPermutation (line 7) | def isIdealPermutation(self, nums: List[int]) -> bool:
FILE: Python/0776-split-bst.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method splitBST (line 14) | def splitBST(self, root: Optional[TreeNode], target: int) -> List[Opti...
FILE: Python/0778-swim-in-rising-water.py
class Solution (line 8) | class Solution:
method swimInWater (line 9) | def swimInWater(self, grid: List[List[int]]) -> int:
FILE: Python/0779-k-th-symbol-in-grammar.py
class Solution (line 1) | class Solution:
method depthFirstSearch (line 2) | def depthFirstSearch(self, n: int, k: int, rootVal: int) -> int:
method kthGrammar (line 15) | def kthGrammar(self, n: int, k: int) -> int:
FILE: Python/0781-rabbits-in-forest.py
class Solution (line 7) | class Solution:
method numRabbits (line 8) | def numRabbits(self, answers: List[int]) -> int:
FILE: Python/0786-k-th-smallest-prime-fraction.py
class Solution (line 5) | class Solution:
method kthSmallestPrimeFraction (line 6) | def kthSmallestPrimeFraction(self, arr: List[int], k: int) -> List[int]:
FILE: Python/0787-cheapest-flights-within-k-stops.py
class Solution (line 7) | class Solution:
method findCheapestPrice (line 8) | def findCheapestPrice(self, n: int, flights: List[List[int]], src: int...
FILE: Python/0790-domino-and-tromino-tiling.py
class Solution (line 6) | class Solution:
method numTilings (line 7) | def numTilings(self, n: int) -> int:
FILE: Python/0791-custom-sort-string.py
class Solution (line 6) | class Solution:
method customSortString (line 7) | def customSortString(self, order: str, s: str) -> str:
method customSortString (line 18) | def customSortString(self, order: str, s: str) -> str:
class Solution (line 17) | class Solution:
method customSortString (line 7) | def customSortString(self, order: str, s: str) -> str:
method customSortString (line 18) | def customSortString(self, order: str, s: str) -> str:
FILE: Python/0794-valid-tic-tac-toe-state.py
class Solution (line 6) | class Solution:
method validTicTacToe (line 7) | def validTicTacToe(self, board: List[str]) -> bool:
FILE: Python/0796-rotate-string.py
class Solution (line 3) | class Solution:
method rotateString (line 4) | def rotateString(self, s: str, goal: str) -> bool:
FILE: Python/0797-all-paths-from-source-to-target.py
class Solution (line 7) | class Solution:
method allPathsSourceTarget (line 8) | def allPathsSourceTarget(self, graph: List[List[int]]) -> List[List[in...
FILE: Python/0799-champagne-tower.py
class Solution (line 1) | class Solution:
method champagneTower (line 2) | def champagneTower(self, poured: int, query_row: int, query_glass: int...
FILE: Python/0802-find-eventual-safe-states.py
class Solution (line 7) | class Solution:
method eventualSafeNodes (line 8) | def eventualSafeNodes(self, graph: List[List[int]]) -> List[int]:
FILE: Python/0807-max-increase-to-keep-city-skyline.py
class Solution (line 6) | class Solution:
method maxIncreaseKeepingSkyline (line 7) | def maxIncreaseKeepingSkyline(self, grid: List[List[int]]) -> int:
FILE: Python/0808-soup-servings.py
class Solution (line 7) | class Solution:
method soupServings (line 8) | def soupServings(self, n: int) -> float:
FILE: Python/0812-largest-triangle-area.py
class Solution (line 7) | class Solution:
method largestTriangleArea (line 8) | def largestTriangleArea(self, points: List[List[int]]) -> float:
FILE: Python/0814-binary-tree-pruning.py
class TreeNode (line 4) | class TreeNode:
method __init__ (line 5) | def __init__(self, val=0, left=None, right=None):
class Solution (line 11) | class Solution:
method pruneTree (line 12) | def pruneTree(self, root: Optional[TreeNode]) -> Optional[TreeNode]:
FILE: Python/0815-bus-routes.py
class Solution (line 7) | class Solution:
method numBusesToDestination (line 8) | def numBusesToDestination(self, routes: List[List[int]], source: int, ...
FILE: Python/0817-linked-list-components.py
class ListNode (line 6) | class ListNode:
method __init__ (line 7) | def __init__(self, val=0, next=None):
class Solution (line 12) | class Solution:
method numComponents (line 13) | def numComponents(self, head: Optional[ListNode], nums: List[int]) -> ...
FILE: Python/0823-binary-trees-with-factors.py
class Solution (line 4) | class Solution(object):
method numFactoredBinaryTrees (line 5) | def numFactoredBinaryTrees(self, A):
FILE: Python/0826-most-profit-assigning-work.py
class Solution (line 6) | class Solution:
method maxProfitAssignment (line 7) | def maxProfitAssignment(
FILE: Python/0827-making-a-large-island.py
class DisjointSet (line 6) | class DisjointSet:
method __init__ (line 7) | def __init__(self, n: int):
method findRoot (line 11) | def findRoot(self, node: int) -> int:
method unionNodes (line 19) | def unionNodes(self, nodeA: int, nodeB: int):
class Solution (line 35) | class Solution:
method largestIsland (line 36) | def largestIsland(self, grid: List[List[int]]) -> int:
FILE: Python/0831-masking-personal-information.py
class Solution (line 6) | class Solution:
method maskPII (line 7) | def maskPII(self, s: str) -> str:
FILE: Python/0832-flipping-an-image.py
class Solution (line 6) | class Solution:
method flipAndInvertImage (line 7) | def flipAndInvertImage(self, image: List[List[int]]) -> List[List[int]]:
FILE: Python/0833-find-and-replace-in-string.py
class Solution (line 6) | class Solution:
method findReplaceString (line 7) | def findReplaceString(self, s: str, indices: List[int], sources: List[...
FILE: Python/0834-sum-of-distances-in-tree.py
class Solution (line 7) | class Solution:
method sumOfDistancesInTree (line 8) | def sumOfDistancesInTree(self, n: int, edges: List[List[int]]) -> List...
FILE: Python/0837-new-21-game.py
class Solution (line 3) | class Solution:
method new21Game (line 4) | def new21Game(self, n: int, k: int, maxPts: int) -> float:
FILE: Python/0838-push-dominoes.py
class Solution (line 3) | class Solution(object):
method pushDominoes (line 4) | def pushDominoes(self, dominoes):
FILE: Python/0840-magic-squares-in-grid.py
class Solution (line 6) | class Solution:
method numMagicSquaresInside (line 7) | def numMagicSquaresInside(self, grid: List[List[int]]) -> int:
method isMagicSquare (line 17) | def isMagicSquare(self, grid, row, col):
FILE: Python/0841-keys-and-rooms.py
class Solution (line 7) | class Solution:
method canVisitAllRooms (line 8) | def canVisitAllRooms(self, rooms: List[List[int]]) -> bool:
FILE: Python/0844-backspace-string-compare.py
class Solution (line 1) | class Solution:
method backspaceCompare (line 2) | def backspaceCompare(self, s: str, t: str) -> bool:
FILE: Python/0845-longest-mountain-in-array.py
class Solution (line 6) | class Solution(object):
method longestMountain (line 7) | def longestMountain(self, arr: List[int]) -> int:
FILE: Python/0846-hand-of-straights.py
class Solution (line 6) | class Solution:
method isNStraightHand (line 7) | def isNStraightHand(self, hand: List[int], groupSize: int) -> bool:
FILE: Python/0847-shortest-path-visiting-all-nodes.py
class Solution (line 4) | class Solution:
method shortestPathLength (line 5) | def shortestPathLength(self, graph: List[List[int]]) -> int:
FILE: Python/0849-maximize-distance-to-closest-person.py
class Solution (line 6) | class Solution:
method maxDistToClosest (line 7) | def maxDistToClosest(self, seats: List[int]) -> int:
FILE: Python/0851-loud-and-rich.py
class Solution (line 7) | class Solution:
method loudAndRich (line 8) | def loudAndRich(self, richer: List[List[int]], quiet: List[int]) -> Li...
FILE: Python/0852-peak-index-in-a-mountain-array.py
class Solution (line 6) | class Solution:
method peakIndexInMountainArray (line 7) | def peakIndexInMountainArray(self, arr: List[int]) -> int:
FILE: Python/0853-car-fleet.py
class Solution (line 6) | class Solution:
method carFleet (line 7) | def carFleet(self, target: int, position: List[int], speed: List[int])...
FILE: Python/0856-score-of-parentheses.py
class Solution (line 3) | class Solution:
method scoreOfParentheses (line 4) | def scoreOfParentheses(self, s: str) -> int:
FILE: Python/0857-minimum-cost-to-hire-k-workers.py
class Solution (line 7) | class Solution:
method mincostToHireWorkers (line 8) | def mincostToHireWorkers(self, quality: List[int], wage: List[int], k:...
FILE: Python/0860-lemonade-change.py
class Solution (line 6) | class Solution:
method lemonadeChange (line 7) | def lemonadeChange(self, bills: List[int]) -> bool:
FILE: Python/0861-score-after-flipping-matrix.py
class Solution (line 6) | class Solution:
method matrixScore (line 7) | def matrixScore(self, grid: List[List[int]]) -> int:
FILE: Python/0862-shortest-subarray-with-sum-at-least-k.py
class Solution (line 7) | class Solution:
method shortestSubarray (line 8) | def shortestSubarray(self, nums: List[int], k: int) -> int:
FILE: Python/0863-all-nodes-distance-k-in-binary-tree.py
class TreeNode (line 7) | class TreeNode:
method __init__ (line 8) | def __init__(self, x):
class Solution (line 14) | class Solution:
method distanceK (line 15) | def distanceK(self, root: TreeNode, target: TreeNode, k: int) -> List[...
FILE: Python/0865-smallest-subtree-with-all-the-deepest-nodes.py
class TreeNode (line 6) | class TreeNode:
method __init__ (line 7) | def __init__(self, val=0, left=None, right=None):
class Solution (line 13) | class Solution:
method subtreeWithAllDeepest (line 14) | def subtreeWithAllDeepest(self, root: Optional[TreeNode]) -> Optional[...
FILE: Python/0867-transpose-matrix.py
class Solution (line 6) | class Solution:
method transpose (line 7) | def transpose(self, matrix: List[List[int]]) -> List[List[int]]:
FILE: Python/0869-reordered-power-of-2.py
class Solution (line 6) | class Solution:
method reorderedPowerOf2 (line 7) | def reorderedPowerOf2(self, n: int) -> bool:
FILE: Python/0871-minimum-number-of-refueling-stops.py
class Solution (line 7) | class Solution:
method minRefuelStops (line 8) | def minRefuelStops(self, target: int, startFuel: int, stations: List[L...
FILE: Python/0872-leaf-similar-trees.py
class TreeNode (line 7) | class TreeNode:
method __init__ (line 8) | def __init__(self, val=0, left=None, right=None):
class Solution (line 14) | class Solution:
method leafSimilar (line 15) | def leafSimilar(self, root1: Optional[TreeNode], root2: Optional[TreeN...
FILE: Python/0873-length-of-longest-fibonacci-subsequence.py
class Solution (line 6) | class Solution:
method lenLongestFibSubseq (line 7) | def lenLongestFibSubseq(self, arr: List[int]) -> int:
FILE: Python/0874-walking-robot-simulation.py
class Solution (line 6) | class Solution:
method robotSim (line 7) | def robotSim(self, commands: List[int], obstacles: List[List[int]]) ->...
FILE: Python/0875-koko-eating-bananas.py
class Solution (line 7) | class Solution:
method minEatingSpeed (line 8) | def minEatingSpeed(self, piles: List[int], h: int) -> int:
FILE: Python/0876-middle-of-the-linked-list.py
class ListNode (line 6) | class ListNode:
method __init__ (line 7) | def __init__(self, val=0, next=None):
class Solution (line 12) | class Solution:
method middleNode (line 13) | def middleNode(self, head: Optional[ListNode]) -> Optional[ListNode]:
FILE: Python/0880-decoded-string-at-index.py
class Solution (line 1) | class Solution:
method decodeAtIndex (line 2) | def decodeAtIndex(self, s: str, k: int) -> str:
FILE: Python/0881-boats-to-save-people.py
class Solution (line 6) | class Solution:
method numRescueBoats (line 7) | def numRescueBoats(self, people: List[int], limit: int) -> int:
FILE: Python/0884-uncommon-words-from-two-sentences.py
class Solution (line 6) | class Solution:
method uncommonFromSentences (line 7) | def uncommonFromSentences(self, s1: str, s2: str) -> List[str]:
FILE: Python/0885-spiral-matrix-iii.py
class Solution (line 6) | class Solution:
method spiralMatrixIII (line 7) | def spiralMatrixIII(self, rows: int, cols: int, rStart: int, cStart: i...
FILE: Python/0888-fair-candy-swap.py
class Solution (line 4) | class Solution:
method fairCandySwap (line 5) | def fairCandySwap(self, aliceSizes: List[int], bobSizes: List[int]) ->...
FILE: Python/0889-construct-binary-tree-from-preorder-and-postorder-traversal.py
class Solution (line 9) | class Solution:
method constructFromPrePost (line 10) | def constructFromPrePost(self, preorder: List[int], postorder: List[in...
FILE: Python/0890-find-and-replace-pattern.py
class Solution (line 7) | class Solution:
method findAndReplacePattern (line 8) | def findAndReplacePattern(self, words: List[str], pattern: str) -> Lis...
FILE: Python/0894-all-possible-full-binary-trees.py
class TreeNode (line 5) | class TreeNode:
method __init__ (line 6) | def __init__(self, val=0, left=None, right=None):
class Solution (line 12) | class Solution:
method allPossibleFBT (line 13) | def allPossibleFBT(self, n: int) -> List[Optional[TreeNode]]:
FILE: Python/0895-maximum-frequency-stack.py
class FreqStack (line 6) | class FreqStack:
method __init__ (line 8) | def __init__(self):
method push (line 13) | def push(self, val: int) -> None:
method pop (line 20) | def pop(self) -> int:
FILE: Python/0896-monotonic-array.py
class Solution (line 4) | class Solution:
method isMonotonic (line 5) | def isMonotonic(self, nums: List[int]) -> bool:
FILE: Python/0898-bitwise-ors-of-subarrays.py
class Solution (line 6) | class Solution:
method subarrayBitwiseORs (line 7) | def subarrayBitwiseORs(self, arr: List[int]) -> int:
FILE: Python/0900-rle-iterator.py
class RLEIterator (line 6) | class RLEIterator:
method __init__ (line 7) | def __init__(self, encoding: List[int]):
method next (line 10) | def next(self, n: int) -> int:
FILE: Python/0901-online-stock-span.py
class StockSpanner (line 3) | class StockSpanner:
method __init__ (line 5) | def __init__(self):
method next (line 8) | def next(self, price: int) -> int:
FILE: Python/0904-fruit-into-baskets.py
class Solution (line 6) | class Solution:
method totalFruit (line 7) | def totalFruit(self, fruits: List[int]) -> int:
FILE: Python/0905-sort-array-by-parity.py
class Solution (line 4) | class Solution:
method sortArrayByParity (line 5) | def sortArrayByParity(self, nums: List[int]) -> List[int]:
FILE: Python/0907-koko-eating-bananas.py
class Solution (line 7) | class Solution:
method minEatingSpeed (line 8) | def minEatingSpeed(self, piles: List[int], h: int) -> int:
FILE: Python/0907-sum-of-subarray-minimums.py
class Solution (line 6) | class Solution:
method sumSubarrayMins (line 7) | def sumSubarrayMins(self, arr: List[int]) -> int:
FILE: Python/0909-snakes-and-ladders.py
class Solution (line 7) | class Solution:
method snakesAndLadders (line 8) | def snakesAndLadders(self, board: List[List[int]]) -> int:
FILE: Python/0912-sort-an-array.py
class Solution (line 6) | class Solution:
method sortArray (line 7) | def sortArray(self, nums: List[int]) -> List[int]:
method mergeSortedArray (line 15) | def mergeSortedArray(self, aList: List[int], bList: List[int]):
method sortArray (line 33) | def sortArray(self, nums: List[int]) -> List[int]:
method radixSort (line 66) | def radixSort(self, nums: List[int]) -> List[int]:
method sortArray (line 101) | def sortArray(self, nums: List[int]) -> List[int]:
method sortArray (line 107) | def sortArray(self, nums: List[int]) -> List[int]:
class Solution (line 32) | class Solution:
method sortArray (line 7) | def sortArray(self, nums: List[int]) -> List[int]:
method mergeSortedArray (line 15) | def mergeSortedArray(self, aList: List[int], bList: List[int]):
method sortArray (line 33) | def sortArray(self, nums: List[int]) -> List[int]:
method radixSort (line 66) | def radixSort(self, nums: List[int]) -> List[in
Condensed preview — 3835 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (7,109K chars).
[
{
"path": ".github/FUNDING.yml",
"chars": 47,
"preview": "custom: https://www.buymeacoffee.com/hogan.tech"
},
{
"path": ".github/scripts/update_leetcode.cjs",
"chars": 628,
"preview": "const fs = require(\"fs\");\nconst fetch = require(\"node-fetch\");\n\nconst username = \"hogantech\";\nconst url = `https://leetc"
},
{
"path": ".github/test.txt",
"chars": 45,
"preview": "3721-longest-balanced-subarray-ii python hard"
},
{
"path": ".github/workflows/python-publish.yml",
"chars": 1092,
"preview": "name: Update Stats\n\non:\n workflow_dispatch:\n schedule:\n # Runs every 12 hours\n - cron: \"0 */12 * * *\"\n\npermissio"
},
{
"path": ".vscode/settings.json",
"chars": 147,
"preview": "{\n\t\"files.associations\": {\n\t\t\"*.js\": \"javascript\",\n\t\t\"*.css\": \"css\",\n\t\t\"*.cpp\": \"cpp\",\n\t\t\"*.ros\": \"php\",\n\t\t\"*.inc\": \"php"
},
{
"path": "C++/0002-add-two-numbers.cpp",
"chars": 846,
"preview": "/**\n * Definition for singly-linked list.\n * struct ListNode {\n * int val;\n * ListNode *next;\n * ListNode() "
},
{
"path": "C++/0003-longest-substring-without-repeating-characters.cpp",
"chars": 362,
"preview": "class Solution {\n public:\n int lengthOfLongestSubstring(string s) {\n vector<int> chars(128);\n int left = 0, right"
},
{
"path": "C++/0009-palindrome-number.cpp",
"chars": 343,
"preview": "class Solution\n{\npublic:\n bool isPalindrome(int x)\n {\n int revert = 0;\n if (x < 0 || (!(x % 10) && x"
},
{
"path": "C++/0013-roman-to-integer.cpp",
"chars": 1714,
"preview": "class Solution\n{\npublic:\n int romanToInt(string s)\n {\n int i, ans = 0;\n for (i = 0; i < s.length(); "
},
{
"path": "C++/0014-longest-common-prefix.cpp",
"chars": 694,
"preview": "class Solution\n{\npublic:\n string longestCommonPrefix(vector<string> &strs)\n {\n if (strs.empty())\n "
},
{
"path": "C++/0015-3sum.cpp",
"chars": 736,
"preview": "class Solution {\n void twoSumII(vector<int>& nums, int i, vector<vector<int>>& res) {\n int lo = i + 1, hi = nums.siz"
},
{
"path": "C++/0019-remove-nth-node-from-end-of-list.cpp",
"chars": 796,
"preview": "/**\n * Definition for singly-linked list.\n * struct ListNode {\n * int val;\n * ListNode *next;\n * ListNode() "
},
{
"path": "C++/0020-valid-parentheses.cpp",
"chars": 1488,
"preview": "class Solution\n{\npublic:\n bool isValid(string s)\n {\n int stack_top = 10;\n char stack[10000];\n "
},
{
"path": "C++/0021-merge-two-sorted-lists.cpp",
"chars": 763,
"preview": "/**\n * Definition for singly-linked list.\n * struct ListNode {\n * int val;\n * ListNode *next;\n * ListNode() "
},
{
"path": "C++/0035-search-insert-position.cpp",
"chars": 512,
"preview": "class Solution\n{\npublic:\n int searchInsert(vector<int> &nums, int target)\n {\n int index = 0;\n if (nu"
},
{
"path": "C++/0036-valid-sudoku.cpp",
"chars": 1534,
"preview": "class Solution {\n bool checkRow(vector<vector<char>> &board, int row) {\n unordered_set<char> set;\n for (int i = 0"
},
{
"path": "C++/0045-jump-game-ii.cpp",
"chars": 327,
"preview": "class Solution {\n public:\n int jump(vector<int>& nums) {\n int jumps = 0, currentJumpEnd = 0, farthest = 0;\n for ("
},
{
"path": "C++/0046-permutations.cpp",
"chars": 663,
"preview": "class Solution {\n public:\n vector<vector<int>> permute(vector<int>& num) {\n vector<vector<int>> res;\n vector<int>"
},
{
"path": "C++/0048-rotate-image.cpp",
"chars": 665,
"preview": "class Solution {\n public:\n void rotate(vector<vector<int>>& matrix) {\n transpose(matrix);\n reflect(matrix);\n }\n\n"
},
{
"path": "C++/0054-spiral-matrix.cpp",
"chars": 851,
"preview": "class Solution {\n public:\n vector<int> spiralOrder(vector<vector<int>>& matrix) {\n vector<int> list;\n int rows = "
},
{
"path": "C++/0055-jump-game.cpp",
"chars": 268,
"preview": "class Solution {\n public:\n bool canJump(vector<int>& nums) { \n int last_pos = nums.size()-1;\n for(int i = num"
},
{
"path": "C++/0056-merge-intervals.cpp",
"chars": 420,
"preview": "class Solution {\n public:\n vector<vector<int>> merge(vector<vector<int>>& intervals) {\n sort(intervals.begin(), inte"
},
{
"path": "C++/0059-spiral-matrix-ii.cpp",
"chars": 852,
"preview": "class Solution {\n public:\n vector<vector<int>> generateMatrix(int n) {\n vector<vector<int>> result(n, vector<int>(n)"
},
{
"path": "C++/0070-climbing-stairs.cpp",
"chars": 260,
"preview": "class Solution {\n public:\n int climbStairs(int n) {\n if (n == 0 || n == 1) {\n return 1;\n }\n vector<int> d"
},
{
"path": "C++/0074-search-a-2d-matrix.cpp",
"chars": 587,
"preview": "class Solution {\n public:\n bool searchMatrix(vector<vector<int>> &matrix, int target) {\n int row = matrix.size();\n "
},
{
"path": "C++/0075-sort-colors.cpp",
"chars": 698,
"preview": "class Solution {\n void swap(int *a, int *b) {\n int temp = *a;\n *a = *b;\n *b = temp;\n }\n int Partition(vector"
},
{
"path": "C++/0077-combinations.cpp",
"chars": 557,
"preview": "class Solution {\n vector<vector<int>> ans;\n // n = 4;k = 2;\n int N, K;\n void findCombination(int start, vector<int> "
},
{
"path": "C++/0083-remove-duplicates-from-sorted-list.cpp",
"chars": 616,
"preview": "/**\n * Definition for singly-linked list.\n * struct ListNode {\n * int val;\n * ListNode *next;\n * ListNode() "
},
{
"path": "C++/0088-merge-sorted-array.cpp",
"chars": 223,
"preview": "class Solution\n{\npublic:\n void merge(vector<int> &nums1, int m, vector<int> &nums2, int n)\n {\n for (int i ="
},
{
"path": "C++/0094-binary-tree-inorder-traversal.cpp",
"chars": 715,
"preview": "/**\n * Definition for a binary tree node.\n * struct TreeNode {\n * int val;\n * TreeNode *left;\n * TreeNode *r"
},
{
"path": "C++/0098-validate-binary-search-tree.cpp",
"chars": 712,
"preview": "/**\n * Definition for a binary tree node.\n * struct TreeNode {\n * int val;\n * TreeNode *left;\n * TreeNode *r"
},
{
"path": "C++/0101-symmetric-tree.cpp",
"chars": 709,
"preview": "/**\n * Definition for a binary tree node.\n * struct TreeNode {\n * int val;\n * TreeNode *left;\n * TreeNode *r"
},
{
"path": "C++/0102-binary-tree-level-order-traversal.cpp",
"chars": 1097,
"preview": "/**\n * Definition for a binary tree node.\n * struct TreeNode {\n * int val;\n * TreeNode *left;\n * TreeNode *r"
},
{
"path": "C++/0104-maximum-depth-of-binary-tree.cpp",
"chars": 910,
"preview": "/**\n * Definition for a binary tree node.\n * struct TreeNode {\n * int val;\n * TreeNode *left;\n * TreeNode *r"
},
{
"path": "C++/0112-path-sum.cpp",
"chars": 738,
"preview": "/**\n * Definition for a binary tree node.\n * struct TreeNode {\n * int val;\n * TreeNode *left;\n * TreeNode *r"
},
{
"path": "C++/0116-populating-next-right-pointers-in-each-node.cpp",
"chars": 929,
"preview": "/*\n// Definition for a Node.\nclass Node {\npublic:\n int val;\n Node* left;\n Node* right;\n Node* next;\n\n Nod"
},
{
"path": "C++/0118-pascals-triangle.cpp",
"chars": 486,
"preview": "class Solution\n{\npublic:\n vector<vector<int> > generate(int numRows)\n {\n vector<vector<int> > ret;\n "
},
{
"path": "C++/0119-pascals-triangle-ii.cpp",
"chars": 318,
"preview": "class Solution {\n public:\n vector<int> getRow(int rowIndex) {\n vector<int> curr, prev = {1};\n\n for (int i = 1; i "
},
{
"path": "C++/0120-triangle.cpp",
"chars": 720,
"preview": "class Solution {\n public:\n int minimumTotal(vector<vector<int>>& triangle) {\n for (int row = 1; row < triangle.size("
},
{
"path": "C++/0121-best-time-to-buy-and-sell-stock.cpp",
"chars": 428,
"preview": "class Solution\n{\npublic:\n int maxProfit(vector<int> &prices)\n {\n int min = 10000;\n int max_profit = "
},
{
"path": "C++/0136-single-number.cpp",
"chars": 193,
"preview": "class Solution {\n public:\n int singleNumber(vector<int>& nums) {\n int output = 0;\n for(int i = 0;i < nums.size();"
},
{
"path": "C++/0141-linked-list-cycle.cpp",
"chars": 465,
"preview": "/**\n * Definition for singly-linked list.\n * struct ListNode {\n * int val;\n * ListNode *next;\n * ListNode(in"
},
{
"path": "C++/0144-binary-tree-preorder-traversal.cpp",
"chars": 720,
"preview": "/**\n * Definition for a binary tree node.\n * struct TreeNode {\n * int val;\n * TreeNode *left;\n * TreeNode *r"
},
{
"path": "C++/0145-binary-tree-postorder-traversal.cpp",
"chars": 725,
"preview": "/**\n * Definition for a binary tree node.\n * struct TreeNode {\n * int val;\n * TreeNode *left;\n * TreeNode *r"
},
{
"path": "C++/0167-two-sum-ii-input-array-is-sorted.cpp",
"chars": 638,
"preview": "class Solution\n{\npublic:\n vector<int> twoSum(vector<int> &nums, int target)\n {\n vector<int> twoSum;\n "
},
{
"path": "C++/0169-majority-element.cpp",
"chars": 153,
"preview": "class Solution {\npublic:\n int majorityElement(vector<int>& nums) {\n sort(nums.begin(),nums.end());\n ret"
},
{
"path": "C++/0189-rotate-array.cpp",
"chars": 319,
"preview": "class Solution\n{\npublic:\n void rotate(vector<int> &nums, int k)\n {\n vector<int> a = nums;\n for (int "
},
{
"path": "C++/0190-reverse-bits.cpp",
"chars": 213,
"preview": "class Solution {\n public:\n uint32_t reverseBits(uint32_t n) {\n uint32_t ret = 0, power = 31;\n while (n != 0) {\n "
},
{
"path": "C++/0191-number-of-1-bits.cpp",
"chars": 199,
"preview": "class Solution {\n public:\n int hammingWeight(uint32_t n) {\n int sum = 0, mask = 1;\n for (int i = 0; i < 32; i++) "
},
{
"path": "C++/0198-house-robber.cpp",
"chars": 431,
"preview": "class Solution {\n public:\n int rob(vector<int>& nums) {\n int total = nums.size();\n if (total == 0) return 0;\n "
},
{
"path": "C++/0203-remove-linked-list-elements.cpp",
"chars": 691,
"preview": "/**\n * Definition for singly-linked list.\n * struct ListNode {\n * int val;\n * ListNode *next;\n * ListNode() "
},
{
"path": "C++/0206-reverse-linked-list.cpp",
"chars": 579,
"preview": "/**\n * Definition for singly-linked list.\n * struct ListNode {\n * int val;\n * ListNode *next;\n * ListNode() "
},
{
"path": "C++/0213-house-robber-ii.cpp",
"chars": 600,
"preview": "class Solution {\n int rob_simple(vector<int>& nums, int start, int end) {\n int t1 = 0;\n int t2 = 0;\n for (int "
},
{
"path": "C++/0217-contains-duplicate.cpp",
"chars": 308,
"preview": "class Solution\n{\npublic:\n bool containsDuplicate(vector<int> &nums)\n {\n sort(nums.begin(), nums.end());\n "
},
{
"path": "C++/0231-power-of-two.cpp",
"chars": 141,
"preview": "class Solution {\n public:\n bool isPowerOfTwo(int n) {\n if (n == 0) return false;\n while (n % 2 == 0) n /= 2;\n "
},
{
"path": "C++/0232-implement-queue-using-stacks.cpp",
"chars": 925,
"preview": "class MyQueue {\n stack<int> stack_q;\n stack<int> buffer_q;\n\n public:\n void push(int x) { stack_q.push(x); }\n int pop"
},
{
"path": "C++/0235-lowest-common-ancestor-of-a-binary-search-tree.cpp",
"chars": 541,
"preview": "/**\n * Definition for a binary tree node.\n * struct TreeNode {\n * int val;\n * TreeNode *left;\n * TreeNode *r"
},
{
"path": "C++/0242-valid-anagram.cpp",
"chars": 206,
"preview": "class Solution {\n public:\n bool isAnagram(string s, string t) {\n sort(s.begin(), s.end());\n sort(t.begin(), t.end"
},
{
"path": "C++/0278-first-bad-version.cpp",
"chars": 441,
"preview": "// The API isBadVersion is defined for you.\n// bool isBadVersion(int version);\n\nclass Solution\n{\npublic:\n int firstBa"
},
{
"path": "C++/0283-move-zeroes.cpp",
"chars": 451,
"preview": "class Solution\n{\npublic:\n void moveZeroes(vector<int> &nums)\n {\n vector<int> output;\n output.reserve"
},
{
"path": "C++/0344-reverse-string.cpp",
"chars": 234,
"preview": "class Solution {\n public:\n void reverseString(vector<char>& s) {\n char temp = '\\0';\n for (int i = 0; i < (s.size("
},
{
"path": "C++/0350-intersection-of-two-arrays-ii.cpp",
"chars": 381,
"preview": "class Solution\n{\npublic:\n vector<int> intersect(vector<int> &nums1, vector<int> &nums2)\n {\n sort(begin(nums"
},
{
"path": "C++/0383-ransom-note.cpp",
"chars": 390,
"preview": "class Solution {\n public:\n bool canConstruct(string ransomNote, string magazine) {\n int map[26] = {0};\n for (int "
},
{
"path": "C++/0387-first-unique-character-in-a-string.cpp",
"chars": 347,
"preview": "class Solution {\n public:\n int firstUniqChar(string s) {\n int count[26] = {0};\n int n = s.length();\n for (int "
},
{
"path": "C++/0509-fibonacci-number.cpp",
"chars": 135,
"preview": "class Solution {\n public:\n int fib(int n) {\n if(n == 0)return 0;\n if(n == 1)return 1;\n return fib(n-1)+f"
},
{
"path": "C++/0542-01-matrix.cpp",
"chars": 1037,
"preview": "class Solution {\n public:\n vector<vector<int>> updateMatrix(vector<vector<int>>& matrix) {\n int row = matrix.size();"
},
{
"path": "C++/0557-reverse-words-in-a-string-iii.cpp",
"chars": 773,
"preview": "class Solution {\n void reverseString(vector<char>& s) {\n char temp = '\\0';\n for (int i = 0; i < (s.size() / 2); i"
},
{
"path": "C++/0566-reshape-the-matrix.cpp",
"chars": 780,
"preview": "class Solution\n{\npublic:\n vector<vector<int> > matrixReshape(vector<vector<int> > &nums, int r, int c)\n {\n "
},
{
"path": "C++/0567-permutation-in-string.cpp",
"chars": 640,
"preview": "class Solution {\n bool matches(int map1[],int map2[]){\n for(int i = 0;i < 26;i ++){\n if(map1[i] != map2[i]){\n "
},
{
"path": "C++/0617-merge-two-binary-trees.cpp",
"chars": 671,
"preview": "/**\n * Definition for a binary tree node.\n * struct TreeNode {\n * int val;\n * TreeNode *left;\n * TreeNode *r"
},
{
"path": "C++/0653-two-sum-iv-input-is-a-bst.cpp",
"chars": 968,
"preview": "/**\n * Definition for a binary tree node.\n * struct TreeNode {\n * int val;\n * TreeNode *left;\n * TreeNode *r"
},
{
"path": "C++/0695-max-area-of-island.cpp",
"chars": 1073,
"preview": "class Solution {\n int findPath(vector<vector<int>>& grid, int x, int y) {\n int counter = 0;\n if (grid[x][y] == 1)"
},
{
"path": "C++/0700-search-in-a-binary-search-tree.cpp",
"chars": 677,
"preview": "/**\n * Definition for a binary tree node.\n * struct TreeNode {\n * int val;\n * TreeNode *left;\n * TreeNode *r"
},
{
"path": "C++/0701-insert-into-a-binary-search-tree.cpp",
"chars": 689,
"preview": "/**\n * Definition for a binary tree node.\n * struct TreeNode {\n * int val;\n * TreeNode *left;\n * TreeNode *r"
},
{
"path": "C++/0704-binary-search.cpp",
"chars": 445,
"preview": "class Solution\n{\npublic:\n int search(vector<int> &nums, int target)\n {\n int left = 0,mid;\n int right"
},
{
"path": "C++/0706-design-hashmap.cpp",
"chars": 1302,
"preview": "class MyHashMap {\n int size = 173;\n int hash(int key) { return key % size; }\n vector<list<pair<int, int>>> myhashmap;"
},
{
"path": "C++/0733-flood-fill.cpp",
"chars": 921,
"preview": "class Solution {\npublic:\n vector<vector<int>> floodFill(vector<vector<int>>& image, int sr, int sc, int newColor) {\n "
},
{
"path": "C++/0746-min-cost-climbing-stairs.cpp",
"chars": 310,
"preview": "class Solution {\n public:\n int minCostClimbingStairs(vector<int>& cost) {\n vector<int> min_sum(cost.size() + 1);\n "
},
{
"path": "C++/0784-letter-case-permutation.cpp",
"chars": 515,
"preview": "class Solution {\n public:\n vector<string> letterCasePermutation(string S) {\n vector<string> output;\n output.push_"
},
{
"path": "C++/0876-middle-of-the-linked-list.cpp",
"chars": 621,
"preview": "/**\n * Definition for singly-linked list.\n * struct ListNode {\n * int val;\n * ListNode *next;\n * ListNode() "
},
{
"path": "C++/0977-squares-of-a-sorted-array.cpp",
"chars": 270,
"preview": "class Solution\n{\npublic:\n vector<int> sortedSquares(vector<int> &nums)\n {\n vector<int> ans(nums.size());\n "
},
{
"path": "C++/0994-rotting-oranges.cpp",
"chars": 1316,
"preview": "class Solution {\n public:\n int orangesRotting(vector<vector<int>>& grid) {\n queue<pair<int, int>> q;\n int freshOr"
},
{
"path": "C++/1137-n-th-tribonacci-number.cpp",
"chars": 280,
"preview": "class Solution {\n public:\n int tribonacci(int n) {\n if (n == 0) return 0;\n if (n == 1 || n == 2) return 1;\n in"
},
{
"path": "C++/1265-print-immutable-linked-list-in-reverse.cpp",
"chars": 889,
"preview": "/**\n * // This is the ImmutableListNode's API interface.\n * // You should not implement it, or speculate about its imple"
},
{
"path": "C++/1920-build-array-from-permutation.cpp",
"chars": 228,
"preview": "class Solution\n{\npublic:\n vector<int> buildArray(vector<int> &nums)\n {\n vector<int> ans = nums;\n for"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 5202,
"preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nWe as members, contributors, and leaders pledge to make participa"
},
{
"path": "JavaScript/0020-valid-parentheses.js",
"chars": 684,
"preview": "/**\n * @param {string} s\n * @return {boolean}\n * Time complexity: O(n)\n * Space complexity: O(n)\n */\nvar isValid = funct"
},
{
"path": "JavaScript/0021-merge-two-sorted-lists.js",
"chars": 623,
"preview": "/**\n * Definition for singly-linked list.\n * function ListNode(val, next) {\n * this.val = (val===undefined ? 0 : val"
},
{
"path": "JavaScript/0049-group-anagrams.js",
"chars": 437,
"preview": "/**\n * @param {string[]} strs\n * @return {string[][]}\n */\nvar groupAnagrams = function (strs) {\n const ans = new Map("
},
{
"path": "JavaScript/0074-search-a-2d-matrix.js",
"chars": 462,
"preview": "var searchMatrix = function (matrix, target) {\n\tif (matrix.length === 0) return false;\n\tconst rows = matrix.length;\n\tcon"
},
{
"path": "JavaScript/0078-subsets.js",
"chars": 286,
"preview": "var subsets = function (nums) {\n\tlet output = [[]];\n\tfor (let num of nums) {\n\t\tlet newSubsets = [];\n\t\tfor (let curr of o"
},
{
"path": "JavaScript/0094-binary-tree-inorder-traversal.js",
"chars": 575,
"preview": "/**\n * Definition for a binary tree node.\n * function TreeNode(val, left, right) {\n * this.val = (val===undefined ? "
},
{
"path": "JavaScript/0100-same-tree.js",
"chars": 766,
"preview": "/**\n * Definition for a binary tree node.\n * function TreeNode(val, left, right) {\n * this.val = (val===undefined ? "
},
{
"path": "JavaScript/0104-maximum-depth-of-binary-tree.js",
"chars": 603,
"preview": "/**\n * Definition for a binary tree node.\n * function TreeNode(val, left, right) {\n * this.val = (val===undefined ? "
},
{
"path": "JavaScript/0121-best-time-to-buy-and-sell-stock.js",
"chars": 455,
"preview": "/**\n * @param {number[]} prices\n * @return {number}\n */\nvar maxProfit = function (prices) {\n profit = 0;\n smallest"
},
{
"path": "JavaScript/0141-linked-list-cycle.js",
"chars": 507,
"preview": "/**\n * Definition for singly-linked list.\n * function ListNode(val) {\n * this.val = val;\n * this.next = null;\n *"
},
{
"path": "JavaScript/0144-binary-tree-preorder-traversal.js",
"chars": 575,
"preview": "/**\n * Definition for a binary tree node.\n * function TreeNode(val, left, right) {\n * this.val = (val===undefined ? "
},
{
"path": "JavaScript/0145-binary-tree-postorder-traversal.js",
"chars": 579,
"preview": "/**\n * Definition for a binary tree node.\n * function TreeNode(val, left, right) {\n * this.val = (val===undefined ? "
},
{
"path": "JavaScript/0153-find-minimum-in-rotated-sorted-array.js",
"chars": 592,
"preview": "/**\n * @param {number[]} nums\n * @return {number}\n */\nvar findMin = function (nums) {\n if (nums.length === 1) return nu"
},
{
"path": "JavaScript/0206-reverse-linked-list.js",
"chars": 518,
"preview": "/**\n * Definition for singly-linked list.\n * function ListNode(val, next) {\n * this.val = (val===undefined ? 0 : val"
},
{
"path": "JavaScript/0217-contains-duplicate.js",
"chars": 162,
"preview": "/**\n * @param {number[]} nums\n * @return {boolean}\n */\nvar containsDuplicate = function(nums) {\n let set = new Set(nu"
},
{
"path": "JavaScript/0226-invert-binary-tree.js",
"chars": 1277,
"preview": "// Definition for a binary tree node.\nfunction TreeNode(val, left, right) {\n this.val = val === undefined ? 0 : val;\n"
},
{
"path": "JavaScript/0242-valid-anagram.js",
"chars": 1078,
"preview": "/**\n * @param {string} s\n * @param {string} t\n * @return {boolean}\n */\nvar isAnagram = function(s, t) {\n // Helper fu"
},
{
"path": "JavaScript/0506-relative-ranks.js",
"chars": 693,
"preview": "/**\n * @param {number[]} score\n * @return {string[]}\n */\nvar findRelativeRanks = function (score) {\n const N = score.le"
},
{
"path": "JavaScript/0572-subtree-of-another-tree.js",
"chars": 1149,
"preview": "/**\n * Definition for a binary tree node.\n * function TreeNode(val, left, right) {\n * this.val = (val === undefined "
},
{
"path": "JavaScript/0704-binary-search.js",
"chars": 527,
"preview": "/**\n * @param {number[]} nums\n * @param {number} target\n * @return {number}\n */\nvar search = function(nums, target) {\n "
},
{
"path": "JavaScript/0994-rotting-oranges.js",
"chars": 2057,
"preview": "/**\n * @param {number[][]} grid\n * @return {number}\n */\nvar orangesRotting = function(grid) {\n let queue = [];\n le"
},
{
"path": "JavaScript/2619-array-prototype-last.js",
"chars": 145,
"preview": "Array.prototype.last = function () {\n return this.length ? this[this.length - 1] : -1;\n};\n\n/**\n * const arr = [1, 2, 3]"
},
{
"path": "JavaScript/2620-counter.js",
"chars": 86,
"preview": "var createCounter = function(n) {\n return function() {\n return n++\n };\n};"
},
{
"path": "JavaScript/2621-sleep.js",
"chars": 343,
"preview": "/**\n * @param {number} millis\n */\nasync function sleep(millis) {\n return new Promise((resolve, reject) => {\n setTime"
},
{
"path": "JavaScript/2622-cache-with-time-limit.js",
"chars": 1099,
"preview": "\n\nvar TimeLimitedCache = function() {\n this.cache = new Map();\n};\n\n/** \n * @param {number} key\n * @param {number} val"
},
{
"path": "JavaScript/2623-memoize.js",
"chars": 509,
"preview": "/**\n * @param {Function} fn\n */\nfunction memoize(fn) {\n const cache = {};\n return function(...args) {\n const key = "
},
{
"path": "JavaScript/2625-flatten-deeply-nested-array.js",
"chars": 360,
"preview": "/**\n * @param {any[]} arr\n * @param {number} depth\n * @return {any[]}\n */\nvar flat = function (arr, n) {\n const result "
},
{
"path": "JavaScript/2626-array-reduce-transformation.js",
"chars": 221,
"preview": "/**\n * @param {number[]} nums\n * @param {Function} fn\n * @param {number} init\n * @return {number}\n */\nvar reduce = funct"
},
{
"path": "JavaScript/2627-debounce.js",
"chars": 414,
"preview": "/**\n * @param {Function} fn\n * @param {number} t milliseconds\n * @return {Function}\n */\nvar debounce = function (fn, t) "
},
{
"path": "JavaScript/2628-json-deep-equal.js",
"chars": 443,
"preview": "/**\n * @param {any} o1\n * @param {any} o2\n * @return {boolean}\n */\nconst helper = (key,value) => {\n return (value && "
},
{
"path": "JavaScript/2629-function-composition.js",
"chars": 226,
"preview": "/**\n * @param {Function[]} functions\n * @return {Function}\n */\nvar compose = function (functions) {\n return function (x"
},
{
"path": "JavaScript/2631-group-by.js",
"chars": 376,
"preview": "/**\n * @param {Function} fn\n * @return {Array}\n */\nArray.prototype.groupBy = function (fn) {\n let result = {}\n for"
},
{
"path": "JavaScript/2632-curry.js",
"chars": 372,
"preview": "/**\n * @param {Function} fn\n * @return {Function}\n */\nvar curry = function (fn) {\n return function curried(...args) {\n "
},
{
"path": "JavaScript/2633-convert-object-to-json-string.js",
"chars": 719,
"preview": "/**\n * @param {any} object\n * @return {string}\n */\nvar jsonStringify = function (object) {\n switch (typeof object) {\n "
},
{
"path": "JavaScript/2634-filter-elements-from-array.js",
"chars": 233,
"preview": "/**\n * @param {number[]} arr\n * @param {Function} fn\n * @return {number[]}\n */\nvar filter = function (arr, fn) {\n resul"
},
{
"path": "JavaScript/2635-apply-transform-over-each-element-in-array.js",
"chars": 185,
"preview": "/**\n * @param {number[]} arr\n * @param {Function} fn\n * @return {number[]}\n */\nvar map = function (arr, fn) {\n arr = ar"
},
{
"path": "JavaScript/2636-promise-pool.js",
"chars": 850,
"preview": "/**\n * @param {Function[]} functions\n * @param {number} n\n * @return {Promise<any>}\n */\nvar promisePool = async function"
},
{
"path": "JavaScript/2637-promise-time-limit.js",
"chars": 512,
"preview": "/**\n * @param {Function} fn\n * @param {number} t\n * @return {Function}\n */\nvar timeLimit = function (fn, t) {\n return a"
},
{
"path": "JavaScript/2665-counter-ii.js",
"chars": 266,
"preview": "var createCounter = function (init) {\n const original_number = init;\n return {\n increment: () => {\n return ++i"
},
{
"path": "JavaScript/2666-allow-one-function-call.js",
"chars": 384,
"preview": "/**\n * @param {Function} fn\n * @return {Function}\n */\nvar once = function (fn) {\n let first = false;\n return function "
},
{
"path": "JavaScript/2667-create-hello-world-function.js",
"chars": 99,
"preview": "var createHelloWorld = function () {\n return function (...args) {\n return \"Hello World\"\n };\n};"
},
{
"path": "JavaScript/2676-throttle.js",
"chars": 523,
"preview": "/**\n * @param {Function} fn\n * @param {number} t\n * @return {Function}\n */\nvar throttle = function (fn, t) {\n let timeO"
},
{
"path": "JavaScript/2677-chunk-array.js",
"chars": 369,
"preview": "/**\n * @param {Array} arr\n * @param {number} size\n * @return {Array[]}\n */\nvar chunk = function (arr, size) {\n return a"
},
{
"path": "JavaScript/2694-event-emitter.js",
"chars": 916,
"preview": "class EventEmitter {\n constructor() {\n this.events = {};\n }\n\n subscribe(event, cb) {\n this.events[event] = this"
},
{
"path": "JavaScript/2695-array-wrapper.js",
"chars": 468,
"preview": "/**\n * @param {number[]} nums\n */\nvar ArrayWrapper = function (nums) {\n this.nums = nums;\n};\n\nArrayWrapper.prototype.va"
},
{
"path": "JavaScript/2703-return-length-of-arguments-passed.js",
"chars": 138,
"preview": "/**\n * @return {number}\n */\nvar argumentsLength = function (...args) {\n return args.length;\n};\n\n/**\n * argumentsLength("
},
{
"path": "JavaScript/2704-to-be-or-not-to-be.js",
"chars": 279,
"preview": "var expect = function (val) {\n return {\n toBe: function (expected) {\n if (expected !== val) throw new Error(\"No"
},
{
"path": "JavaScript/2705-compact-object.js",
"chars": 554,
"preview": "var compactObject = function (obj) {\n function dfs(obj) {\n if (!obj) return;\n if (typeof obj !== \"object\") {\n "
},
{
"path": "JavaScript/2715-execute-cancellable-function-with-delay.js",
"chars": 848,
"preview": "/**\n * @param {Function} fn\n * @param {Array} args\n * @param {number} t\n * @return {Function}\n */\nvar cancellable = func"
},
{
"path": "JavaScript/2721-execute-asynchronous-functions-in-parallel.js",
"chars": 709,
"preview": "/**\n * @param {Array<Function>} functions\n * @return {Promise<any>}\n */\nvar promiseAll = async function (functions) {\n "
},
{
"path": "JavaScript/2722-join-two-arrays-by-id.js",
"chars": 297,
"preview": "/**\n * @param {Array} arr1\n * @param {Array} arr2\n * @return {Array}\n */\nvar join = function (arr1, arr2) {\n const merg"
},
{
"path": "JavaScript/2723-add-two-promises.js",
"chars": 286,
"preview": "/**\n * @param {Promise} promise1\n * @param {Promise} promise2\n * @return {Promise}\n */\nvar addTwoPromises = async functi"
},
{
"path": "JavaScript/2724-sort-by.js",
"chars": 187,
"preview": "/**\n * @param {Array} arr\n * @param {Function} fn\n * @return {Array}\n */\nvar sortBy = function (arr, fn) {\n return arr."
},
{
"path": "JavaScript/2725-interval-cancellation.js",
"chars": 1210,
"preview": "/**\n * @param {Function} fn\n * @param {Array} args\n * @param {number} t\n * @return {Function}\n */\nvar cancellable = func"
},
{
"path": "JavaScript/2726-calculator-with-method-chaining.js",
"chars": 504,
"preview": "class Calculator {\n constructor(value) {\n this.result = value;\n }\n add(value) {\n this.result += value;\n retu"
},
{
"path": "JavaScript/2727-is-object-empty.js",
"chars": 140,
"preview": "/**\n * @param {Object | Array} obj\n * @return {boolean}\n */\nvar isEmpty = function (obj) {\n for ( _ in obj) return fals"
},
{
"path": "LICENSE",
"chars": 1062,
"preview": "MIT License\n\nCopyright (c) 2024 Hogan\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof t"
},
{
"path": "Python/0001-two-sum.py",
"chars": 1476,
"preview": "from typing import List\n\n# brute force\n# time complexity: O(n^2)\n# space complexity: O(1)\n\nclass Solution:\n def twoSu"
},
{
"path": "Python/0002-add-two-numbers.py",
"chars": 719,
"preview": "# time complexity: O(n)\n# space complexity: O(n)\nfrom typing import Optional\n\n\n\nclass Solution:\n def addTwoNumbers(se"
},
{
"path": "Python/0003-longest-substring-without-repeating-characters.py",
"chars": 583,
"preview": "# time complexity: O(n)\n# space complexity: O(min(m,n))\nfrom collections import Counter\n\n\nclass Solution:\n def length"
},
{
"path": "Python/0004-median-of-two-sorted-arrays.py",
"chars": 2485,
"preview": "# time complexity: O(log(min(m, n)))\n# space complexity: O(1)\nfrom typing import List\n\n\nclass Solution:\n def findMedi"
},
{
"path": "Python/0005-longest-palindromic-substring.py",
"chars": 2503,
"preview": "# time complexity: O(n)\n# space complexity: O(n)\n# Manacher's Algorithm\nclass Solution:\n def longestPalindrome(self, "
},
{
"path": "Python/0006-zigzag-conversion.py",
"chars": 693,
"preview": "# time complexity: O(n)\n# space complexity: O(1)\nclass Solution:\n def convert(self, s: str, numRows: int) -> str:\n "
},
{
"path": "Python/0007-reverse-integer.py",
"chars": 500,
"preview": "# time complexity: O(1)\n# space complexity: O(1)\nclass Solution:\n def reverse(self, x: int) -> int:\n strX = st"
},
{
"path": "Python/0008-string-to-integer-atoi.py",
"chars": 821,
"preview": "class Solution:\n def myAtoi(self, s: str) -> int:\n x = \"\"\n y = \"\"\n start = 0\n nums = \"012"
},
{
"path": "Python/0010-regular-expression-matching.py",
"chars": 2163,
"preview": "# time complexity: O((t + p) * 2 ^ (t + p/2))\n# space complexity: O(t^2 + p ^ 2)\nfrom functools import lru_cache\n\n\nclass"
},
{
"path": "Python/0011-container-with-most-water.py",
"chars": 550,
"preview": "# time complexity: O(n)\n# space complexity: O(1)\nfrom typing import List\n\n\nclass Solution:\n def maxArea(self, height:"
},
{
"path": "Python/0012-integer-to-roman.py",
"chars": 554,
"preview": "# time complexity: O(1)\n# space complexity: O(1)\nclass Solution:\n def intToRoman(self, num: int) -> str:\n thou"
},
{
"path": "Python/0013-roman-to-integer.py",
"chars": 724,
"preview": "# time complexity: O(1)\n# space complexity: O(1)\nclass Solution:\n def romanToInt(self, s: str) -> int:\n total "
},
{
"path": "Python/0014-longest-common-prefix.py",
"chars": 1065,
"preview": "# time complexity: O(s+m)\n# space complexity: O(s)\nfrom typing import List\n\n\nclass TrieNode:\n def __init__(self, char"
},
{
"path": "Python/0015-3sum.py",
"chars": 2197,
"preview": "# time complexity: O(n^2)\n# space complexity: O(n)\nfrom typing import List\n\n\nclass Solution:\n def twoSumII(self, i: i"
},
{
"path": "Python/0016-3sum-closest.py",
"chars": 762,
"preview": "# time complexity: O(n^2)\n# space complexity: O(nlogn)\nfrom typing import List\n\n\nclass Solution:\n def threeSumClosest"
},
{
"path": "Python/0017-letter-combinations-of-a-phone-number.py",
"chars": 1112,
"preview": "# time complexity: O(k^n*n)\n# space complexity: O(n)\nfrom typing import List\n\n\nclass Solution:\n def letterCombination"
},
{
"path": "Python/0018-4sum.py",
"chars": 1905,
"preview": "# time complexity: O(n^3)\n# space complexity: O(n)\nfrom typing import List\n\n\nclass Solution:\n def fourSum(self, nums:"
},
{
"path": "Python/0019-remove-nth-node-from-end-of-list.py",
"chars": 800,
"preview": "# time complexity: O(n)\n# space complexity: O(1)\nfrom typing import Optional\n\n\nclass ListNode:\n def __init__(self, va"
},
{
"path": "Python/0020-valid-parentheses.py",
"chars": 1153,
"preview": "# time complexity: O(n)\n# space complexity: O(n)\nclass Solution:\n def isValid(self, s: str) -> bool:\n bracketM"
},
{
"path": "Python/0021-merge-two-sorted-lists.py",
"chars": 674,
"preview": "# Definition for singly-linked list.\nclass ListNode(object):\n def __init__(self, val=0, next=None):\n self.val "
},
{
"path": "Python/0022-generate-parentheses.py",
"chars": 712,
"preview": "# time complexity: O(4^n)\n# space complexity: O(n)\nfrom typing import List\n\n\nclass Solution:\n def generateParenthesis"
},
{
"path": "Python/0023-merge-k-sorted-lists.py",
"chars": 580,
"preview": "# Definition for singly-linked list.\nfrom typing import List, Optional\n\n\nclass ListNode:\n def __init__(self, val=0, n"
},
{
"path": "Python/0024-swap-nodes-in-pairs.py",
"chars": 664,
"preview": "# time complexity: O(n)\n# space complexity: O(n)\nfrom typing import Optional\n\n\nclass ListNode:\n def __init__(self, va"
},
{
"path": "Python/0025-reverse-nodes-in-k-group.py",
"chars": 867,
"preview": "# time complexity: O(n)\n# space complexity: O(1)\nclass ListNode:\n def __init__(self, val=0, next=None):\n self."
},
{
"path": "Python/0026-remove-duplicates-from-sorted-array.py",
"chars": 465,
"preview": "# time complexity: O(n)\n# space complexity: O(1)\nfrom typing import List\n\nclass Solution:\n def removeDuplicates(self,"
},
{
"path": "Python/0027-remove-element.py",
"chars": 347,
"preview": "from typing import List\n\n\nclass Solution:\n def removeElement(self, nums: List[int], val: int) -> int:\n index ="
},
{
"path": "Python/0028-find-the-index-of-the-first-occurrence-in-a-string.py",
"chars": 301,
"preview": "# time complexity: O(n)\n# space complexity: O(1)\nclass Solution:\n def strStr(self, haystack: str, needle: str) -> int"
},
{
"path": "Python/0029-divide-two-integers.py",
"chars": 630,
"preview": "# time complexity: O(1)\n# space complexity: O(1)\n\nclass Solution:\n def divide(self, dividend: int, divisor: int) -> i"
},
{
"path": "Python/0030-substring-with-concatenation-of-all-words.py",
"chars": 1593,
"preview": "# time complexity: O(a + n*b)\n# space complexity: O(a + b)\nfrom collections import Counter, defaultdict\nfrom typing impo"
},
{
"path": "Python/0031-next-permutation.py",
"chars": 1208,
"preview": "# time complexity: O(n^2)\n# space complexity: O(1)\nfrom typing import List\n\n\nclass Solution:\n def nextPermutation(sel"
},
{
"path": "Python/0032-longest-valid-parentheses.py",
"chars": 544,
"preview": "# time complexity; O(n)\n# space complexity: O(n)\nclass Solution:\n def longestValidParentheses(self, s: str) -> int:\n "
},
{
"path": "Python/0033-search-in-rotated-sorted-array.py",
"chars": 931,
"preview": "# time complexity: O(logn)\n# space complexity: O(1)\nfrom typing import List\n\n\nclass Solution:\n def search(self, nums:"
},
{
"path": "Python/0034-find-first-and-last-position-of-element-in-sorted-array.py",
"chars": 2551,
"preview": "# time complexity: O(logn)\n# space complexity: O(1)\nfrom bisect import bisect\nfrom typing import List\n\n\nclass Solution:\n"
},
{
"path": "Python/0035-search-insert-position.py",
"chars": 549,
"preview": "# time complexity: O(logn)\n# space complexity: O(1)\nfrom typing import List\n\n\nclass Solution:\n def searchInsert(self,"
},
{
"path": "Python/0036-valid-sudoku.py",
"chars": 2096,
"preview": "# time complexity: O(n^2) -> O(1)\n# space complexity: O(n^2) -> O(1)\nfrom typing import List\n\n\nclass Solution:\n def i"
},
{
"path": "Python/0037-sudoku-solver.py",
"chars": 2142,
"preview": "# time complexity: O(9!^9)\n# space complexity: O(1)\nfrom collections import defaultdict\nfrom typing import List\n\n\nclass "
},
{
"path": "Python/0038-count-and-say.py",
"chars": 940,
"preview": "# time compexity: O(2^n)\n# space complexity: O(n)\nfrom collections import defaultdict\nfrom functools import lru_cache\n\n\n"
},
{
"path": "Python/0039-combination-sum.py",
"chars": 1566,
"preview": "# time complexity: O(n^(t/m) + 1)\n# space complexity: O(t/m)\nfrom typing import List\n\n# Backtrack\nclass Solution:\n de"
},
{
"path": "Python/0040-combination-sum-ii.py",
"chars": 968,
"preview": "# time complexity: O(2^n)\n# space complexity: O(n)\nfrom typing import List\n\n\nclass Solution:\n def combinationSum2(sel"
},
{
"path": "Python/0041-first-missing-positive.py",
"chars": 709,
"preview": "# time complexity: O(n)\n# space complexity: O(1)\nfrom typing import List\n\n\nclass Solution:\n def firstMissingPositive("
},
{
"path": "Python/0042-trapping-rain-water.py",
"chars": 794,
"preview": "# time complexity: O(n)\n# space complexity: O(1)\nfrom typing import List\n\n\nclass Solution:\n def trap(self, height: Li"
},
{
"path": "Python/0043-multiply-strings.py",
"chars": 924,
"preview": "# time complexity: O(m*n)\n# space complexity: O(m+n)\nclass Solution:\n def multiply(self, num1: str, num2: str) -> str"
},
{
"path": "Python/0044-wildcard-matching.py",
"chars": 3054,
"preview": "# time complexity: O(s * p * (s + p))\n# space complexity: O(s * p)\nclass Solution:\n def isMatch(self, s: str, p: str)"
},
{
"path": "Python/0045-jump-game-ii.py",
"chars": 2551,
"preview": "from typing import List\n\n# Backtracking\n# O(2^n) - Times out\nclass Solution:\n def jump(self, nums: List[int]) -> int:"
},
{
"path": "Python/0046-permutations.py",
"chars": 1265,
"preview": "# time complexity: O(n*n!)\n# space complexity: O(n)\nfrom itertools import permutations\nfrom typing import List\n\n\nclass S"
},
{
"path": "Python/0047-permutations-ii.py",
"chars": 1063,
"preview": "# time complexity: O(sigma*P(n,k))\n# space complexity: O(n)\nfrom collections import Counter\nfrom itertools import permut"
},
{
"path": "Python/0048-rotate-image.py",
"chars": 1616,
"preview": "from typing import List\n\n# time complexity: O(n^2)\n# space complexity: O(n^2)\nclass Solution:\n def rotate(self, matri"
},
{
"path": "Python/0049-group-anagrams.py",
"chars": 947,
"preview": "# time complexity: O(nklogn)\n# space complexity: O(nk)\nfrom collections import defaultdict\nfrom typing import List\n\n\ncla"
},
{
"path": "Python/0050-powx-n.py",
"chars": 1099,
"preview": "# time complexity: O(logn)\n# space complexity: O(logn)\nfrom functools import lru_cache\n\n\nclass Solution:\n def myPow(s"
},
{
"path": "Python/0051-n-queens.py",
"chars": 994,
"preview": "# time complexity: O(n!)\n# space complexity: O(n^2)\nfrom typing import List\n\n\nclass Solution:\n def solveNQueens(self,"
},
{
"path": "Python/0052-n-queens-ii.py",
"chars": 1372,
"preview": "# time complexity: O(n!)\n# space complexity: O(n)\nfrom typing import List\n\n\nclass Solution:\n def totalNQueens(self, n"
},
{
"path": "Python/0053-maximum-subarray.py",
"chars": 1463,
"preview": "# time complexity: O(n)\n# space complexity: O(1)\nfrom typing import List\n\n\nclass Solution:\n def maxSubArray(self, num"
},
{
"path": "Python/0054-spiral-matrix.py",
"chars": 821,
"preview": "# time complexity: O(m*n)\n# space complexity: O(1)\nfrom typing import List\n\n\nclass Solution:\n def spiralOrder(self, m"
},
{
"path": "Python/0055-jump-game.py",
"chars": 941,
"preview": "# time complexity: O(n)\n# space complexity: O(1)\nfrom typing import List\n\n\nclass Solution:\n def canJump(self, nums: L"
},
{
"path": "Python/0056-merge-intervals.py",
"chars": 981,
"preview": "# time complexity: O(nlogn)\n# space complexity: O(n)\nfrom typing import List\n\n\nclass Solution:\n def merge(self, inter"
},
{
"path": "Python/0057-insert-interval.py",
"chars": 1711,
"preview": "# time complexity: O(n)\n# space complexity: O(n)\nfrom typing import List\n\n\nclass Solution:\n def insert(self, interval"
},
{
"path": "Python/0058-length-of-last-word.py",
"chars": 249,
"preview": "class Solution:\n def lengthOfLastWord(self, s: str) -> int:\n filteredList = [item for item in list(s.split(\" \""
}
]
// ... and 3635 more files (download for full content)
About this extraction
This page contains the full source code of the hogan-tech/leetcode-solution GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 3835 files (6.3 MB), approximately 1.9M tokens, and a symbol index with 5055 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.