├── 0002-add-two-numbers ├── 0002-add-two-numbers.cpp ├── NOTES.md └── README.md ├── 0003-longest-substring-without-repeating-characters ├── 0003-longest-substring-without-repeating-characters.cpp ├── NOTES.md └── README.md ├── 0004-median-of-two-sorted-arrays ├── 0004-median-of-two-sorted-arrays.cpp ├── NOTES.md └── README.md ├── 0010-regular-expression-matching ├── 0010-regular-expression-matching.cpp ├── NOTES.md └── README.md ├── 0011-container-with-most-water ├── 0011-container-with-most-water.cpp ├── NOTES.md └── README.md ├── 0015-3sum ├── 0015-3sum.cpp ├── NOTES.md └── README.md ├── 0017-letter-combinations-of-a-phone-number ├── 0017-letter-combinations-of-a-phone-number.cpp ├── NOTES.md └── README.md ├── 0019-remove-nth-node-from-end-of-list ├── 0019-remove-nth-node-from-end-of-list.cpp └── README.md ├── 0024-swap-nodes-in-pairs ├── 0024-swap-nodes-in-pairs.cpp ├── NOTES.md └── README.md ├── 0026-remove-duplicates-from-sorted-array ├── 0026-remove-duplicates-from-sorted-array.cpp ├── NOTES.md └── README.md ├── 0028-find-the-index-of-the-first-occurrence-in-a-string ├── 0028-find-the-index-of-the-first-occurrence-in-a-string.cpp ├── NOTES.md └── README.md ├── 0030-substring-with-concatenation-of-all-words ├── 0030-substring-with-concatenation-of-all-words.cpp ├── NOTES.md └── README.md ├── 0034-find-first-and-last-position-of-element-in-sorted-array ├── 0034-find-first-and-last-position-of-element-in-sorted-array.cpp ├── NOTES.md └── README.md ├── 0041-first-missing-positive ├── 0041-first-missing-positive.cpp ├── NOTES.md └── README.md ├── 0046-permutations ├── 0046-permutations.cpp ├── NOTES.md └── README.md ├── 0048-rotate-image ├── 0048-rotate-image.cpp ├── NOTES.md └── README.md ├── 0050-powx-n ├── 0050-powx-n.cpp ├── NOTES.md └── README.md ├── 0051-n-queens ├── 0051-n-queens.cpp ├── NOTES.md └── README.md ├── 0057-insert-interval ├── 0057-insert-interval.cpp └── README.md ├── 0058-length-of-last-word ├── 0058-length-of-last-word.cpp ├── NOTES.md └── README.md ├── 0059-spiral-matrix-ii ├── 0059-spiral-matrix-ii.cpp ├── NOTES.md └── README.md ├── 0060-permutation-sequence ├── 0060-permutation-sequence.cpp ├── NOTES.md └── README.md ├── 0062-unique-paths ├── 0062-unique-paths.cpp ├── NOTES.md └── README.md ├── 0063-unique-paths-ii ├── 0063-unique-paths-ii.cpp ├── NOTES.md └── README.md ├── 0064-minimum-path-sum ├── 0064-minimum-path-sum.cpp ├── NOTES.md └── README.md ├── 0068-text-justification ├── 0068-text-justification.cpp ├── NOTES.md └── README.md ├── 0070-climbing-stairs ├── 0070-climbing-stairs.cpp ├── NOTES.md └── README.md ├── 0071-simplify-path ├── 0071-simplify-path.cpp ├── NOTES.md └── README.md ├── 0072-edit-distance ├── 0072-edit-distance.cpp ├── NOTES.md └── README.md ├── 0073-set-matrix-zeroes ├── 0073-set-matrix-zeroes.cpp ├── NOTES.md └── README.md ├── 0074-search-a-2d-matrix ├── 0074-search-a-2d-matrix.cpp ├── NOTES.md └── README.md ├── 0076-minimum-window-substring ├── 0076-minimum-window-substring.cpp ├── NOTES.md └── README.md ├── 0078-subsets ├── 0078-subsets.cpp ├── NOTES.md └── README.md ├── 0079-word-search ├── 0079-word-search.cpp ├── NOTES.md └── README.md ├── 0086-partition-list ├── 0086-partition-list.cpp ├── NOTES.md └── README.md ├── 0088-merge-sorted-array ├── 0088-merge-sorted-array.cpp ├── NOTES.md └── README.md ├── 0091-decode-ways ├── 0091-decode-ways.cpp ├── NOTES.md └── README.md ├── 0095-unique-binary-search-trees-ii ├── 0095-unique-binary-search-trees-ii.cpp ├── NOTES.md └── README.md ├── 0097-interleaving-string ├── 0097-interleaving-string.cpp ├── NOTES.md └── README.md ├── 0098-validate-binary-search-tree ├── 0098-validate-binary-search-tree.cpp ├── NOTES.md └── README.md ├── 0100-same-tree ├── 0100-same-tree.cpp ├── NOTES.md └── README.md ├── 0102-binary-tree-level-order-traversal ├── 0102-binary-tree-level-order-traversal.cpp ├── NOTES.md └── README.md ├── 0103-binary-tree-zigzag-level-order-traversal ├── 0103-binary-tree-zigzag-level-order-traversal.cpp ├── NOTES.md └── README.md ├── 0107-binary-tree-level-order-traversal-ii ├── 0107-binary-tree-level-order-traversal-ii.cpp ├── NOTES.md └── README.md ├── 0110-balanced-binary-tree ├── 0110-balanced-binary-tree.cpp ├── NOTES.md └── README.md ├── 0111-minimum-depth-of-binary-tree ├── 0111-minimum-depth-of-binary-tree.cpp ├── NOTES.md └── README.md ├── 0118-pascals-triangle ├── 0118-pascals-triangle.cpp ├── NOTES.md └── README.md ├── 0121-best-time-to-buy-and-sell-stock ├── 0121-best-time-to-buy-and-sell-stock.cpp ├── NOTES.md └── README.md ├── 0124-binary-tree-maximum-path-sum ├── 0124-binary-tree-maximum-path-sum.cpp ├── NOTES.md └── README.md ├── 0129-sum-root-to-leaf-numbers ├── 0129-sum-root-to-leaf-numbers.cpp └── README.md ├── 0131-palindrome-partitioning ├── 0131-palindrome-partitioning.cpp ├── NOTES.md └── README.md ├── 0135-candy ├── 0135-candy.cpp ├── NOTES.md └── README.md ├── 0137-single-number-ii ├── 0137-single-number-ii.cpp ├── NOTES.md └── README.md ├── 0138-copy-list-with-random-pointer ├── 0138-copy-list-with-random-pointer.cpp ├── NOTES.md └── README.md ├── 0140-word-break-ii ├── 0140-word-break-ii.cpp ├── NOTES.md └── README.md ├── 0141-linked-list-cycle ├── 0141-linked-list-cycle.cpp ├── NOTES.md └── README.md ├── 0143-reorder-list ├── 0143-reorder-list.cpp ├── NOTES.md └── README.md ├── 0146-lru-cache ├── 0146-lru-cache.cpp ├── NOTES.md └── README.md ├── 0149-max-points-on-a-line ├── 0149-max-points-on-a-line.cpp ├── NOTES.md └── README.md ├── 0151-reverse-words-in-a-string ├── 0151-reverse-words-in-a-string.cpp ├── NOTES.md └── README.md ├── 0165-compare-version-numbers ├── 0165-compare-version-numbers.cpp ├── NOTES.md └── README.md ├── 0178-rank-scores ├── 0178-rank-scores.sql ├── NOTES.md └── README.md ├── 0179-largest-number ├── 0179-largest-number.cpp ├── NOTES.md └── README.md ├── 0180-consecutive-numbers ├── 0180-consecutive-numbers.sql ├── NOTES.md └── README.md ├── 0184-department-highest-salary ├── 0184-department-highest-salary.sql ├── NOTES.md └── README.md ├── 0185-department-top-three-salaries ├── 0185-department-top-three-salaries.sql ├── NOTES.md └── README.md ├── 0188-best-time-to-buy-and-sell-stock-iv ├── 0188-best-time-to-buy-and-sell-stock-iv.cpp ├── NOTES.md └── README.md ├── 0190-reverse-bits ├── 0190-reverse-bits.cpp ├── NOTES.md └── README.md ├── 0191-number-of-1-bits ├── 0191-number-of-1-bits.cpp ├── NOTES.md └── README.md ├── 0198-house-robber ├── 0198-house-robber.cpp ├── NOTES.md └── README.md ├── 0200-number-of-islands ├── 0200-number-of-islands.cpp ├── NOTES.md └── README.md ├── 0204-count-primes ├── 0204-count-primes.cpp ├── NOTES.md └── README.md ├── 0205-isomorphic-strings ├── NOTES.md └── README.md ├── 0207-course-schedule ├── 0207-course-schedule.cpp ├── NOTES.md └── README.md ├── 0209-minimum-size-subarray-sum ├── 0209-minimum-size-subarray-sum.cpp ├── NOTES.md └── README.md ├── 0212-word-search-ii ├── 0212-word-search-ii.cpp ├── NOTES.md └── README.md ├── 0215-kth-largest-element-in-an-array ├── 0215-kth-largest-element-in-an-array.cpp ├── NOTES.md └── README.md ├── 0222-count-complete-tree-nodes ├── 0222-count-complete-tree-nodes.cpp ├── NOTES.md └── README.md ├── 0223-rectangle-area ├── 0223-rectangle-area.cpp ├── NOTES.md └── README.md ├── 0225-implement-stack-using-queues ├── 0225-implement-stack-using-queues.cpp ├── NOTES.md └── README.md ├── 0228-summary-ranges ├── 0228-summary-ranges.cpp └── README.md ├── 0229-majority-element-ii ├── 0229-majority-element-ii.cpp ├── NOTES.md └── README.md ├── 0230-kth-smallest-element-in-a-bst ├── 0230-kth-smallest-element-in-a-bst.cpp ├── NOTES.md └── README.md ├── 0231-power-of-two ├── 0231-power-of-two.cpp ├── NOTES.md └── README.md ├── 0234-palindrome-linked-list ├── 0234-palindrome-linked-list.cpp ├── NOTES.md └── README.md ├── 0235-lowest-common-ancestor-of-a-binary-search-tree ├── 0235-lowest-common-ancestor-of-a-binary-search-tree.cpp ├── NOTES.md └── README.md ├── 0236-lowest-common-ancestor-of-a-binary-tree ├── 0236-lowest-common-ancestor-of-a-binary-tree.cpp ├── NOTES.md └── README.md ├── 0237-delete-node-in-a-linked-list ├── 0237-delete-node-in-a-linked-list.cpp ├── NOTES.md └── README.md ├── 0238-product-of-array-except-self ├── 0238-product-of-array-except-self.cpp ├── NOTES.md └── README.md ├── 0241-different-ways-to-add-parentheses ├── 0241-different-ways-to-add-parentheses.cpp ├── NOTES.md └── README.md ├── 0242-valid-anagram ├── 0242-valid-anagram.cpp ├── 0242-valid-anagram.java ├── NOTES.md └── README.md ├── 0258-add-digits ├── 0258-add-digits.cpp ├── NOTES.md └── README.md ├── 0260-single-number-iii ├── 0260-single-number-iii.cpp ├── NOTES.md └── README.md ├── 0263-ugly-number ├── 0263-ugly-number.cpp ├── NOTES.md └── README.md ├── 0279-perfect-squares ├── 0279-perfect-squares.cpp ├── NOTES.md └── README.md ├── 0287-find-the-duplicate-number ├── 0287-find-the-duplicate-number.cpp ├── NOTES.md └── README.md ├── 0295-find-median-from-data-stream ├── 0295-find-median-from-data-stream.cpp ├── NOTES.md └── README.md ├── 0300-longest-increasing-subsequence ├── 0300-longest-increasing-subsequence.cpp ├── NOTES.md └── README.md ├── 0310-minimum-height-trees ├── 0310-minimum-height-trees.cpp ├── NOTES.md └── README.md ├── 0319-bulb-switcher ├── 0319-bulb-switcher.cpp ├── NOTES.md └── README.md ├── 0326-power-of-three ├── 0326-power-of-three.cpp ├── NOTES.md └── README.md ├── 0327-count-of-range-sum ├── 0327-count-of-range-sum.cpp ├── NOTES.md └── README.md ├── 0329-longest-increasing-path-in-a-matrix ├── 0329-longest-increasing-path-in-a-matrix.cpp ├── NOTES.md └── README.md ├── 0330-patching-array ├── 0330-patching-array.cpp └── README.md ├── 0332-reconstruct-itinerary ├── 0332-reconstruct-itinerary.cpp └── README.md ├── 0335-self-crossing ├── 0335-self-crossing.cpp ├── NOTES.md └── README.md ├── 0338-counting-bits ├── 0338-counting-bits.cpp ├── NOTES.md └── README.md ├── 0342-power-of-four ├── 0342-power-of-four.cpp ├── NOTES.md └── README.md ├── 0343-integer-break ├── 0343-integer-break.cpp ├── NOTES.md └── README.md ├── 0344-reverse-string ├── 0344-reverse-string.cpp ├── NOTES.md └── README.md ├── 0345-reverse-vowels-of-a-string ├── 0345-reverse-vowels-of-a-string.cpp ├── NOTES.md └── README.md ├── 0347-top-k-frequent-elements ├── 0347-top-k-frequent-elements.cpp ├── NOTES.md └── README.md ├── 0373-find-k-pairs-with-smallest-sums ├── 0373-find-k-pairs-with-smallest-sums.cpp ├── NOTES.md └── README.md ├── 0374-guess-number-higher-or-lower ├── 0374-guess-number-higher-or-lower.cpp └── README.md ├── 0377-combination-sum-iv ├── 0377-combination-sum-iv.cpp ├── NOTES.md └── README.md ├── 0389-find-the-difference ├── 0389-find-the-difference.cpp ├── NOTES.md └── README.md ├── 0392-is-subsequence ├── 0392-is-subsequence.cpp ├── NOTES.md └── README.md ├── 0399-evaluate-division ├── 0399-evaluate-division.cpp ├── NOTES.md └── README.md ├── 0402-remove-k-digits ├── 0402-remove-k-digits.cpp ├── NOTES.md └── README.md ├── 0403-frog-jump ├── 0403-frog-jump.cpp ├── NOTES.md └── README.md ├── 0404-sum-of-left-leaves ├── 0404-sum-of-left-leaves.cpp └── NOTES.md ├── 0405-convert-a-number-to-hexadecimal ├── 0405-convert-a-number-to-hexadecimal.cpp ├── NOTES.md └── README.md ├── 0409-longest-palindrome ├── 0409-longest-palindrome.cpp ├── NOTES.md └── README.md ├── 0433-minimum-genetic-mutation ├── 0433-minimum-genetic-mutation.cpp ├── NOTES.md └── README.md ├── 0435-non-overlapping-intervals ├── 0435-non-overlapping-intervals.cpp ├── NOTES.md └── README.md ├── 0442-find-all-duplicates-in-an-array ├── 0442-find-all-duplicates-in-an-array.cpp ├── NOTES.md └── README.md ├── 0445-add-two-numbers-ii ├── 0445-add-two-numbers-ii.cpp ├── NOTES.md └── README.md ├── 0446-arithmetic-slices-ii-subsequence ├── 0446-arithmetic-slices-ii-subsequence.cpp ├── NOTES.md └── README.md ├── 0450-delete-node-in-a-bst ├── 0450-delete-node-in-a-bst.cpp ├── NOTES.md └── README.md ├── 0452-minimum-number-of-arrows-to-burst-balloons ├── 0452-minimum-number-of-arrows-to-burst-balloons.cpp ├── NOTES.md └── README.md ├── 0455-assign-cookies ├── 0455-assign-cookies.cpp ├── NOTES.md └── README.md ├── 0456-132-pattern ├── 0456-132-pattern.cpp ├── NOTES.md └── README.md ├── 0459-repeated-substring-pattern ├── 0459-repeated-substring-pattern.cpp ├── NOTES.md └── README.md ├── 0486-predict-the-winner ├── 0486-predict-the-winner.cpp └── README.md ├── 0501-find-mode-in-binary-search-tree ├── 0501-find-mode-in-binary-search-tree.cpp ├── NOTES.md └── README.md ├── 0502-ipo ├── 0502-ipo.cpp └── README.md ├── 0513-find-bottom-left-tree-value ├── 0513-find-bottom-left-tree-value.cpp ├── NOTES.md └── README.md ├── 0515-find-largest-value-in-each-tree-row ├── 0515-find-largest-value-in-each-tree-row.cpp ├── NOTES.md └── README.md ├── 0518-coin-change-ii ├── 0518-coin-change-ii.cpp ├── NOTES.md └── README.md ├── 0525-contiguous-array ├── 0525-contiguous-array.cpp ├── NOTES.md └── README.md ├── 0530-minimum-absolute-difference-in-bst ├── 0530-minimum-absolute-difference-in-bst.cpp ├── NOTES.md └── README.md ├── 0543-diameter-of-binary-tree ├── 0543-diameter-of-binary-tree.cpp ├── NOTES.md └── README.md ├── 0547-number-of-provinces ├── 0547-number-of-provinces.cpp ├── NOTES.md └── README.md ├── 0552-student-attendance-record-ii ├── 0552-student-attendance-record-ii.cpp ├── NOTES.md └── README.md ├── 0557-reverse-words-in-a-string-iii ├── 0557-reverse-words-in-a-string-iii.cpp ├── NOTES.md └── README.md ├── 0577-employee-bonus ├── 0577-employee-bonus.sql ├── NOTES.md └── README.md ├── 0587-erect-the-fence ├── 0587-erect-the-fence.cpp ├── NOTES.md └── README.md ├── 0598-range-addition-ii ├── 0598-range-addition-ii.cpp └── README.md ├── 0605-can-place-flowers ├── 0605-can-place-flowers.cpp ├── NOTES.md └── README.md ├── 0620-not-boring-movies ├── 0620-not-boring-movies.sql ├── NOTES.md └── README.md ├── 0621-task-scheduler ├── 0621-task-scheduler.cpp ├── NOTES.md └── README.md ├── 0623-add-one-row-to-tree ├── 0623-add-one-row-to-tree.cpp ├── NOTES.md └── README.md ├── 0633-sum-of-square-numbers ├── 0633-sum-of-square-numbers.cpp ├── NOTES.md └── README.md ├── 0637-average-of-levels-in-binary-tree ├── 0637-average-of-levels-in-binary-tree.cpp ├── NOTES.md └── README.md ├── 0646-maximum-length-of-pair-chain ├── 0646-maximum-length-of-pair-chain.cpp └── README.md ├── 0649-dota2-senate ├── 0649-dota2-senate.cpp ├── NOTES.md └── README.md ├── 0661-image-smoother ├── 0661-image-smoother.cpp ├── NOTES.md └── README.md ├── 0664-strange-printer ├── 0664-strange-printer.cpp ├── NOTES.md └── README.md ├── 0670-maximum-swap ├── 0670-maximum-swap.cpp ├── NOTES.md └── README.md ├── 0673-number-of-longest-increasing-subsequence ├── 0673-number-of-longest-increasing-subsequence.cpp ├── NOTES.md └── README.md ├── 0684-redundant-connection ├── 0684-redundant-connection.cpp ├── NOTES.md └── README.md ├── 0686-repeated-string-match ├── 0686-repeated-string-match.cpp ├── NOTES.md └── README.md ├── 0688-knight-probability-in-chessboard ├── 0688-knight-probability-in-chessboard.cpp ├── NOTES.md └── README.md ├── 0690-employee-importance ├── 0690-employee-importance.cpp ├── NOTES.md └── README.md ├── 0695-max-area-of-island ├── 0695-max-area-of-island.cpp ├── NOTES.md └── README.md ├── 0697-degree-of-an-array ├── 0697-degree-of-an-array.cpp ├── NOTES.md └── README.md ├── 0703-kth-largest-element-in-a-stream ├── 0703-kth-largest-element-in-a-stream.cpp ├── NOTES.md └── README.md ├── 0705-design-hashset ├── 0705-design-hashset.cpp ├── NOTES.md └── README.md ├── 0712-minimum-ascii-delete-sum-for-two-strings ├── NOTES.md └── README.md ├── 0713-subarray-product-less-than-k ├── 0713-subarray-product-less-than-k.cpp ├── NOTES.md └── README.md ├── 0714-best-time-to-buy-and-sell-stock-with-transaction-fee ├── 0714-best-time-to-buy-and-sell-stock-with-transaction-fee.cpp ├── NOTES.md └── README.md ├── 0726-number-of-atoms ├── 0726-number-of-atoms.cpp ├── NOTES.md └── README.md ├── 0733-flood-fill ├── 0733-flood-fill.cpp └── README.md ├── 0735-asteroid-collision ├── 0735-asteroid-collision.cpp ├── NOTES.md └── README.md ├── 0744-find-smallest-letter-greater-than-target ├── 0744-find-smallest-letter-greater-than-target.cpp ├── NOTES.md └── README.md ├── 0746-min-cost-climbing-stairs ├── 0746-min-cost-climbing-stairs.cpp ├── NOTES.md └── README.md ├── 0747-largest-number-at-least-twice-of-others ├── 0747-largest-number-at-least-twice-of-others.cpp ├── NOTES.md └── README.md ├── 0768-max-chunks-to-make-sorted-ii ├── 0768-max-chunks-to-make-sorted-ii.cpp ├── NOTES.md └── README.md ├── 0778-swim-in-rising-water ├── 0778-swim-in-rising-water.cpp ├── NOTES.md └── README.md ├── 0779-k-th-symbol-in-grammar ├── 0779-k-th-symbol-in-grammar.cpp ├── NOTES.md └── README.md ├── 0785-is-graph-bipartite ├── 0785-is-graph-bipartite.cpp ├── NOTES.md └── README.md ├── 0787-cheapest-flights-within-k-stops ├── 0787-cheapest-flights-within-k-stops.cpp ├── NOTES.md └── README.md ├── 0791-custom-sort-string ├── 0791-custom-sort-string.cpp ├── NOTES.md └── README.md ├── 0797-all-paths-from-source-to-target ├── 0797-all-paths-from-source-to-target.cpp ├── NOTES.md └── README.md ├── 0799-champagne-tower ├── 0799-champagne-tower.cpp ├── NOTES.md └── README.md ├── 0802-find-eventual-safe-states ├── 0802-find-eventual-safe-states.cpp ├── NOTES.md └── README.md ├── 0808-soup-servings ├── 0808-soup-servings.cpp ├── NOTES.md └── README.md ├── 0826-most-profit-assigning-work ├── 0826-most-profit-assigning-work.cpp └── README.md ├── 0837-new-21-game ├── NOTES.md └── README.md ├── 0839-similar-string-groups ├── 0839-similar-string-groups.cpp ├── NOTES.md └── README.md ├── 0841-keys-and-rooms ├── 0841-keys-and-rooms.cpp ├── NOTES.md └── README.md ├── 0844-backspace-string-compare ├── 0844-backspace-string-compare.cpp ├── NOTES.md └── README.md ├── 0847-shortest-path-visiting-all-nodes ├── 0847-shortest-path-visiting-all-nodes.cpp ├── NOTES.md └── README.md ├── 0848-shifting-letters ├── 0848-shifting-letters.cpp ├── NOTES.md └── README.md ├── 0850-rectangle-area-ii ├── 0850-rectangle-area-ii.cpp ├── NOTES.md └── README.md ├── 0852-peak-index-in-a-mountain-array ├── 0852-peak-index-in-a-mountain-array.cpp ├── NOTES.md └── README.md ├── 0859-buddy-strings ├── 0859-buddy-strings.cpp ├── NOTES.md └── README.md ├── 0863-all-nodes-distance-k-in-binary-tree ├── 0863-all-nodes-distance-k-in-binary-tree.cpp ├── NOTES.md └── README.md ├── 0864-shortest-path-to-get-all-keys ├── 0864-shortest-path-to-get-all-keys.cpp ├── NOTES.md └── README.md ├── 0876-middle-of-the-linked-list ├── 0876-middle-of-the-linked-list.cpp ├── NOTES.md └── README.md ├── 0879-profitable-schemes ├── 0879-profitable-schemes.cpp ├── NOTES.md └── README.md ├── 0880-decoded-string-at-index ├── 0880-decoded-string-at-index.cpp ├── NOTES.md └── README.md ├── 0881-boats-to-save-people ├── 0881-boats-to-save-people.cpp ├── NOTES.md └── README.md ├── 0894-all-possible-full-binary-trees ├── 0894-all-possible-full-binary-trees.cpp ├── NOTES.md └── README.md ├── 0896-monotonic-array ├── 0896-monotonic-array.cpp ├── NOTES.md └── README.md ├── 0904-fruit-into-baskets ├── 0904-fruit-into-baskets.cpp ├── NOTES.md └── README.md ├── 0905-sort-array-by-parity ├── 0905-sort-array-by-parity.cpp ├── NOTES.md └── README.md ├── 0920-number-of-music-playlists ├── 0920-number-of-music-playlists.cpp ├── NOTES.md └── README.md ├── 0934-shortest-bridge ├── 0934-shortest-bridge.cpp ├── NOTES.md └── README.md ├── 0945-minimum-increment-to-make-array-unique ├── 0945-minimum-increment-to-make-array-unique.cpp ├── NOTES.md └── README.md ├── 0946-validate-stack-sequences ├── 0946-validate-stack-sequences.cpp ├── NOTES.md └── README.md ├── 0956-tallest-billboard ├── 0956-tallest-billboard.cpp ├── NOTES.md └── README.md ├── 0968-binary-tree-cameras ├── 0968-binary-tree-cameras.cpp ├── NOTES.md └── README.md ├── 0974-subarray-sums-divisible-by-k ├── 0974-subarray-sums-divisible-by-k.cpp ├── NOTES.md └── README.md ├── 0979-distribute-coins-in-binary-tree ├── 0979-distribute-coins-in-binary-tree.cpp ├── NOTES.md └── README.md ├── 0980-unique-paths-iii ├── 0980-unique-paths-iii.cpp ├── NOTES.md └── README.md ├── 0988-smallest-string-starting-from-leaf ├── 0988-smallest-string-starting-from-leaf.scala ├── NOTES.md └── README.md ├── 0992-subarrays-with-k-different-integers ├── 0992-subarrays-with-k-different-integers.cpp ├── NOTES.md └── README.md ├── 0997-find-the-town-judge ├── 0997-find-the-town-judge.cpp └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divamazon-divdiv-classcompanytagscontainer-tagoccurence14-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divexpedia-divdiv-classcompanytagscontainer-tagoccurence7-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divmicrosoft-divdiv-classcompanytagscontainer-tagoccurence7-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divuber-divdiv-classcompanytagscontainer-tagoccurence4-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divgoogle-divdiv-classcompanytagscontainer-tagoccurence4-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divadobe-divdiv-classcompanytagscontainer-tagoccurence3-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divyahoo-divdiv-classcompanytagscontainer-tagoccurence3-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divgoldman-sachs-divdiv-classcompanytagscontainer-tagoccurence2-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divbloomberg-divdiv-classcompanytagscontainer-tagoccurence2-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div70-climbing-stairs ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divamazon-divdiv-classcompanytagscontainer-tagoccurence14-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divexpedia-divdiv-classcompanytagscontainer-tagoccurence7-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divmicrosoft-divdiv-classcompanytagscontainer-tagoccurence7-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divuber-divdiv-classcompanytagscontainer-tagoccurence4-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divgoogle-divdiv-classcompanytagscontainer-tagoccurence4-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divadobe-divdiv-classcompanytagscontainer-tagoccurence3-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divyahoo-divdiv-classcompanytagscontainer-tagoccurence3-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divgoldman-sachs-divdiv-classcompanytagscontainer-tagoccurence2-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divbloomberg-divdiv-classcompanytagscontainer-tagoccurence2-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div70-climbing-stairs.cpp └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divamazon-divdiv-classcompanytagscontainer-tagoccurence8-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divlinkedin-divdiv-classcompanytagscontainer-tagoccurence7-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divmicrosoft-divdiv-classcompanytagscontainer-tagoccurence6-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divgoogle-divdiv-classcompanytagscontainer-tagoccurence4-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divapple-divdiv-classcompanytagscontainer-tagoccurence3-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divbloomberg-divdiv-classcompanytagscontainer-tagoccurence2-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divfacebook-divdiv-classcompanytagscontainer-tagoccurence2-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divrubrik-divdiv-classcompanytagscontainer-tagoccurence2-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div72-edit-distance ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divamazon-divdiv-classcompanytagscontainer-tagoccurence8-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divlinkedin-divdiv-classcompanytagscontainer-tagoccurence7-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divmicrosoft-divdiv-classcompanytagscontainer-tagoccurence6-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divgoogle-divdiv-classcompanytagscontainer-tagoccurence4-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divapple-divdiv-classcompanytagscontainer-tagoccurence3-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divbloomberg-divdiv-classcompanytagscontainer-tagoccurence2-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divfacebook-divdiv-classcompanytagscontainer-tagoccurence2-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divrubrik-divdiv-classcompanytagscontainer-tagoccurence2-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div72-edit-distance.cpp └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divbytedance-divdiv-classcompanytagscontainer-tagoccurence2-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divworks-applications-divdiv-classcompanytagscontainer-tagoccurence1-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div629-k-inverse-pairs-array ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divbytedance-divdiv-classcompanytagscontainer-tagoccurence2-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divworks-applications-divdiv-classcompanytagscontainer-tagoccurence1-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div629-k-inverse-pairs-array.cpp ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divcisco-divdiv-classcompanytagscontainer-tagoccurence3-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div526-beautiful-arrangement ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divcisco-divdiv-classcompanytagscontainer-tagoccurence3-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div526-beautiful-arrangement.cpp ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divgoogle-divdiv-classcompanytagscontainer-tagoccurence1-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div1781-sum-of-beauty-of-all-substrings ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divgoogle-divdiv-classcompanytagscontainer-tagoccurence1-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div1781-sum-of-beauty-of-all-substrings.cpp ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divgoogle-divdiv-classcompanytagscontainer-tagoccurence1-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div1828-queries-on-number-of-points-inside-a-circle ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divgoogle-divdiv-classcompanytagscontainer-tagoccurence2-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div931-minimum-falling-path-sum ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divgoogle-divdiv-classcompanytagscontainer-tagoccurence2-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div931-minimum-falling-path-sum.cpp ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divgoogle-divdiv-classcompanytagscontainer-tagoccurence2-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divmicrosoft-divdiv-classcompanytagscontainer-tagoccurence2-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div684-redundant-connection ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divgoogle-divdiv-classcompanytagscontainer-tagoccurence2-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divmicrosoft-divdiv-classcompanytagscontainer-tagoccurence2-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div684-redundant-connection.cpp ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divkarat-divdiv-classcompanytagscontainer-tagoccurence40-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divindeed-divdiv-classcompanytagscontainer-tagoccurence25-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divwayfair-divdiv-classcompanytagscontainer-tagoccurence9-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divintuit-divdiv-classcompanytagscontainer-tagoccurence2-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divwalmart-global-tech-divdiv-classcompanytagscontainer-tagoccurence2-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div811-subdomain-visit-count ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divkarat-divdiv-classcompanytagscontainer-tagoccurence40-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divindeed-divdiv-classcompanytagscontainer-tagoccurence25-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divwayfair-divdiv-classcompanytagscontainer-tagoccurence9-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divintuit-divdiv-classcompanytagscontainer-tagoccurence2-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divwalmart-global-tech-divdiv-classcompanytagscontainer-tagoccurence2-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div811-subdomain-visit-count.cpp ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondiv-stylesvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div1638-count-substrings-that-differ-by-one-character ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondiv-stylesvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div1638-count-substrings-that-differ-by-one-character.cpp ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div1248-count-number-of-nice-subarrays ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div1248-count-number-of-nice-subarrays.cpp ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div1334-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div1334-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance.cpp ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div1734-decode-xored-permutation ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div1734-decode-xored-permutation.cpp ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div1789-primary-department-for-each-employee ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div1789-primary-department-for-each-employee.sql ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div2196-create-binary-tree-from-descriptions ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div2196-create-binary-tree-from-descriptions.cpp ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div2285-maximum-total-importance-of-roads ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div2285-maximum-total-importance-of-roads.cpp ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div2294-partition-array-such-that-maximum-difference-is-k ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div2294-partition-array-such-that-maximum-difference-is-k.cpp ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div2721-execute-asynchronous-functions-in-parallel ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div2721-execute-asynchronous-functions-in-parallel.js ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div2908-minimum-sum-of-mountain-triplets-i ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div2956-find-common-elements-between-two-arrays ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div2956-find-common-elements-between-two-arrays.cpp ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div3245-alternating-groups-iii ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div3245-alternating-groups-iii.cpp └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div3283-maximum-number-of-moves-to-kill-all-pawns ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div3283-maximum-number-of-moves-to-kill-all-pawns.cpp ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div889-construct-binary-tree-from-preorder-and-postorder-traversal ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div889-construct-binary-tree-from-preorder-and-postorder-traversal.cpp ├── NOTES.md └── README.md ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div919-complete-binary-tree-inserter ├── 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div919-complete-binary-tree-inserter.cpp └── README.md ├── 100-same-tree ├── 100-same-tree.cpp └── README.md ├── 1002-find-common-characters ├── 1002-find-common-characters.cpp ├── NOTES.md └── README.md ├── 10035-maximum-area-of-longest-diagonal-rectangle ├── 10035-maximum-area-of-longest-diagonal-rectangle.cpp ├── NOTES.md └── README.md ├── 1011-capacity-to-ship-packages-within-d-days ├── 1011-capacity-to-ship-packages-within-d-days.cpp ├── NOTES.md └── README.md ├── 1026-maximum-difference-between-node-and-ancestor ├── 1026-maximum-difference-between-node-and-ancestor.cpp ├── NOTES.md └── README.md ├── 1027-longest-arithmetic-subsequence ├── 1027-longest-arithmetic-subsequence.cpp ├── NOTES.md └── README.md ├── 103-binary-tree-zigzag-level-order-traversal ├── 103-binary-tree-zigzag-level-order-traversal.cpp └── README.md ├── 1035-uncrossed-lines ├── 1035-uncrossed-lines.cpp ├── NOTES.md └── README.md ├── 1038-binary-search-tree-to-greater-sum-tree ├── 1038-binary-search-tree-to-greater-sum-tree.cpp └── NOTES.md ├── 104-maximum-depth-of-binary-tree ├── 104-maximum-depth-of-binary-tree.cpp ├── NOTES.md └── README.md ├── 1046-last-stone-weight ├── 1046-last-stone-weight.cpp ├── NOTES.md └── README.md ├── 1047-remove-all-adjacent-duplicates-in-string ├── 1047-remove-all-adjacent-duplicates-in-string.cpp ├── NOTES.md └── README.md ├── 1048-longest-string-chain ├── 1048-longest-string-chain.cpp ├── NOTES.md └── README.md ├── 1051-height-checker ├── 1051-height-checker.cpp ├── NOTES.md └── README.md ├── 1061-lexicographically-smallest-equivalent-string ├── 1061-lexicographically-smallest-equivalent-string.cpp ├── NOTES.md └── README.md ├── 1071-greatest-common-divisor-of-strings ├── 1071-greatest-common-divisor-of-strings.cpp ├── NOTES.md └── README.md ├── 1091-shortest-path-in-binary-matrix └── README.md ├── 1122-relative-sort-array ├── 1122-relative-sort-array.cpp ├── NOTES.md └── README.md ├── 1125-smallest-sufficient-team ├── 1125-smallest-sufficient-team.cpp ├── NOTES.md └── README.md ├── 1129-shortest-path-with-alternating-colors ├── 1129-shortest-path-with-alternating-colors.cpp └── NOTES.md ├── 1130-minimum-cost-tree-from-leaf-values ├── 1130-minimum-cost-tree-from-leaf-values.cpp ├── NOTES.md └── README.md ├── 1137-n-th-tribonacci-number ├── 1137-n-th-tribonacci-number.cpp ├── NOTES.md └── README.md ├── 1140-stone-game-ii ├── NOTES.md └── README.md ├── 1143-longest-common-subsequence ├── 1143-longest-common-subsequence.cpp ├── NOTES.md └── README.md ├── 1146-snapshot-array ├── 1146-snapshot-array.cpp ├── NOTES.md └── README.md ├── 116-populating-next-right-pointers-in-each-node ├── 116-populating-next-right-pointers-in-each-node.cpp ├── NOTES.md └── README.md ├── 1160-find-words-that-can-be-formed-by-characters ├── 1160-find-words-that-can-be-formed-by-characters.cpp ├── NOTES.md └── README.md ├── 1161-maximum-level-sum-of-a-binary-tree ├── 1161-maximum-level-sum-of-a-binary-tree.cpp ├── NOTES.md └── README.md ├── 1171-remove-zero-sum-consecutive-nodes-from-linked-list ├── 1171-remove-zero-sum-consecutive-nodes-from-linked-list.cpp ├── NOTES.md └── README.md ├── 1175-prime-arrangements ├── 1175-prime-arrangements.cpp ├── NOTES.md └── README.md ├── 1179-reformat-department-table ├── 1179-reformat-department-table.sql ├── NOTES.md └── README.md ├── 1187-make-array-strictly-increasing ├── 1187-make-array-strictly-increasing.cpp ├── NOTES.md └── README.md ├── 1203-sort-items-by-groups-respecting-dependencies ├── 1203-sort-items-by-groups-respecting-dependencies.cpp ├── NOTES.md └── README.md ├── 1208-get-equal-substrings-within-budget ├── 1208-get-equal-substrings-within-budget.cpp ├── NOTES.md └── README.md ├── 121-best-time-to-buy-and-sell-stock ├── 121-best-time-to-buy-and-sell-stock.cpp ├── NOTES.md └── README.md ├── 1218-longest-arithmetic-subsequence-of-given-difference ├── 1218-longest-arithmetic-subsequence-of-given-difference.cpp ├── NOTES.md └── README.md ├── 1219-path-with-maximum-gold ├── 1219-path-with-maximum-gold.cpp ├── NOTES.md └── README.md ├── 1226-the-dining-philosophers ├── 1226-the-dining-philosophers.cpp └── README.md ├── 123-best-time-to-buy-and-sell-stock-iii ├── 123-best-time-to-buy-and-sell-stock-iii.cpp ├── NOTES.md └── README.md ├── 1232-check-if-it-is-a-straight-line ├── 1232-check-if-it-is-a-straight-line.cpp ├── NOTES.md └── README.md ├── 1235-maximum-profit-in-job-scheduling ├── 1235-maximum-profit-in-job-scheduling.cpp └── README.md ├── 124-binary-tree-maximum-path-sum ├── 124-binary-tree-maximum-path-sum.cpp └── README.md ├── 1249-minimum-remove-to-make-valid-parentheses ├── 1249-minimum-remove-to-make-valid-parentheses.cpp ├── NOTES.md └── README.md ├── 1254-number-of-closed-islands ├── 1254-number-of-closed-islands.cpp ├── NOTES.md └── README.md ├── 1255-maximum-score-words-formed-by-letters ├── 1255-maximum-score-words-formed-by-letters.cpp ├── NOTES.md └── README.md ├── 1266-minimum-time-visiting-all-points ├── 1266-minimum-time-visiting-all-points.cpp ├── NOTES.md └── README.md ├── 1269-number-of-ways-to-stay-in-the-same-place-after-some-steps ├── NOTES.md └── README.md ├── 127-word-ladder ├── 127-word-ladder.cpp └── NOTES.md ├── 1282-group-the-people-given-the-group-size-they-belong-to ├── 1282-group-the-people-given-the-group-size-they-belong-to.cpp ├── NOTES.md └── README.md ├── 1289-minimum-falling-path-sum-ii ├── 1289-minimum-falling-path-sum-ii.cpp ├── NOTES.md └── README.md ├── 1301-number-of-paths-with-max-score ├── 1301-number-of-paths-with-max-score.cpp ├── NOTES.md └── README.md ├── 131-palindrome-partitioning └── NOTES.md ├── 1312-minimum-insertion-steps-to-make-a-string-palindrome ├── 1312-minimum-insertion-steps-to-make-a-string-palindrome.cpp ├── NOTES.md └── README.md ├── 1317-convert-integer-to-the-sum-of-two-no-zero-integers ├── 1317-convert-integer-to-the-sum-of-two-no-zero-integers.cpp ├── NOTES.md └── README.md ├── 1319-number-of-operations-to-make-network-connected ├── 1319-number-of-operations-to-make-network-connected.cpp ├── NOTES.md └── README.md ├── 1323-maximum-69-number ├── 1323-maximum-69-number.cpp ├── NOTES.md └── README.md ├── 1325-delete-leaves-with-a-given-value ├── 1325-delete-leaves-with-a-given-value.cpp ├── NOTES.md └── README.md ├── 1335-minimum-difficulty-of-a-job-schedule ├── 1335-minimum-difficulty-of-a-job-schedule.cpp ├── NOTES.md └── README.md ├── 1337-the-k-weakest-rows-in-a-matrix ├── 1337-the-k-weakest-rows-in-a-matrix.cpp ├── NOTES.md └── README.md ├── 1339-maximum-product-of-splitted-binary-tree ├── 1339-maximum-product-of-splitted-binary-tree.cpp └── NOTES.md ├── 1351-count-negative-numbers-in-a-sorted-matrix ├── 1351-count-negative-numbers-in-a-sorted-matrix.cpp ├── NOTES.md └── README.md ├── 1359-count-all-valid-pickup-and-delivery-options ├── 1359-count-all-valid-pickup-and-delivery-options.cpp ├── NOTES.md └── README.md ├── 136-single-number ├── 136-single-number.cpp ├── NOTES.md └── README.md ├── 1361-validate-binary-tree-nodes ├── 1361-validate-binary-tree-nodes.cpp ├── NOTES.md └── README.md ├── 1368-minimum-cost-to-make-at-least-one-valid-path-in-a-grid ├── 1368-minimum-cost-to-make-at-least-one-valid-path-in-a-grid.cpp ├── NOTES.md └── README.md ├── 1372-longest-zigzag-path-in-a-binary-tree ├── 1372-longest-zigzag-path-in-a-binary-tree.cpp ├── NOTES.md └── README.md ├── 1376-time-needed-to-inform-all-employees └── README.md ├── 1378-replace-employee-id-with-the-unique-identifier ├── 1378-replace-employee-id-with-the-unique-identifier.sql ├── NOTES.md └── README.md ├── 1387-sort-integers-by-the-power-value ├── 1387-sort-integers-by-the-power-value.cpp ├── NOTES.md └── README.md ├── 139-word-break ├── 139-word-break.cpp └── NOTES.md ├── 1395-count-number-of-teams ├── 1395-count-number-of-teams.cpp ├── NOTES.md └── README.md ├── 1396-design-underground-system ├── NOTES.md └── README.md ├── 14-longest-common-prefix ├── 14-longest-common-prefix.cpp └── README.md ├── 1402-reducing-dishes ├── 1402-reducing-dishes.cpp ├── NOTES.md └── README.md ├── 1406-stone-game-iii ├── 1406-stone-game-iii.cpp ├── NOTES.md └── README.md ├── 1415-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n ├── 1415-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n.cpp ├── NOTES.md └── README.md ├── 1416-restore-the-array ├── NOTES.md └── README.md ├── 1420-build-array-where-you-can-find-the-maximum-exactly-k-comparisons ├── 1420-build-array-where-you-can-find-the-maximum-exactly-k-comparisons.cpp └── README.md ├── 1422-maximum-score-after-splitting-a-string ├── 1422-maximum-score-after-splitting-a-string.cpp ├── NOTES.md └── README.md ├── 1425-constrained-subsequence-sum ├── 1425-constrained-subsequence-sum.cpp ├── NOTES.md └── README.md ├── 144-binary-tree-preorder-traversal ├── 144-binary-tree-preorder-traversal.cpp ├── NOTES.md └── README.md ├── 1442-count-triplets-that-can-form-two-arrays-of-equal-xor ├── 1442-count-triplets-that-can-form-two-arrays-of-equal-xor.cpp ├── NOTES.md └── README.md ├── 1446-consecutive-characters ├── 1446-consecutive-characters.cpp ├── NOTES.md └── README.md ├── 145-binary-tree-postorder-traversal ├── 145-binary-tree-postorder-traversal.cpp ├── NOTES.md └── README.md ├── 1453-maximum-number-of-darts-inside-of-a-circular-dartboard ├── 1453-maximum-number-of-darts-inside-of-a-circular-dartboard.cpp ├── NOTES.md └── README.md ├── 1456-maximum-number-of-vowels-in-a-substring-of-given-length ├── 1456-maximum-number-of-vowels-in-a-substring-of-given-length.cpp ├── NOTES.md └── README.md ├── 1463-cherry-pickup-ii ├── NOTES.md └── README.md ├── 1464-maximum-product-of-two-elements-in-an-array ├── 1464-maximum-product-of-two-elements-in-an-array.cpp ├── NOTES.md └── README.md ├── 1466-reorder-routes-to-make-all-paths-lead-to-the-city-zero ├── 1466-reorder-routes-to-make-all-paths-lead-to-the-city-zero.cpp ├── NOTES.md └── README.md ├── 1470-shuffle-the-array ├── 1470-shuffle-the-array.cpp ├── NOTES.md └── README.md ├── 1480-running-sum-of-1d-array ├── 1480-running-sum-of-1d-array.cpp ├── NOTES.md └── README.md ├── 1481-least-number-of-unique-integers-after-k-removals ├── 1481-least-number-of-unique-integers-after-k-removals.cpp ├── NOTES.md └── README.md ├── 1482-minimum-number-of-days-to-make-m-bouquets ├── 1482-minimum-number-of-days-to-make-m-bouquets.cpp └── NOTES.md ├── 1489-find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree ├── 1489-find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree.cpp ├── NOTES.md └── README.md ├── 149-max-points-on-a-line ├── 149-max-points-on-a-line.cpp ├── NOTES.md └── README.md ├── 1491-average-salary-excluding-the-minimum-and-maximum-salary ├── 1491-average-salary-excluding-the-minimum-and-maximum-salary.cpp ├── NOTES.md └── README.md ├── 1492-the-kth-factor-of-n ├── 1492-the-kth-factor-of-n.cpp ├── NOTES.md └── README.md ├── 1493-longest-subarray-of-1s-after-deleting-one-element ├── 1493-longest-subarray-of-1s-after-deleting-one-element.cpp ├── NOTES.md └── README.md ├── 1496-path-crossing ├── 1496-path-crossing.cpp ├── NOTES.md └── README.md ├── 1498-number-of-subsequences-that-satisfy-the-given-sum-condition ├── 1498-number-of-subsequences-that-satisfy-the-given-sum-condition.cpp ├── NOTES.md └── README.md ├── 15-3sum ├── 15-3sum.cpp ├── NOTES.md └── README.md ├── 150-evaluate-reverse-polish-notation ├── 150-evaluate-reverse-polish-notation.cpp └── README.md ├── 1502-can-make-arithmetic-progression-from-sequence ├── 1502-can-make-arithmetic-progression-from-sequence.cpp ├── NOTES.md └── README.md ├── 1512-number-of-good-pairs ├── 1512-number-of-good-pairs.cpp ├── NOTES.md └── README.md ├── 1514-path-with-maximum-probability ├── 1514-path-with-maximum-probability.cpp ├── NOTES.md └── README.md ├── 1519-number-of-nodes-in-the-sub-tree-with-the-same-label ├── 1519-number-of-nodes-in-the-sub-tree-with-the-same-label.cpp └── NOTES.md ├── 1526-minimum-number-of-increments-on-subarrays-to-form-a-target-array ├── 1526-minimum-number-of-increments-on-subarrays-to-form-a-target-array.cpp └── README.md ├── 1531-string-compression-ii ├── 1531-string-compression-ii.cpp ├── NOTES.md └── README.md ├── 1535-find-the-winner-of-an-array-game ├── 1535-find-the-winner-of-an-array-game.cpp ├── NOTES.md └── README.md ├── 1541-minimum-insertions-to-balance-a-parentheses-string ├── 1541-minimum-insertions-to-balance-a-parentheses-string.cpp ├── NOTES.md └── README.md ├── 1544-make-the-string-great ├── 1544-make-the-string-great.cpp ├── NOTES.md └── README.md ├── 1547-minimum-cost-to-cut-a-stick ├── 1547-minimum-cost-to-cut-a-stick.cpp ├── NOTES.md └── README.md ├── 1552-magnetic-force-between-two-balls ├── 1552-magnetic-force-between-two-balls.cpp ├── NOTES.md └── README.md ├── 1557-minimum-number-of-vertices-to-reach-all-nodes ├── 1557-minimum-number-of-vertices-to-reach-all-nodes.cpp ├── NOTES.md └── README.md ├── 1561-maximum-number-of-coins-you-can-get ├── 1561-maximum-number-of-coins-you-can-get.cpp ├── NOTES.md └── README.md ├── 1569-number-of-ways-to-reorder-array-to-get-same-bst ├── NOTES.md └── README.md ├── 1572-matrix-diagonal-sum ├── 1572-matrix-diagonal-sum.cpp ├── NOTES.md └── README.md ├── 1575-count-all-possible-routes ├── 1575-count-all-possible-routes.cpp ├── NOTES.md └── README.md ├── 1579-remove-max-number-of-edges-to-keep-graph-fully-traversable ├── NOTES.md └── README.md ├── 1584-min-cost-to-connect-all-points ├── 1584-min-cost-to-connect-all-points.cpp ├── NOTES.md └── README.md ├── 1592-rearrange-spaces-between-words ├── 1592-rearrange-spaces-between-words.cpp ├── NOTES.md └── README.md ├── 1603-design-parking-system ├── 1603-design-parking-system.cpp ├── NOTES.md └── README.md ├── 1611-minimum-one-bit-operations-to-make-integers-zero ├── 1611-minimum-one-bit-operations-to-make-integers-zero.cpp ├── NOTES.md └── README.md ├── 1615-maximal-network-rank ├── 1615-maximal-network-rank.cpp ├── NOTES.md └── README.md ├── 162-find-peak-element ├── 162-find-peak-element.cpp └── README.md ├── 1625-lexicographically-smallest-string-after-applying-operations ├── 1625-lexicographically-smallest-string-after-applying-operations.swift ├── NOTES.md └── README.md ├── 1626-best-team-with-no-conflicts ├── 1626-best-team-with-no-conflicts.cpp ├── NOTES.md └── README.md ├── 1631-path-with-minimum-effort ├── 1631-path-with-minimum-effort.cpp ├── NOTES.md └── README.md ├── 1637-widest-vertical-area-between-two-points-containing-no-points ├── 1637-widest-vertical-area-between-two-points-containing-no-points.cpp ├── NOTES.md └── README.md ├── 1640-check-array-formation-through-concatenation ├── 1640-check-array-formation-through-concatenation.cpp ├── NOTES.md └── README.md ├── 1656-design-an-ordered-stream ├── 1656-design-an-ordered-stream.cpp ├── NOTES.md └── README.md ├── 1657-determine-if-two-strings-are-close └── README.md ├── 1658-minimum-operations-to-reduce-x-to-zero ├── 1658-minimum-operations-to-reduce-x-to-zero.cpp ├── NOTES.md └── README.md ├── 1669-merge-in-between-linked-lists ├── 1669-merge-in-between-linked-lists.cpp ├── NOTES.md └── README.md ├── 1670-design-front-middle-back-queue ├── 1670-design-front-middle-back-queue.cpp ├── NOTES.md └── README.md ├── 1672-richest-customer-wealth ├── 1672-richest-customer-wealth.cpp ├── 1672-richest-customer-wealth.js ├── NOTES.md └── README.md ├── 1675-minimize-deviation-in-array ├── 1675-minimize-deviation-in-array.cpp ├── NOTES.md └── README.md ├── 1683-invalid-tweets ├── 1683-invalid-tweets.sql ├── NOTES.md └── README.md ├── 1697-checking-existence-of-edge-length-limited-paths ├── 1697-checking-existence-of-edge-length-limited-paths.cpp ├── NOTES.md └── README.md ├── 17-letter-combinations-of-a-phone-number ├── 17-letter-combinations-of-a-phone-number.cpp └── README.md ├── 1700-number-of-students-unable-to-eat-lunch ├── 1700-number-of-students-unable-to-eat-lunch.cpp ├── NOTES.md └── README.md ├── 1704-determine-if-string-halves-are-alike ├── 1704-determine-if-string-halves-are-alike.cpp ├── NOTES.md └── README.md ├── 1706-where-will-the-ball-fall └── NOTES.md ├── 1713-minimum-operations-to-make-a-subsequence ├── 1713-minimum-operations-to-make-a-subsequence.cpp ├── NOTES.md └── README.md ├── 1721-swapping-nodes-in-a-linked-list ├── 1721-swapping-nodes-in-a-linked-list.cpp └── README.md ├── 1727-largest-submatrix-with-rearrangements ├── 1727-largest-submatrix-with-rearrangements.cpp ├── NOTES.md └── README.md ├── 1732-find-the-highest-altitude ├── NOTES.md └── README.md ├── 1749-maximum-absolute-sum-of-any-subarray ├── 1749-maximum-absolute-sum-of-any-subarray.cpp └── README.md ├── 1750-minimum-length-of-string-after-deleting-similar-ends ├── 1750-minimum-length-of-string-after-deleting-similar-ends.cpp ├── NOTES.md └── README.md ├── 1751-maximum-number-of-events-that-can-be-attended-ii ├── 1751-maximum-number-of-events-that-can-be-attended-ii.cpp ├── NOTES.md └── README.md ├── 1758-minimum-changes-to-make-alternating-binary-string ├── 1758-minimum-changes-to-make-alternating-binary-string.cpp ├── NOTES.md └── README.md ├── 1768-merge-strings-alternately ├── 1768-merge-strings-alternately.cpp ├── NOTES.md └── README.md ├── 1791-find-center-of-star-graph ├── 1791-find-center-of-star-graph.cpp ├── NOTES.md └── README.md ├── 1793-maximum-score-of-a-good-subarray ├── 1793-maximum-score-of-a-good-subarray.cpp ├── NOTES.md └── README.md ├── 1799-maximize-score-after-n-operations ├── 1799-maximize-score-after-n-operations.cpp ├── NOTES.md └── README.md ├── 1802-maximum-value-at-a-given-index-in-a-bounded-array ├── 1802-maximum-value-at-a-given-index-in-a-bounded-array.cpp ├── NOTES.md └── README.md ├── 1807-evaluate-the-bracket-pairs-of-a-string ├── 1807-evaluate-the-bracket-pairs-of-a-string.cpp ├── NOTES.md └── README.md ├── 1817-finding-the-users-active-minutes ├── 1817-finding-the-users-active-minutes.cpp ├── NOTES.md └── README.md ├── 1822-sign-of-the-product-of-an-array ├── 1822-sign-of-the-product-of-an-array.cpp ├── NOTES.md └── README.md ├── 1829-maximum-xor-for-each-query ├── 1829-maximum-xor-for-each-query.cpp ├── NOTES.md └── README.md ├── 1832-check-if-the-sentence-is-pangram ├── 1832-check-if-the-sentence-is-pangram.cpp ├── NOTES.md └── README.md ├── 1833-maximum-ice-cream-bars ├── 1833-maximum-ice-cream-bars.cpp └── README.md ├── 1834-single-threaded-cpu ├── 1834-single-threaded-cpu.cpp └── README.md ├── 1863-sum-of-all-subset-xor-totals ├── 1863-sum-of-all-subset-xor-totals.cpp ├── NOTES.md └── README.md ├── 1870-minimum-speed-to-arrive-on-time ├── 1870-minimum-speed-to-arrive-on-time.cpp ├── NOTES.md └── README.md ├── 188-best-time-to-buy-and-sell-stock-iv ├── 188-best-time-to-buy-and-sell-stock-iv.cpp ├── NOTES.md └── README.md ├── 1887-reduction-operations-to-make-the-array-elements-equal ├── 1887-reduction-operations-to-make-the-array-elements-equal.cpp ├── NOTES.md └── README.md ├── 1903-largest-odd-number-in-string ├── 1903-largest-odd-number-in-string.cpp ├── NOTES.md └── README.md ├── 1910-remove-all-occurrences-of-a-substring ├── 1910-remove-all-occurrences-of-a-substring.cpp └── README.md ├── 1913-maximum-product-difference-between-two-pairs ├── 1913-maximum-product-difference-between-two-pairs.cpp ├── NOTES.md └── README.md ├── 1915-number-of-wonderful-substrings ├── 1915-number-of-wonderful-substrings.cpp ├── NOTES.md └── README.md ├── 1926-nearest-exit-from-entrance-in-maze ├── 1926-nearest-exit-from-entrance-in-maze.cpp ├── NOTES.md └── README.md ├── 1929-concatenation-of-array ├── 1929-concatenation-of-array.rs ├── NOTES.md └── README.md ├── 1962-remove-stones-to-minimize-the-total ├── 1962-remove-stones-to-minimize-the-total.cpp └── README.md ├── 1971-find-if-path-exists-in-graph ├── 1971-find-if-path-exists-in-graph.cpp └── README.md ├── 198-house-robber ├── 198-house-robber.cpp ├── NOTES.md └── README.md ├── 1980-find-unique-binary-string ├── 1980-find-unique-binary-string.cpp ├── NOTES.md └── README.md ├── 1992-find-all-groups-of-farmland ├── 1992-find-all-groups-of-farmland.cpp ├── 1992-find-all-groups-of-farmland.scala ├── NOTES.md └── README.md ├── 200-number-of-islands ├── 200-number-of-islands.cpp ├── NOTES.md └── README.md ├── 2000-reverse-prefix-of-word ├── 2000-reverse-prefix-of-word.cpp ├── NOTES.md └── README.md ├── 2024-maximize-the-confusion-of-an-exam ├── 2024-maximize-the-confusion-of-an-exam.cpp ├── NOTES.md └── README.md ├── 2037-minimum-number-of-moves-to-seat-everyone ├── 2037-minimum-number-of-moves-to-seat-everyone.cpp ├── NOTES.md └── README.md ├── 2038-remove-colored-pieces-if-both-neighbors-are-the-same-color ├── 2038-remove-colored-pieces-if-both-neighbors-are-the-same-color.cpp ├── NOTES.md └── README.md ├── 205-isomorphic-strings ├── 205-isomorphic-strings.cpp ├── NOTES.md └── README.md ├── 2050-parallel-courses-iii ├── 2050-parallel-courses-iii.cpp ├── NOTES.md └── README.md ├── 206-reverse-linked-list ├── 206-reverse-linked-list.cpp ├── NOTES.md └── README.md ├── 2068-check-whether-two-strings-are-almost-equivalent ├── NOTES.md └── README.md ├── 207-course-schedule ├── NOTES.md └── README.md ├── 2073-time-needed-to-buy-tickets ├── 2073-time-needed-to-buy-tickets.cpp ├── NOTES.md └── README.md ├── 2090-k-radius-subarray-averages ├── 2090-k-radius-subarray-averages.cpp ├── NOTES.md └── README.md ├── 2092-find-all-people-with-secret ├── 2092-find-all-people-with-secret.cpp ├── NOTES.md └── README.md ├── 2094-finding-3-digit-even-numbers ├── 2094-finding-3-digit-even-numbers.cpp ├── NOTES.md └── README.md ├── 21-merge-two-sorted-lists ├── NOTES.md └── README.md ├── 2101-detonate-the-maximum-bombs ├── NOTES.md └── README.md ├── 2102-sequentially-ordinal-rank-tracker ├── 2102-sequentially-ordinal-rank-tracker.cpp └── README.md ├── 2120-execution-of-all-suffix-instructions-staying-in-a-grid ├── 2120-execution-of-all-suffix-instructions-staying-in-a-grid.cpp ├── NOTES.md └── README.md ├── 2124-check-if-all-as-appears-before-all-bs ├── 2124-check-if-all-as-appears-before-all-bs.cpp ├── NOTES.md └── README.md ├── 2130-maximum-twin-sum-of-a-linked-list ├── 2130-maximum-twin-sum-of-a-linked-list.cpp ├── NOTES.md └── README.md ├── 2131-longest-palindrome-by-concatenating-two-letter-words ├── 2131-longest-palindrome-by-concatenating-two-letter-words.cpp ├── NOTES.md └── README.md ├── 2140-solving-questions-with-brainpower ├── NOTES.md └── README.md ├── 2141-maximum-running-time-of-n-computers ├── 2141-maximum-running-time-of-n-computers.cpp ├── NOTES.md └── README.md ├── 2147-number-of-ways-to-divide-a-long-corridor ├── 2147-number-of-ways-to-divide-a-long-corridor.cpp ├── NOTES.md └── README.md ├── 2149-rearrange-array-elements-by-sign ├── 2149-rearrange-array-elements-by-sign.cpp └── README.md ├── 2197-replace-non-coprime-numbers-in-array ├── 2197-replace-non-coprime-numbers-in-array.cpp ├── NOTES.md └── README.md ├── 2215-find-the-difference-of-two-arrays ├── 2215-find-the-difference-of-two-arrays.cpp ├── NOTES.md └── README.md ├── 2221-find-triangular-sum-of-an-array ├── 2221-find-triangular-sum-of-an-array.cpp ├── NOTES.md └── README.md ├── 2225-find-players-with-zero-or-one-losses ├── 2225-find-players-with-zero-or-one-losses.cpp ├── NOTES.md └── README.md ├── 2226-maximum-candies-allocated-to-k-children ├── 2226-maximum-candies-allocated-to-k-children.cpp └── README.md ├── 2239-find-closest-number-to-zero ├── 2239-find-closest-number-to-zero.cpp ├── NOTES.md └── README.md ├── 2243-calculate-digit-sum-of-a-string ├── 2243-calculate-digit-sum-of-a-string.cpp ├── NOTES.md └── README.md ├── 2244-minimum-rounds-to-complete-all-tasks ├── 2244-minimum-rounds-to-complete-all-tasks.cpp ├── NOTES.md └── README.md ├── 2249-count-lattice-points-inside-a-circle ├── 2249-count-lattice-points-inside-a-circle.cpp ├── NOTES.md └── README.md ├── 2251-number-of-flowers-in-full-bloom ├── 2251-number-of-flowers-in-full-bloom.cpp ├── NOTES.md └── README.md ├── 2256-minimum-average-difference ├── 2256-minimum-average-difference.cpp ├── NOTES.md └── README.md ├── 2269-find-the-k-beauty-of-a-number ├── 2269-find-the-k-beauty-of-a-number.cpp ├── NOTES.md └── README.md ├── 2287-rearrange-characters-to-make-target-string ├── 2287-rearrange-characters-to-make-target-string.cpp ├── NOTES.md └── README.md ├── 2293-min-max-game ├── 2293-min-max-game.cpp ├── NOTES.md └── README.md ├── 2306-naming-a-company ├── 2306-naming-a-company.cpp └── NOTES.md ├── 232-implement-queue-using-stacks ├── 232-implement-queue-using-stacks.cpp └── README.md ├── 2328-number-of-increasing-paths-in-a-grid ├── 2328-number-of-increasing-paths-in-a-grid.cpp ├── NOTES.md └── README.md ├── 2331-evaluate-boolean-binary-tree ├── 2331-evaluate-boolean-binary-tree.cpp └── README.md ├── 2336-smallest-number-in-infinite-set ├── 2336-smallest-number-in-infinite-set.cpp ├── NOTES.md └── README.md ├── 2341-maximum-number-of-pairs-in-array ├── 2341-maximum-number-of-pairs-in-array.cpp └── README.md ├── 2352-equal-row-and-column-pairs ├── 2352-equal-row-and-column-pairs.cpp ├── NOTES.md └── README.md ├── 236-lowest-common-ancestor-of-a-binary-tree ├── 236-lowest-common-ancestor-of-a-binary-tree.cpp ├── NOTES.md └── README.md ├── 2363-merge-similar-items ├── 2363-merge-similar-items.cpp ├── NOTES.md └── README.md ├── 2369-check-if-there-is-a-valid-partition-for-the-array ├── NOTES.md └── README.md ├── 2370-longest-ideal-subsequence ├── 2370-longest-ideal-subsequence.cpp ├── NOTES.md └── README.md ├── 2389-longest-subsequence-with-limited-sum ├── 2389-longest-subsequence-with-limited-sum.cpp ├── NOTES.md └── README.md ├── 2391-minimum-amount-of-time-to-collect-garbage ├── 2391-minimum-amount-of-time-to-collect-garbage.cpp ├── NOTES.md └── README.md ├── 2415-reverse-odd-levels-of-binary-tree ├── 2415-reverse-odd-levels-of-binary-tree.cpp ├── NOTES.md └── README.md ├── 2421-number-of-good-paths ├── 2421-number-of-good-paths.cpp └── README.md ├── 2427-number-of-common-factors ├── 2427-number-of-common-factors.cpp ├── NOTES.md └── README.md ├── 2434-using-a-robot-to-print-the-lexicographically-smallest-string ├── 2434-using-a-robot-to-print-the-lexicographically-smallest-string.cpp ├── NOTES.md └── README.md ├── 2441-largest-positive-integer-that-exists-with-its-negative ├── 2441-largest-positive-integer-that-exists-with-its-negative.cpp ├── NOTES.md └── README.md ├── 2443-sum-of-number-and-its-reverse ├── 2443-sum-of-number-and-its-reverse.cpp ├── NOTES.md └── README.md ├── 2444-count-subarrays-with-fixed-bounds ├── 2444-count-subarrays-with-fixed-bounds.cpp ├── NOTES.md └── README.md ├── 2448-minimum-cost-to-make-array-equal ├── 2448-minimum-cost-to-make-array-equal.cpp ├── NOTES.md └── README.md ├── 2462-total-cost-to-hire-k-workers ├── 2462-total-cost-to-hire-k-workers.cpp └── README.md ├── 2477-minimum-fuel-cost-to-report-to-the-capital ├── 2477-minimum-fuel-cost-to-report-to-the-capital.cpp ├── NOTES.md └── README.md ├── 2482-difference-between-ones-and-zeros-in-row-and-column ├── NOTES.md └── README.md ├── 2515-shortest-distance-to-target-string-in-a-circular-array ├── 2515-shortest-distance-to-target-string-in-a-circular-array.cpp ├── NOTES.md └── README.md ├── 2520-count-the-digits-that-divide-a-number ├── 2520-count-the-digits-that-divide-a-number.cpp ├── NOTES.md └── README.md ├── 2521-distinct-prime-factors-of-product-of-array ├── 2521-distinct-prime-factors-of-product-of-array.cpp ├── NOTES.md └── README.md ├── 2529-maximum-count-of-positive-integer-and-negative-integer ├── 2529-maximum-count-of-positive-integer-and-negative-integer.cpp ├── NOTES.md └── README.md ├── 2542-maximum-subsequence-score ├── 2542-maximum-subsequence-score.cpp ├── NOTES.md └── README.md ├── 2550-count-collisions-of-monkeys-on-a-polygon ├── 2550-count-collisions-of-monkeys-on-a-polygon.cpp ├── NOTES.md └── README.md ├── 2551-put-marbles-in-bags ├── 2551-put-marbles-in-bags.cpp ├── NOTES.md └── README.md ├── 2558-take-gifts-from-the-richest-pile ├── 2558-take-gifts-from-the-richest-pile.cpp ├── NOTES.md └── README.md ├── 2597-the-number-of-beautiful-subsets ├── 2597-the-number-of-beautiful-subsets.cpp ├── NOTES.md └── README.md ├── 2616-minimize-the-maximum-difference-of-pairs ├── 2616-minimize-the-maximum-difference-of-pairs.cpp └── NOTES.md ├── 2619-array-prototype-last ├── 2619-array-prototype-last.js ├── NOTES.md └── README.md ├── 2620-counter ├── 2620-counter.js ├── NOTES.md └── README.md ├── 2631-group-by ├── 2631-group-by.js ├── NOTES.md └── README.md ├── 2635-apply-transform-over-each-element-in-array ├── NOTES.md └── README.md ├── 2637-promise-time-limit ├── 2637-promise-time-limit.js ├── NOTES.md └── README.md ├── 2642-design-graph-with-shortest-path-calculator ├── 2642-design-graph-with-shortest-path-calculator.cpp ├── NOTES.md └── README.md ├── 2644-find-the-maximum-divisibility-score ├── 2644-find-the-maximum-divisibility-score.cpp ├── NOTES.md └── README.md ├── 2648-generate-fibonacci-sequence ├── 2648-generate-fibonacci-sequence.js ├── 2648-generate-fibonacci-sequence.ts ├── NOTES.md └── README.md ├── 2651-calculate-delayed-arrival-time ├── 2651-calculate-delayed-arrival-time.cpp ├── NOTES.md └── README.md ├── 2652-sum-multiples ├── 2652-sum-multiples.cpp ├── NOTES.md └── README.md ├── 2658-maximum-number-of-fish-in-a-grid ├── 2658-maximum-number-of-fish-in-a-grid.cpp ├── NOTES.md └── README.md ├── 2666-allow-one-function-call ├── NOTES.md └── README.md ├── 2667-create-hello-world-function ├── 2667-create-hello-world-function.js ├── NOTES.md └── README.md ├── 2677-chunk-array ├── 2677-chunk-array.js ├── NOTES.md └── README.md ├── 2679-sum-in-a-matrix ├── NOTES.md └── README.md ├── 2694-event-emitter ├── 2694-event-emitter.js ├── NOTES.md └── README.md ├── 2695-array-wrapper ├── NOTES.md └── README.md ├── 2703-return-length-of-arguments-passed ├── 2703-return-length-of-arguments-passed.js ├── NOTES.md └── README.md ├── 2704-to-be-or-not-to-be ├── 2704-to-be-or-not-to-be.js ├── NOTES.md └── README.md ├── 2707-extra-characters-in-a-string ├── 2707-extra-characters-in-a-string.cpp ├── NOTES.md └── README.md ├── 2709-greatest-common-divisor-traversal ├── 2709-greatest-common-divisor-traversal.cpp ├── NOTES.md └── README.md ├── 2716-minimize-string-length ├── 2716-minimize-string-length.cpp ├── NOTES.md └── README.md ├── 2722-join-two-arrays-by-id ├── 2722-join-two-arrays-by-id.js ├── NOTES.md └── README.md ├── 2723-add-two-promises ├── 2723-add-two-promises.js ├── NOTES.md └── README.md ├── 2726-calculator-with-method-chaining ├── 2726-calculator-with-method-chaining.js ├── NOTES.md └── README.md ├── 2742-painting-the-walls ├── 2742-painting-the-walls.cpp ├── NOTES.md └── README.md ├── 2762-continuous-subarrays ├── 2762-continuous-subarrays.cpp └── NOTES.md ├── 2785-sort-vowels-in-a-string ├── 2785-sort-vowels-in-a-string.cpp ├── NOTES.md └── README.md ├── 2812-find-the-safest-path-in-a-grid ├── 2812-find-the-safest-path-in-a-grid.cpp ├── NOTES.md └── README.md ├── 2835-minimum-operations-to-form-subsequence-with-target-sum ├── 2835-minimum-operations-to-form-subsequence-with-target-sum.cpp ├── NOTES.md └── README.md ├── 2836-maximize-value-of-function-in-a-ball-passing-game ├── 2836-maximize-value-of-function-in-a-ball-passing-game.cpp ├── NOTES.md └── README.md ├── 2864-maximum-odd-binary-number ├── 2864-maximum-odd-binary-number.cpp └── README.md ├── 287-find-the-duplicate-number ├── 287-find-the-duplicate-number.cpp ├── NOTES.md └── README.md ├── 290-word-pattern ├── 290-word-pattern.cpp └── NOTES.md ├── 2903-find-indices-with-index-and-value-difference-i ├── 2903-find-indices-with-index-and-value-difference-i.cpp ├── NOTES.md └── README.md ├── 2904-shortest-and-lexicographically-smallest-beautiful-string ├── 2904-shortest-and-lexicographically-smallest-beautiful-string.cpp ├── NOTES.md └── README.md ├── 2906-construct-product-matrix ├── 2906-construct-product-matrix.cpp ├── NOTES.md └── README.md ├── 2917-find-the-k-or-of-an-array ├── 2917-find-the-k-or-of-an-array.cpp ├── NOTES.md └── README.md ├── 2928-distribute-candies-among-children-i ├── 2928-distribute-candies-among-children-i.cpp ├── NOTES.md └── README.md ├── 2937-make-three-strings-equal ├── 2937-make-three-strings-equal.cpp ├── NOTES.md └── README.md ├── 2938-separate-black-and-white-balls ├── 2938-separate-black-and-white-balls.cpp ├── NOTES.md └── README.md ├── 2942-find-words-containing-character ├── 2942-find-words-containing-character.cpp ├── NOTES.md └── README.md ├── 2962-count-subarrays-where-max-element-appears-at-least-k-times ├── NOTES.md └── README.md ├── 2974-minimum-number-game ├── 2974-minimum-number-game.cpp ├── NOTES.md └── README.md ├── 3016-minimum-number-of-pushes-to-type-word-ii ├── 3016-minimum-number-of-pushes-to-type-word-ii.rb ├── NOTES.md └── README.md ├── 3034-number-of-subarrays-that-match-a-pattern-i ├── 3034-number-of-subarrays-that-match-a-pattern-i.py ├── NOTES.md └── README.md ├── 3038-maximum-number-of-operations-with-the-same-score-i ├── 3038-maximum-number-of-operations-with-the-same-score-i.scala ├── NOTES.md └── README.md ├── 3046-split-the-array ├── 3046-split-the-array.cpp ├── NOTES.md └── README.md ├── 3068-find-the-maximum-sum-of-node-values ├── 3068-find-the-maximum-sum-of-node-values.cpp ├── NOTES.md └── README.md ├── 3074-apple-redistribution-into-boxes ├── 3074-apple-redistribution-into-boxes.ts ├── NOTES.md └── README.md ├── 3083-existence-of-a-substring-in-a-string-and-its-reverse ├── 3083-existence-of-a-substring-in-a-string-and-its-reverse.cpp ├── NOTES.md └── README.md ├── 3090-maximum-length-substring-with-two-occurrences ├── 3090-maximum-length-substring-with-two-occurrences.cpp ├── NOTES.md └── README.md ├── 3095-shortest-subarray-with-or-at-least-k-i ├── 3095-shortest-subarray-with-or-at-least-k-i.cpp ├── NOTES.md └── README.md ├── 3099-harshad-number ├── 3099-harshad-number.swift ├── NOTES.md └── README.md ├── 31-next-permutation ├── 31-next-permutation.cpp ├── NOTES.md └── README.md ├── 3105-longest-strictly-increasing-or-strictly-decreasing-subarray ├── 3105-longest-strictly-increasing-or-strictly-decreasing-subarray.swift ├── NOTES.md └── README.md ├── 3110-score-of-a-string ├── 3110-score-of-a-string.cpp ├── NOTES.md └── README.md ├── 3114-latest-time-you-can-obtain-after-replacing-characters ├── 3114-latest-time-you-can-obtain-after-replacing-characters.cpp ├── NOTES.md └── README.md ├── 3120-count-the-number-of-special-characters-i ├── 3120-count-the-number-of-special-characters-i.cpp ├── NOTES.md └── README.md ├── 3131-find-the-integer-added-to-array-i ├── 3131-find-the-integer-added-to-array-i.cpp ├── NOTES.md └── README.md ├── 3146-permutation-difference-between-two-strings ├── 3146-permutation-difference-between-two-strings.cpp ├── NOTES.md └── README.md ├── 3151-special-array-i ├── 3151-special-array-i.cpp ├── NOTES.md └── README.md ├── 3158-find-the-xor-of-numbers-which-appear-twice ├── 3158-find-the-xor-of-numbers-which-appear-twice.cpp ├── NOTES.md └── README.md ├── 3159-find-occurrences-of-an-element-in-an-array ├── 3159-find-occurrences-of-an-element-in-an-array.cpp ├── NOTES.md └── README.md ├── 3162-find-the-number-of-good-pairs-i ├── 3162-find-the-number-of-good-pairs-i.cpp ├── NOTES.md └── README.md ├── 3168-minimum-number-of-chairs-in-a-waiting-room ├── 3168-minimum-number-of-chairs-in-a-waiting-room.cpp ├── NOTES.md └── README.md ├── 3171-find-subarray-with-bitwise-and-closest-to-k ├── 3171-find-subarray-with-bitwise-and-closest-to-k.cpp ├── NOTES.md └── README.md ├── 3219-minimum-cost-for-cutting-cake-ii ├── 3219-minimum-cost-for-cutting-cake-ii.cpp ├── NOTES.md └── README.md ├── 33-search-in-rotated-sorted-array ├── 33-search-in-rotated-sorted-array.cpp ├── NOTES.md └── README.md ├── 34-find-first-and-last-position-of-element-in-sorted-array ├── 34-find-first-and-last-position-of-element-in-sorted-array.cpp └── NOTES.md ├── 344-reverse-string ├── 344-reverse-string.cpp ├── NOTES.md └── README.md ├── 35-search-insert-position ├── 35-search-insert-position.cpp └── README.md ├── 380-insert-delete-getrandom-o1 ├── 380-insert-delete-getrandom-o1.cpp ├── NOTES.md └── README.md ├── 392-is-subsequence ├── 392-is-subsequence.cpp ├── NOTES.md └── README.md ├── 416-partition-equal-subset-sum ├── 416-partition-equal-subset-sum.cpp ├── NOTES.md └── README.md ├── 42-trapping-rain-water ├── 42-trapping-rain-water.cpp ├── NOTES.md └── README.md ├── 427-construct-quad-tree ├── 427-construct-quad-tree.cpp ├── NOTES.md └── README.md ├── 443-string-compression ├── 443-string-compression.cpp ├── NOTES.md └── README.md ├── 446-arithmetic-slices-ii-subsequence ├── 446-arithmetic-slices-ii-subsequence.cpp ├── NOTES.md └── README.md ├── 45-jump-game-ii ├── 45-jump-game-ii.cpp └── NOTES.md ├── 450-delete-node-in-a-bst ├── 450-delete-node-in-a-bst.cpp ├── NOTES.md └── README.md ├── 451-sort-characters-by-frequency ├── 451-sort-characters-by-frequency.cpp ├── NOTES.md └── README.md ├── 452-minimum-number-of-arrows-to-burst-balloons ├── 452-minimum-number-of-arrows-to-burst-balloons.cpp ├── NOTES.md └── README.md ├── 46-permutations ├── 46-permutations.cpp ├── NOTES.md └── README.md ├── 472-concatenated-words ├── 472-concatenated-words.cpp ├── NOTES.md └── README.md ├── 491-increasing-subsequences ├── 491-increasing-subsequences.cpp ├── NOTES.md └── README.md ├── 491-non-decreasing-subsequences ├── 491-non-decreasing-subsequences.cpp └── README.md ├── 5-longest-palindromic-substring ├── 5-longest-palindromic-substring.cpp ├── NOTES.md └── README.md ├── 502-ipo └── README.md ├── 518-coin-change-ii ├── 518-coin-change-ii.cpp ├── NOTES.md └── README.md ├── 520-detect-capital ├── 520-detect-capital.cpp └── README.md ├── 54-spiral-matrix ├── 54-spiral-matrix.cpp ├── NOTES.md └── README.md ├── 540-single-element-in-a-sorted-array ├── 540-single-element-in-a-sorted-array.cpp ├── NOTES.md └── README.md ├── 547-number-of-provinces ├── 547-number-of-provinces.cpp ├── NOTES.md └── README.md ├── 55-jump-game ├── 55-jump-game.cpp └── README.md ├── 557-reverse-words-in-a-string-iii ├── 557-reverse-words-in-a-string-iii.cpp ├── NOTES.md └── README.md ├── 56-merge-intervals ├── 56-merge-intervals.cpp ├── NOTES.md └── README.md ├── 567-permutation-in-string ├── 567-permutation-in-string.cpp ├── NOTES.md └── README.md ├── 57-insert-interval ├── 57-insert-interval.cpp └── NOTES.md ├── 617-merge-two-binary-trees ├── 617-merge-two-binary-trees.cpp ├── NOTES.md └── README.md ├── 67-add-binary ├── 67-add-binary.cpp └── NOTES.md ├── 695-max-area-of-island ├── 695-max-area-of-island.cpp └── NOTES.md ├── 70-climbing-stairs ├── 70-climbing-stairs.cpp └── README.md ├── 700-search-in-a-binary-search-tree ├── 700-search-in-a-binary-search-tree.cpp ├── NOTES.md └── README.md ├── 72-edit-distance ├── 72-edit-distance.cpp └── NOTES.md ├── 724-find-pivot-index ├── 724-find-pivot-index.cpp ├── NOTES.md └── README.md ├── 733-flood-fill ├── 733-flood-fill.cpp ├── NOTES.md └── README.md ├── 739-daily-temperatures ├── 739-daily-temperatures.cpp └── README.md ├── 74-search-a-2d-matrix ├── 74-search-a-2d-matrix.cpp ├── NOTES.md └── README.md ├── 75-sort-colors ├── 75-sort-colors.cpp ├── NOTES.md └── README.md ├── 767-reorganize-string ├── 767-reorganize-string.cpp └── README.md ├── 784-letter-case-permutation ├── 784-letter-case-permutation.cpp ├── NOTES.md └── README.md ├── 787-cheapest-flights-within-k-stops ├── 787-cheapest-flights-within-k-stops.cpp ├── NOTES.md └── README.md ├── 790-domino-and-tromino-tiling ├── 790-domino-and-tromino-tiling.cpp └── README.md ├── 797-all-paths-from-source-to-target ├── 797-all-paths-from-source-to-target.cpp ├── NOTES.md └── README.md ├── 834-sum-of-distances-in-tree ├── 834-sum-of-distances-in-tree.cpp └── README.md ├── 841-keys-and-rooms ├── 841-keys-and-rooms.cpp └── README.md ├── 844-backspace-string-compare ├── 844-backspace-string-compare.cpp ├── NOTES.md └── README.md ├── 85-maximal-rectangle ├── 85-maximal-rectangle.cpp ├── NOTES.md └── README.md ├── 872-leaf-similar-trees ├── 872-leaf-similar-trees.cpp ├── NOTES.md └── README.md ├── 876-middle-of-the-linked-list ├── 876-middle-of-the-linked-list.cpp ├── NOTES.md └── README.md ├── 886-possible-bipartition ├── 886-possible-bipartition.cpp └── README.md ├── 904-fruit-into-baskets ├── 904-fruit-into-baskets.cpp ├── NOTES.md └── README.md ├── 907-sum-of-subarray-minimums ├── 907-sum-of-subarray-minimums.cpp ├── NOTES.md └── README.md ├── 909-snakes-and-ladders ├── 909-snakes-and-ladders.cpp └── README.md ├── 912-sort-an-array ├── 912-sort-an-array.cpp └── NOTES.md ├── 918-maximum-sum-circular-subarray ├── 918-maximum-sum-circular-subarray.cpp └── README.md ├── 926-flip-string-to-monotone-increasing ├── 926-flip-string-to-monotone-increasing.cpp └── README.md ├── 93-restore-ip-addresses ├── 93-restore-ip-addresses.cpp ├── NOTES.md └── README.md ├── 931-minimum-falling-path-sum ├── 931-minimum-falling-path-sum.cpp └── README.md ├── 94-binary-tree-inorder-traversal ├── 94-binary-tree-inorder-traversal.cpp ├── NOTES.md └── README.md ├── 944-delete-columns-to-make-sorted ├── 944-delete-columns-to-make-sorted.cpp ├── NOTES.md └── README.md ├── 953-verifying-an-alien-dictionary ├── 953-verifying-an-alien-dictionary.cpp ├── NOTES.md └── README.md ├── 977-squares-of-a-sorted-array ├── 977-squares-of-a-sorted-array.cpp └── NOTES.md ├── 989-add-to-array-form-of-integer ├── 989-add-to-array-form-of-integer.cpp └── README.md ├── 997-find-the-town-judge ├── 997-find-the-town-judge.cpp ├── NOTES.md └── README.md ├── Adding Ones - GFG ├── README.md └── adding-ones.cpp ├── Base Equivalence - GFG ├── README.md └── base-equivalence.cpp ├── Boundary traversal of matrix - GFG ├── README.md └── boundary-traversal-of-matrix.cpp ├── Ceil The Floor - GFG ├── README.md └── ceil-the-floor.cpp ├── Check for Balanced Tree - GFG ├── README.md └── check-for-balanced-tree.cpp ├── Check if Tree is Isomorphic - GFG ├── README.md └── check-if-tree-is-isomorphic.cpp ├── Check if all levels of two trees are anagrams or not - GFG ├── README.md └── check-if-all-levels-of-two-trees-are-anagrams-or-not.cpp ├── Coin Change - GFG ├── README.md └── coin-change.cpp ├── Column name from a given column number - GFG └── README.md ├── Copy Set Bits in Range - GFG ├── README.md └── copy-set-bits-in-range.cpp ├── Count pairs with given sum - GFG ├── README.md └── count-pairs-with-given-sum.cpp ├── Count the subarrays having product less than k - GFG ├── README.md └── count-the-subarrays-having-product-less-than-k.cpp ├── Detect cycle in an undirected graph - GFG ├── README.md └── detect-cycle-in-an-undirected-graph.cpp ├── Enemy - GFG ├── README.md └── enemy.cpp ├── Equilibrium Point - GFG ├── README.md └── equilibrium-point.cpp ├── Find Kth permutation - GFG ├── README.md └── find-kth-permutation.cpp ├── Find first repeated character - GFG ├── README.md ├── find-first-repeated-character.cpp └── find-first-repeated-character.java ├── Find first set bit - GFG ├── README.md └── find-first-set-bit.cpp ├── Find kth element of spiral matrix - GFG ├── README.md └── find-kth-element-of-spiral-matrix.cpp ├── Find the closest pair from two arrays - GFG ├── README.md └── find-the-closest-pair-from-two-arrays.cpp ├── Find triplets with zero sum - GFG ├── README.md └── find-triplets-with-zero-sum.cpp ├── First and last occurrences of x - GFG ├── README.md └── first-and-last-occurrences-of-x.cpp ├── Flip Bits - GFG ├── README.md └── flip-bits.cpp ├── Floor in a Sorted Array - GFG ├── README.md └── floor-in-a-sorted-array.cpp ├── Floyd Warshall - GFG ├── README.md └── floyd-warshall.cpp ├── Frequency Game - GFG ├── README.md └── frequency-game.cpp ├── Gold Mine Problem - GFG └── gold-mine-problem.cpp ├── Good Subtrees - GFG ├── README.md └── good-subtrees.cpp ├── Height of Binary Tree - GFG ├── README.md └── height-of-binary-tree.cpp ├── Is Binary Number Multiple of 3 - GFG ├── README.md └── is-binary-number-multiple-of-3.cpp ├── Jumping Numbers - GFG ├── README.md └── jumping-numbers.cpp ├── K-th element of two sorted Arrays - GFG ├── README.md └── kth-element-of-two-sorted-arrays.cpp ├── Kth smallest element - GFG ├── README.md └── kth-smallest-element.cpp ├── Largest number possible - GFG ├── README.md └── largest-number-possible.cpp ├── Leaders in an array - GFG ├── README.md └── leaders-in-an-array.cpp ├── Leaf under budget - GFG ├── README.md └── leaf-under-budget.cpp ├── Leftmost and rightmost nodes of binary tree - GFG ├── README.md └── leftmost-and-rightmost-nodes-of-binary-tree.cpp ├── Level of Nodes - GFG ├── README.md └── level-of-nodes.cpp ├── Longest K unique characters substring - GFG ├── README.md └── longest-k-unique-characters-substring.cpp ├── Longest Repeating Subsequence - GFG ├── README.md └── longest-repeating-subsequence.cpp ├── Lucky Numbers - GFG └── README.md ├── Magic Triplets - GFG ├── README.md └── magic-triplets.cpp ├── Matrix Chain Multiplication - GFG ├── README.md └── matrix-chain-multiplication.cpp ├── Max Sum Subarray of size K - GFG ├── README.md └── max-sum-subarray-of-size-k.cpp ├── Maximum Index - GFG ├── README.md └── maximum-index.cpp ├── Maximum Sub-String after at most K changes - GFG ├── README.md └── maximum-sub-string-after-at-most-k-changes.cpp ├── Maximum Sum Combination - GFG ├── README.md └── maximum-sum-combination.cpp ├── Maximum sum increasing subsequence - GFG ├── README.md └── maximum-sum-increasing-subsequence.cpp ├── Merge Without Extra Space - GFG ├── README.md └── merge-without-extra-space.cpp ├── Minimum Platforms - GFG ├── README.md └── minimum-platforms.cpp ├── Minimum number of Coins - GFG ├── README.md └── minimum-number-of-coins.cpp ├── Multiply two strings - GFG ├── README.md └── multiply-two-strings.py ├── Normal BST to Balanced BST - GFG ├── README.md └── normal-bst-to-balanced-bst.cpp ├── Nth Fibonacci Number - GFG ├── README.md └── nth-fibonacci-number.cpp ├── Nth node from end of linked list - GFG ├── README.md └── nth-node-from-end-of-linked-list.cpp ├── Number Of Enclaves - GFG ├── README.md └── number-of-enclaves.cpp ├── Number of 1 Bits - GFG ├── README.md └── number-of-1-bits.cpp ├── Number of occurrence - GFG ├── README.md └── number-of-occurrence.cpp ├── Number of paths - GFG ├── README.md └── number-of-paths.cpp ├── Overlapping Intervals - GFG ├── README.md └── overlapping-intervals.cpp ├── Pairwise swap elements of a linked list - GFG ├── README.md └── pairwise-swap-elements-of-a-linked-list.cpp ├── Palindrome String - GFG ├── README.md └── palindrome-string.cpp ├── Partition Equal Subset Sum - GFG ├── README.md └── partition-equal-subset-sum.cpp ├── Perfect Sum Problem - GFG ├── README.md └── perfect-sum-problem.cpp ├── Permutations of a given string - GFG ├── README.md └── permutations-of-a-given-string.cpp ├── Print first n Fibonacci Numbers - GFG ├── README.md └── print-first-n-fibonacci-numbers.cpp ├── Quick Sort - GFG ├── README.md └── quick-sort.cpp ├── README.md ├── Rearrange an array with O(1) extra space - GFG └── README.md ├── Remove duplicate element from sorted Linked List - GFG ├── README.md └── remove-duplicate-element-from-sorted-linked-list.cpp ├── Remove duplicates from an unsorted linked list - GFG ├── README.md └── remove-duplicates-from-an-unsorted-linked-list.cpp ├── Replace O's with X's - GFG ├── README.md └── replace-os-with-xs.cpp ├── Reverse a Linked List in groups of given size. - GFG ├── README.md └── reverse-a-linked-list-in-groups-of-given-size..cpp ├── Reverse alternate nodes in Link List - GFG ├── README.md └── reverse-alternate-nodes-in-link-list.cpp ├── Reversing the equation - GFG ├── README.md └── reversing-the-equation.cpp ├── Rotate Bits - GFG ├── README.md └── rotate-bits.cpp ├── Second Largest - GFG ├── README.md └── second-largest.cpp ├── Stickler Thief - GFG ├── README.md └── stickler-thief.cpp ├── Subset Sums - GFG └── README.md ├── Sum of all divisors from 1 to n - GFG ├── README.md └── sum-of-all-divisors-from-1-to-n.cpp ├── Surround the 1's - GFG ├── README.md └── surround-the-1s.cpp ├── Task Scheduler - GFG ├── README.md └── task-scheduler.cpp ├── Third largest element - GFG ├── README.md └── third-largest-element.cpp ├── Ticket Counter - GFG ├── README.md └── ticket-counter.cpp ├── Topological sort - GFG ├── README.md └── topological-sort.cpp ├── Transitive closure of a Graph - GFG ├── README.md └── transitive-closure-of-a-graph.cpp ├── Two numbers with odd occurrences - GFG └── README.md ├── Unique partitions - GFG ├── README.md └── unique-partitions.cpp ├── Wave Array - GFG ├── README.md └── wave-array.cpp ├── Word Search - GFG ├── README.md └── word-search.cpp ├── k largest elements - GFG ├── README.md └── k-largest-elements.cpp └── nCr - GFG ├── README.md └── n-cr.cpp /0002-add-two-numbers/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0003-longest-substring-without-repeating-characters/0003-longest-substring-without-repeating-characters.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int lengthOfLongestSubstring(string s) { 4 | vectordict(256, -1); 5 | // pwwkew 6 | int start = -1, maxlen=0; 7 | int n = s.size(); 8 | for(int i = 0 ; i < n ; i++) { 9 | start = max(start, dict[s[i]]); 10 | dict[s[i]] = i; 11 | maxlen = max(maxlen, i-start); 12 | } 13 | return maxlen; 14 | } 15 | }; -------------------------------------------------------------------------------- /0003-longest-substring-without-repeating-characters/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0004-median-of-two-sorted-arrays/0004-median-of-two-sorted-arrays.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | double findMedianSortedArrays(vector& nums1, vector& nums2) { 4 | vector merged; 5 | for(int x : nums1) merged.push_back(x); 6 | for(int x : nums2) merged.push_back(x); 7 | sort(merged.begin(), merged.end()); 8 | if(merged.size() & 1) return merged[merged.size()/2]; 9 | return double(merged[merged.size()/2]+merged[merged.size()/2-1])/2; 10 | } 11 | }; -------------------------------------------------------------------------------- /0004-median-of-two-sorted-arrays/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0010-regular-expression-matching/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0011-container-with-most-water/0011-container-with-most-water.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int maxArea(vector& H) { 4 | int ans = 0, i = 0, j = H.size()-1, res = 0; 5 | while (i < j) { 6 | if (H[i] <= H[j]) { 7 | res = H[i] * (j - i); 8 | i++; 9 | } else { 10 | res = H[j] * (j - i); 11 | j--; 12 | } 13 | if (res > ans) ans = res; 14 | } 15 | return ans; 16 | } 17 | }; -------------------------------------------------------------------------------- /0011-container-with-most-water/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0015-3sum/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0017-letter-combinations-of-a-phone-number/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0024-swap-nodes-in-pairs/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0026-remove-duplicates-from-sorted-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0028-find-the-index-of-the-first-occurrence-in-a-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0030-substring-with-concatenation-of-all-words/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0034-find-first-and-last-position-of-element-in-sorted-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0041-first-missing-positive/0041-first-missing-positive.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int firstMissingPositive(vector& nums) { 4 | int n = nums.size(); 5 | for (int i = 0; i < n; i++) 6 | if (nums[i] <= 0) nums[i] = n + 1; 7 | for (int i = 0; i < n; i++) 8 | if (abs(nums[i]) <= n && nums[abs(nums[i]) - 1] > 0) nums[abs(nums[i]) - 1] *= -1; 9 | for (int i = 0; i < n; i++) 10 | if (nums[i] > 0) return i + 1; 11 | return n + 1; 12 | } 13 | }; -------------------------------------------------------------------------------- /0041-first-missing-positive/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0046-permutations/0046-permutations.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector> permute(vector& nums) { 4 | vector> res; 5 | sort(nums.begin(), nums.end()); 6 | do { 7 | res.push_back(nums); 8 | } 9 | while(next_permutation(nums.begin(), nums.end())); 10 | return res; 11 | } 12 | }; -------------------------------------------------------------------------------- /0046-permutations/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0048-rotate-image/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0050-powx-n/0050-powx-n.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | double myPow(double x, int n) { 4 | if(n == 0) return 1; 5 | if(n < 0) { 6 | n = abs(n); 7 | x = 1/x; 8 | } 9 | if(n%2 == 0) return myPow(x*x, n/2); 10 | else return x*myPow(x, n-1); 11 | } 12 | }; -------------------------------------------------------------------------------- /0050-powx-n/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0051-n-queens/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0058-length-of-last-word/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0059-spiral-matrix-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0060-permutation-sequence/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0062-unique-paths/0062-unique-paths.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | 4 | int dp[101][101]; 5 | 6 | int rec(int i, int j, int m, int n) { 7 | if(i > m or j > n) return 0; 8 | if(i == m and j == n) return 1; 9 | if(dp[i][j] != -1) return dp[i][j]; 10 | int op1 = rec(i+1, j, m, n); 11 | int op2 = rec(i, j+1, m, n); 12 | return dp[i][j] = op1+op2; 13 | } 14 | 15 | int uniquePaths(int m, int n) { 16 | memset(dp, -1, sizeof dp); 17 | return rec(1, 1, m, n); 18 | } 19 | }; -------------------------------------------------------------------------------- /0062-unique-paths/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0063-unique-paths-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0064-minimum-path-sum/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0068-text-justification/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0070-climbing-stairs/0070-climbing-stairs.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int climbStairs(int n) { 4 | if(n == 1) return 1; 5 | if(n == 2) return 2; 6 | int dp[n]; 7 | dp[0] = 1; 8 | dp[1] = 2; 9 | for(int i = 2 ; i < n ; i++) dp[i] = dp[i-1]+dp[i-2]; 10 | return dp[n-1]; 11 | } 12 | }; -------------------------------------------------------------------------------- /0070-climbing-stairs/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0071-simplify-path/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0072-edit-distance/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0073-set-matrix-zeroes/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0074-search-a-2d-matrix/0074-search-a-2d-matrix.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool searchMatrix(vector>& matrix, int target) { 4 | int n = matrix.size(), m = matrix[0].size(); 5 | int i = 0, j = m-1; 6 | while(i < n and j >= 0) 7 | { 8 | if(matrix[i][j] == target) return true; 9 | else if(matrix[i][j] > target) j--; 10 | else i++; 11 | } 12 | return false; 13 | } 14 | }; -------------------------------------------------------------------------------- /0074-search-a-2d-matrix/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0076-minimum-window-substring/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0078-subsets/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0079-word-search/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0086-partition-list/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0088-merge-sorted-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0091-decode-ways/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0095-unique-binary-search-trees-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0097-interleaving-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0098-validate-binary-search-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0100-same-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0102-binary-tree-level-order-traversal/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0103-binary-tree-zigzag-level-order-traversal/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0107-binary-tree-level-order-traversal-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0110-balanced-binary-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0111-minimum-depth-of-binary-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0118-pascals-triangle/0118-pascals-triangle.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector> generate(int numRows) { 4 | vector> res(numRows); 5 | for(int i = 0 ; i < numRows ; i++) 6 | { 7 | res[i].resize(i+1); 8 | res[i][0] = res[i][i] = 1; // the most left side + most right + top one should be always one 9 | for(int j = 1 ; j < i ; j++) 10 | { 11 | res[i][j] = res[i-1][j-1]+res[i-1][j]; 12 | } 13 | } 14 | return res; 15 | } 16 | }; -------------------------------------------------------------------------------- /0118-pascals-triangle/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0121-best-time-to-buy-and-sell-stock/0121-best-time-to-buy-and-sell-stock.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int maxProfit(vector& prices) { 4 | int maxprofit = 0, buy = INT_MAX; 5 | 6 | for(int i = 0 ; i < prices.size() ; i++) { 7 | buy = min(buy, prices[i]); 8 | 9 | maxprofit = max(maxprofit, prices[i] - buy); 10 | 11 | } 12 | 13 | return maxprofit; 14 | 15 | } 16 | }; -------------------------------------------------------------------------------- /0121-best-time-to-buy-and-sell-stock/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0124-binary-tree-maximum-path-sum/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0131-palindrome-partitioning/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0135-candy/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0137-single-number-ii/0137-single-number-ii.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int singleNumber(vector& nums) { 4 | mapmp; 5 | for(int x : nums) mp[x]++; 6 | for(auto it : mp) { 7 | if(it.second == 1) return it.first; 8 | } 9 | return -1; 10 | } 11 | }; -------------------------------------------------------------------------------- /0137-single-number-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0138-copy-list-with-random-pointer/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0140-word-break-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0141-linked-list-cycle/0141-linked-list-cycle.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Definition for singly-linked list. 3 | * struct ListNode { 4 | * int val; 5 | * ListNode *next; 6 | * ListNode(int x) : val(x), next(NULL) {} 7 | * }; 8 | */ 9 | class Solution { 10 | public: 11 | bool hasCycle(ListNode *head) { 12 | ListNode* slow = head, *fast = head; 13 | while(fast && fast->next) { 14 | slow = slow->next; 15 | fast = fast->next->next; 16 | if(slow == fast) return true; 17 | } 18 | return false; 19 | } 20 | }; -------------------------------------------------------------------------------- /0141-linked-list-cycle/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0143-reorder-list/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0146-lru-cache/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0149-max-points-on-a-line/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0151-reverse-words-in-a-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0165-compare-version-numbers/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0178-rank-scores/0178-rank-scores.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | score, 3 | DENSE_RANK() OVER(ORDER BY score desc) AS `rank` 4 | FROM scores 5 | ORDER BY `rank` -------------------------------------------------------------------------------- /0178-rank-scores/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0179-largest-number/0179-largest-number.cpp: -------------------------------------------------------------------------------- 1 | class compare{ 2 | public: 3 | bool operator()(int a, int b){ 4 | string s1 = to_string(a), s2=to_string(b); 5 | return s1+s2 > s2+s1; 6 | } 7 | }; 8 | class Solution { 9 | public: 10 | string largestNumber(vector& nums) { 11 | sort(begin(nums),end(nums), compare()); 12 | string s=""; 13 | for(auto &n : nums) s+=to_string(n); 14 | if(nums[0]==0) return "0"; 15 | return s; 16 | } 17 | }; -------------------------------------------------------------------------------- /0179-largest-number/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0180-consecutive-numbers/0180-consecutive-numbers.sql: -------------------------------------------------------------------------------- 1 | # Write your MySQL query statement below 2 | with cte as ( 3 | select num, 4 | lead(num,1) over() num1, 5 | lead(num,2) over() num2 6 | from logs 7 | 8 | ) 9 | 10 | select distinct num ConsecutiveNums from cte where (num=num1) and (num=num2) -------------------------------------------------------------------------------- /0180-consecutive-numbers/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0184-department-highest-salary/0184-department-highest-salary.sql: -------------------------------------------------------------------------------- 1 | # Write your MySQL query statement below 2 | select 3 | d.name AS Department, 4 | e.name as Employee, 5 | e.salary 6 | from 7 | employee e 8 | join department d on e.departmentId = d.id 9 | where e.salary = (select max(salary) from employee where departmentId = e.departmentId) -------------------------------------------------------------------------------- /0184-department-highest-salary/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0185-department-top-three-salaries/0185-department-top-three-salaries.sql: -------------------------------------------------------------------------------- 1 | # Write your MySQL query statement below 2 | select b.Name as Department, a.Name as Employee, Salary 3 | from 4 | (select *, dense_rank() over(partition by DepartmentId order by Salary DESC) as ranks 5 | from Employee) a 6 | join Department b 7 | on a.DepartmentId = b.Id 8 | where ranks <= 3 -------------------------------------------------------------------------------- /0185-department-top-three-salaries/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0188-best-time-to-buy-and-sell-stock-iv/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0190-reverse-bits/0190-reverse-bits.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | uint32_t reverseBits(uint32_t n) { 4 | uint32_t res = 0; 5 | 6 | for (int i = 0; i < 32; i++) { 7 | res <<= 1; 8 | res += n % 2; 9 | n >>= 1; 10 | } 11 | 12 | return res; 13 | } 14 | }; -------------------------------------------------------------------------------- /0190-reverse-bits/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0191-number-of-1-bits/0191-number-of-1-bits.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int hammingWeight(uint32_t n) { 4 | return __builtin_popcount(n); 5 | } 6 | }; -------------------------------------------------------------------------------- /0191-number-of-1-bits/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0198-house-robber/0198-house-robber.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | 4 | int dp[101]; 5 | 6 | int rec(int i, vector &nums) { 7 | if(i >= nums.size()) return 0; 8 | if(dp[i] != -1) return dp[i]; 9 | int chori = nums[i] + rec(i+2, nums); 10 | int skip = 0 + rec(i+1, nums); 11 | return dp[i] = max(chori, skip); 12 | } 13 | 14 | int rob(vector& nums) { 15 | memset(dp, -1, sizeof dp); 16 | return rec(0, nums); 17 | } 18 | }; -------------------------------------------------------------------------------- /0198-house-robber/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0200-number-of-islands/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0204-count-primes/0204-count-primes.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | 4 | int countPrimes(int n) { 5 | if(n == 0) return 0; 6 | int cnt = 0; 7 | vector primes(n+1, 1); 8 | primes[0] = 0; 9 | primes[1] = 0; 10 | for (int i = 2; i * i < n ; i++) { 11 | if (primes[i] == true) { 12 | for (int j = i * i; j < n; j += i) { 13 | primes[j] = 0; 14 | } 15 | } 16 | } 17 | for(int i = 1 ; i <= n-1 ; i++) if(primes[i] == 1) cnt++; 18 | return cnt; 19 | } 20 | }; -------------------------------------------------------------------------------- /0204-count-primes/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0205-isomorphic-strings/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0207-course-schedule/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0209-minimum-size-subarray-sum/0209-minimum-size-subarray-sum.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int minSubArrayLen(int target, vector& nums) { 4 | int start=0,end=0,n=nums.size(),sum=0; 5 | int ans=n+1; 6 | while(end < n) { 7 | sum += nums[end++]; 8 | while(sum >= target) { 9 | ans = min(end-start, ans); 10 | sum -= nums[start++]; 11 | } 12 | } 13 | if(ans == n+1) return 0; 14 | return ans; 15 | } 16 | }; -------------------------------------------------------------------------------- /0209-minimum-size-subarray-sum/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0212-word-search-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0215-kth-largest-element-in-an-array/0215-kth-largest-element-in-an-array.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int findKthLargest(vector& nums, int k) { 4 | partial_sort(nums.begin(), nums.begin() + k, nums.end(), greater()); 5 | return nums[k - 1]; 6 | } 7 | }; -------------------------------------------------------------------------------- /0215-kth-largest-element-in-an-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0222-count-complete-tree-nodes/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0223-rectangle-area/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0225-implement-stack-using-queues/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0229-majority-element-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0230-kth-smallest-element-in-a-bst/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0231-power-of-two/0231-power-of-two.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool isPowerOfTwo(int n) { 4 | return (n > 0 && !(n & (n - 1))); 5 | } 6 | }; -------------------------------------------------------------------------------- /0231-power-of-two/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0234-palindrome-linked-list/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0235-lowest-common-ancestor-of-a-binary-search-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0236-lowest-common-ancestor-of-a-binary-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0237-delete-node-in-a-linked-list/0237-delete-node-in-a-linked-list.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Definition for singly-linked list. 3 | * struct ListNode { 4 | * int val; 5 | * ListNode *next; 6 | * ListNode(int x) : val(x), next(NULL) {} 7 | * }; 8 | */ 9 | class Solution { 10 | public: 11 | void deleteNode(ListNode* node) { 12 | *node = *node->next; 13 | } 14 | }; -------------------------------------------------------------------------------- /0237-delete-node-in-a-linked-list/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0238-product-of-array-except-self/0238-product-of-array-except-self.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector productExceptSelf(vector& nums) { 4 | int len = nums.size(), prod = nums[len - 1]; 5 | vector res(len); 6 | if (!len) return res; 7 | res[0] = 1; 8 | for (int i = 1; i < len; i++) res[i] = res[i - 1] * nums[i - 1]; 9 | for (int i = --len - 1; i >= 0; --i) { 10 | res[i] *= prod; 11 | prod *= nums[i]; 12 | } 13 | return res; 14 | } 15 | }; -------------------------------------------------------------------------------- /0238-product-of-array-except-self/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0241-different-ways-to-add-parentheses/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0242-valid-anagram/0242-valid-anagram.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool isAnagram(string s, string t) { 4 | sort(s.begin(), s.end()); 5 | sort(t.begin(), t.end()); 6 | 7 | return s == t; 8 | } 9 | }; -------------------------------------------------------------------------------- /0242-valid-anagram/0242-valid-anagram.java: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public boolean isAnagram(String s, String t) { 3 | int[] alpha = new int[26]; 4 | 5 | for(int i = 0 ; i < s.length() ; i++) alpha[s.charAt(i) - 'a']++; 6 | for(int i = 0 ; i < t.length() ; i++) alpha[t.charAt(i) - 'a']--; 7 | 8 | for(int i : alpha) 9 | { 10 | if(i != 0) return false; 11 | } 12 | return true; 13 | } 14 | } -------------------------------------------------------------------------------- /0242-valid-anagram/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0258-add-digits/0258-add-digits.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int addDigits(int num) { 4 | string s = to_string(num); 5 | while(s.size() > 1) { 6 | int temp = 0; 7 | while(num) { 8 | temp += num % 10; 9 | num /= 10; 10 | } 11 | num = temp; 12 | s = to_string(num); 13 | } 14 | return num; 15 | } 16 | }; -------------------------------------------------------------------------------- /0258-add-digits/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0260-single-number-iii/0260-single-number-iii.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector singleNumber(vector& nums) { 4 | unordered_mapcnt; 5 | for(int i = 0 ; i ans; 9 | for(auto it: cnt){ 10 | if(it.second == 1)ans.push_back(it.first); 11 | } 12 | return ans; 13 | } 14 | }; -------------------------------------------------------------------------------- /0260-single-number-iii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0263-ugly-number/0263-ugly-number.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool isUgly(int num){ 4 | if (num <= 0) return false; 5 | while(num % 3 == 0) num /= 3; 6 | while(num % 5 == 0) num /= 5; 7 | return (num & (num - 1)) == 0; 8 | } 9 | }; -------------------------------------------------------------------------------- /0263-ugly-number/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0279-perfect-squares/0279-perfect-squares.cpp: -------------------------------------------------------------------------------- 1 | #define f(i, a, b) for(int i = a ; i <= b ; i++); 2 | class Solution { 3 | public: 4 | int solve(int n, vector &dp) { 5 | if (n == 0) return 0; 6 | if (dp[n] != -1) return dp[n]; 7 | dp[n] = INT_MAX; 8 | for(int i = 1 ; i*i <= n ; i++) { 9 | dp[n] = min(dp[n], solve(n-(i*i), dp)+1); 10 | } 11 | return dp[n]; 12 | } 13 | int numSquares(int n) { 14 | vector dp(n+1, -1); 15 | int ans = solve(n, dp); 16 | return ans; 17 | } 18 | }; -------------------------------------------------------------------------------- /0279-perfect-squares/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0287-find-the-duplicate-number/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0295-find-median-from-data-stream/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0300-longest-increasing-subsequence/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0310-minimum-height-trees/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0319-bulb-switcher/0319-bulb-switcher.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int bulbSwitch(int n) { 4 | int cnt = 0; 5 | for (int i = 1 ; i*i <= n ; i++) cnt++; 6 | return cnt; 7 | } 8 | }; -------------------------------------------------------------------------------- /0319-bulb-switcher/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0326-power-of-three/0326-power-of-three.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool isPowerOfThree(int n) { 4 | return n > 0 && 1162261467 % n == 0; 5 | // pow(3, floor(log(INT_MAX)/log(3))) = 1162261467 6 | } 7 | }; -------------------------------------------------------------------------------- /0326-power-of-three/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0327-count-of-range-sum/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0329-longest-increasing-path-in-a-matrix/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0330-patching-array/0330-patching-array.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int minPatches(vector& nums, int n) { 4 | int cnt=0,i=0; 5 | long long maxNum=0; 6 | while (maxNum countBits(int n) { 4 | vectorans; 5 | for(int i = 0 ; i <= n ; i++){ 6 | ans.push_back(__builtin_popcount(i)); // __builtin_popcount is a stl function used to count no of setbits in an integer 7 | } 8 | return ans; 9 | } 10 | }; -------------------------------------------------------------------------------- /0338-counting-bits/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0342-power-of-four/0342-power-of-four.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool isPowerOfFour(int n) { 4 | if(n < 0) return false; 5 | return ((n-1)&n)==0 and (n-1)%3==0; // should be power of 2 and n-1 should be divisible by 3 6 | } 7 | }; -------------------------------------------------------------------------------- /0342-power-of-four/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0343-integer-break/0343-integer-break.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int integerBreak(int n) { 4 | return ((n>3)?pow(3,n/3-((n%3)&1))*pow(2,(n+n%3)%3):n-1); 5 | } 6 | }; -------------------------------------------------------------------------------- /0343-integer-break/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0344-reverse-string/0344-reverse-string.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | void reverseString(vector& s) { 4 | int i = 0, j = s.size()-1; 5 | while(i <= j) 6 | { 7 | swap(s[i], s[j]); 8 | i++; 9 | j--; 10 | } 11 | } 12 | }; -------------------------------------------------------------------------------- /0344-reverse-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0345-reverse-vowels-of-a-string/0345-reverse-vowels-of-a-string.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | string reverseVowels(string s) { 4 | int lo = 0, hi = s.length() - 1; 5 | while (lo < hi) { 6 | lo = s.find_first_of("aeiouAEIOU", lo); 7 | hi = s.find_last_of("aeiouAEIOU", hi); 8 | if (lo < hi) swap(s[lo++], s[hi--]); 9 | } 10 | return s; 11 | } 12 | }; -------------------------------------------------------------------------------- /0345-reverse-vowels-of-a-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0347-top-k-frequent-elements/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0373-find-k-pairs-with-smallest-sums/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0377-combination-sum-iv/0377-combination-sum-iv.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int combinationSum4(vector& nums, int target) { 4 | vector result(target + 1); 5 | result[0] = 1; 6 | for (int i = 1; i <= target; ++i) { 7 | for (int x : nums) { 8 | if (i >= x) result[i] += result[i - x]; 9 | } 10 | } 11 | 12 | return result[target]; 13 | } 14 | }; -------------------------------------------------------------------------------- /0377-combination-sum-iv/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0389-find-the-difference/0389-find-the-difference.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | char findTheDifference(string s, string t) { 4 | for(int i=0;ic &&k) 8 | { 9 | ans.pop_back(); 10 | k--; 11 | } 12 | if(ans.size()||c!='0')ans.push_back(c); 13 | } 14 | while(ans.size()&&k--) 15 | { 16 | ans.pop_back(); 17 | } 18 | return (ans=="")?"0":ans; 19 | } 20 | }; -------------------------------------------------------------------------------- /0402-remove-k-digits/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0403-frog-jump/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0404-sum-of-left-leaves/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0405-convert-a-number-to-hexadecimal/0405-convert-a-number-to-hexadecimal.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | string toHex(int num) { 4 | unsigned int ourNum = num; 5 | 6 | string str = ""; 7 | char ourArray[17] = "0123456789abcdef"; 8 | 9 | do { 10 | str += ourArray[ourNum % 16]; 11 | ourNum /= 16; 12 | } while (ourNum); 13 | 14 | return {str.rbegin(), str.rend()}; 15 | } 16 | }; -------------------------------------------------------------------------------- /0405-convert-a-number-to-hexadecimal/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0409-longest-palindrome/0409-longest-palindrome.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int longestPalindrome(string s) { 4 | int freq[128]={}; 5 | for(auto c:s) ++freq[c]; 6 | int OddGroup = 0; 7 | for(auto i:freq) OddGroup += i & 1; 8 | return s.size() - OddGroup + (OddGroup > 0); 9 | } 10 | }; -------------------------------------------------------------------------------- /0409-longest-palindrome/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0433-minimum-genetic-mutation/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0435-non-overlapping-intervals/0435-non-overlapping-intervals.cpp: -------------------------------------------------------------------------------- 1 | bool comp(vector &a,vector &b) { 2 | return a[1]>& intervals) { 7 | int ans=-1; 8 | if(intervals.size()==0) return 0; 9 | sort(intervals.begin(),intervals.end(),comp); 10 | vector prev= intervals[0]; 11 | for(vector i: intervals) { 12 | if(prev[1]>i[0]) { 13 | ans++; 14 | }else prev=i; 15 | } 16 | return ans; 17 | } 18 | }; -------------------------------------------------------------------------------- /0435-non-overlapping-intervals/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0442-find-all-duplicates-in-an-array/0442-find-all-duplicates-in-an-array.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector findDuplicates(vector& nums) { 4 | if(nums.empty())return {}; 5 | vectorans; 6 | for(int i=0;i>& points) { 4 | sort(points.begin(), points.end()); 5 | int lastpoint = points[0][1]; 6 | int ans = 1; 7 | for(auto point : points) { 8 | if(point[0] > lastpoint) { 9 | ans++; 10 | lastpoint = point[1]; 11 | } 12 | lastpoint = min(point[1],lastpoint); 13 | } 14 | return ans; 15 | } 16 | }; -------------------------------------------------------------------------------- /0452-minimum-number-of-arrows-to-burst-balloons/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0455-assign-cookies/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0456-132-pattern/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0459-repeated-substring-pattern/0459-repeated-substring-pattern.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool repeatedSubstringPattern(string str) { 4 | int i = 1, j = 0, n = str.size(); 5 | vector dp(n+1,0); 6 | while( i < str.size() ){ 7 | if( str[i] == str[j] ) dp[++i]=++j; 8 | else if( j == 0 ) i++; 9 | else j = dp[j]; 10 | } 11 | return dp[n]&&dp[n]%(n-dp[n])==0; 12 | } 13 | }; -------------------------------------------------------------------------------- /0459-repeated-substring-pattern/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0501-find-mode-in-binary-search-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0513-find-bottom-left-tree-value/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0515-find-largest-value-in-each-tree-row/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0518-coin-change-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0525-contiguous-array/0525-contiguous-array.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int findMaxLength(vector& nums) { 4 | vector arr(2*nums.size() + 1, INT_MIN); 5 | arr[nums.size()] = -1; 6 | int maxLen = 0, sum = 0; 7 | for (int i = 0; i < nums.size(); i++) { 8 | sum += (nums[i] == 0 ? -1 : 1); 9 | if (arr[sum + nums.size()] >= -1) maxLen = max(maxLen, i - arr[sum + nums.size()]); 10 | else arr[sum + nums.size()] = i; 11 | } 12 | return maxLen; 13 | } 14 | }; -------------------------------------------------------------------------------- /0525-contiguous-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0530-minimum-absolute-difference-in-bst/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0543-diameter-of-binary-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0547-number-of-provinces/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0552-student-attendance-record-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0557-reverse-words-in-a-string-iii/0557-reverse-words-in-a-string-iii.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | string reverseWords(string s) { 4 | if(s.size()==0) return ""; 5 | stringstream ss(s); 6 | string word; 7 | string res=""; 8 | while(ss>>word){ 9 | reverse(word.begin(),word.end()); 10 | res+=word; 11 | res+=" "; 12 | } 13 | res.erase(res.size() - 1); 14 | return res; 15 | } 16 | }; -------------------------------------------------------------------------------- /0557-reverse-words-in-a-string-iii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0577-employee-bonus/0577-employee-bonus.sql: -------------------------------------------------------------------------------- 1 | # Write your MySQL query statement below 2 | SELECT name, bonus 3 | FROM Employee NATURAL LEFT OUTER JOIN Bonus 4 | WHERE bonus < 1000 OR bonus IS NULL; -------------------------------------------------------------------------------- /0577-employee-bonus/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0587-erect-the-fence/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0598-range-addition-ii/0598-range-addition-ii.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int maxCount(int m, int n, vector>& op) { 4 | int res_m = m, res_n = n; 5 | 6 | for (auto op : op) { 7 | res_m = min(res_m, op[0]); 8 | res_n = min(res_n, op[1]); 9 | } 10 | 11 | return res_m * res_n; 12 | } 13 | }; -------------------------------------------------------------------------------- /0605-can-place-flowers/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0620-not-boring-movies/0620-not-boring-movies.sql: -------------------------------------------------------------------------------- 1 | select * 2 | from Cinema 3 | where (id % 2) = 1 and description != "boring" 4 | order by rating desc -------------------------------------------------------------------------------- /0620-not-boring-movies/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0621-task-scheduler/0621-task-scheduler.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int leastInterval(vector& tasks, int n) { 4 | unordered_mapmp; 5 | int count = 0; 6 | for(auto e : tasks) 7 | { 8 | mp[e]++; 9 | count = max(count, mp[e]); 10 | } 11 | 12 | int ans = (count-1)*(n+1); 13 | for(auto e : mp) if(e.second == count) ans++; 14 | return max((int)tasks.size(), ans); 15 | } 16 | }; -------------------------------------------------------------------------------- /0621-task-scheduler/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0623-add-one-row-to-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0633-sum-of-square-numbers/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0637-average-of-levels-in-binary-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0646-maximum-length-of-pair-chain/0646-maximum-length-of-pair-chain.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int findLongestChain(vector>& pairs) { 4 | sort(pairs.begin(),pairs.end()); 5 | 6 | int curr=INT_MAX,res=0; 7 | 8 | for(int i=pairs.size()-1;i>=0;i--) 9 | { 10 | if(pairs[i][1]& nums, int k) { 4 | if (k == 0) return 0; 5 | int cnt = 0; 6 | int pro = 1; 7 | for (int i = 0, j = 0; j < nums.size(); j++) { 8 | pro *= nums[j]; 9 | while (i <= j && pro >= k) { 10 | pro /= nums[i++]; 11 | } 12 | cnt += j - i + 1; 13 | } 14 | return cnt; 15 | } 16 | }; -------------------------------------------------------------------------------- /0713-subarray-product-less-than-k/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0714-best-time-to-buy-and-sell-stock-with-transaction-fee/0714-best-time-to-buy-and-sell-stock-with-transaction-fee.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int maxProfit(vector& prices, int fee) { 4 | int s0 = 0, s1 = INT_MIN; 5 | for(int p:prices) { 6 | int tmp = s0; 7 | s0 = max(s0, s1+p); 8 | s1 = max(s1, tmp-p-fee); 9 | } 10 | return s0; 11 | } 12 | }; -------------------------------------------------------------------------------- /0714-best-time-to-buy-and-sell-stock-with-transaction-fee/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0726-number-of-atoms/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0735-asteroid-collision/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0744-find-smallest-letter-greater-than-target/0744-find-smallest-letter-greater-than-target.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | char nextGreatestLetter(vector& letters, char target) { 4 | char res = '|'; 5 | for(char ch : letters) { 6 | if(ch > target) { 7 | res = min(res, ch); 8 | } 9 | } 10 | if(res == '|') return letters[0]; 11 | return res; 12 | } 13 | }; -------------------------------------------------------------------------------- /0744-find-smallest-letter-greater-than-target/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0746-min-cost-climbing-stairs/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0747-largest-number-at-least-twice-of-others/0747-largest-number-at-least-twice-of-others.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int dominantIndex(vector& nums) { 4 | int cnt = 0; 5 | int mx = *max_element(nums.begin(), nums.end()); 6 | int ind = 0; 7 | for(int i = 0 ; i < nums.size() ; i++) { 8 | if(nums[i] != mx and nums[i] * 2 > mx) return -1; 9 | if(nums[i] == mx) ind = i; 10 | } 11 | return ind; 12 | } 13 | }; -------------------------------------------------------------------------------- /0747-largest-number-at-least-twice-of-others/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0768-max-chunks-to-make-sorted-ii/0768-max-chunks-to-make-sorted-ii.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int maxChunksToSorted(vector& arr) { 4 | long int sum1 = 0, sum2 = 0, ans = 0; 5 | vector t = arr; 6 | sort(t.begin(), t.end()); 7 | for(int i = 0; i < arr.size(); i++) { 8 | sum1 += t[i]; 9 | sum2 += arr[i]; 10 | if(sum1 == sum2) ans++; 11 | } 12 | return ans; 13 | } 14 | }; -------------------------------------------------------------------------------- /0768-max-chunks-to-make-sorted-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0778-swim-in-rising-water/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0779-k-th-symbol-in-grammar/0779-k-th-symbol-in-grammar.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int kthGrammar(int n, int k) { 4 | if (n == 1) return 0; 5 | int length = 1 << (n - 2); 6 | if (k <= length) return kthGrammar(n - 1, k); 7 | else return 1 - kthGrammar(n - 1, k - length); 8 | } 9 | }; -------------------------------------------------------------------------------- /0779-k-th-symbol-in-grammar/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0785-is-graph-bipartite/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0787-cheapest-flights-within-k-stops/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0791-custom-sort-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0797-all-paths-from-source-to-target/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0799-champagne-tower/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0802-find-eventual-safe-states/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0808-soup-servings/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0837-new-21-game/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0839-similar-string-groups/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0841-keys-and-rooms/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0844-backspace-string-compare/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0847-shortest-path-visiting-all-nodes/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0848-shifting-letters/0848-shifting-letters.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | 4 | string shiftingLetters(string s, vector& shifts) { 5 | long long sum = 0; 6 | for(auto it : shifts) 7 | { 8 | sum += (long long)it; // if we use accumulate(shifts.begin(), shifts.end(), 0) , it gives TLE 9 | } 10 | for(int i = 0 ; i < s.size() ; i++) 11 | { 12 | s[i] = (s[i]-'a' + sum)%26+97; 13 | sum -= shifts[i]; 14 | } 15 | return s; 16 | } 17 | }; 18 | 19 | // abc 20 | // dbc 21 | // igc 22 | // rpl -------------------------------------------------------------------------------- /0848-shifting-letters/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0850-rectangle-area-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0852-peak-index-in-a-mountain-array/0852-peak-index-in-a-mountain-array.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int peakIndexInMountainArray(vector& arr) { 4 | int left = 0; 5 | while (arr[left] < arr[left+1]) left++; 6 | return left; 7 | } 8 | }; -------------------------------------------------------------------------------- /0852-peak-index-in-a-mountain-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0859-buddy-strings/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0863-all-nodes-distance-k-in-binary-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0864-shortest-path-to-get-all-keys/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0876-middle-of-the-linked-list/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0879-profitable-schemes/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0880-decoded-string-at-index/0880-decoded-string-at-index.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | string decodeAtIndex(string S, int K) { 4 | long N = 0, i; 5 | for (i = 0; N < K; ++i) 6 | N = isdigit(S[i]) ? N * (S[i] - '0') : N + 1; 7 | while (i--) 8 | if (isdigit(S[i])) 9 | N /= S[i] - '0', K %= N; 10 | else if (K % N-- == 0) 11 | return string(1, S[i]); 12 | return "lee215"; 13 | } 14 | 15 | }; -------------------------------------------------------------------------------- /0880-decoded-string-at-index/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0881-boats-to-save-people/0881-boats-to-save-people.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int numRescueBoats(vector& people, int limit) { 4 | sort(people.begin(), people.end()); 5 | int n = people.size(); 6 | int l = 0, r = n-1; 7 | int ans = 0; 8 | 9 | while(l <= r) { 10 | if(people[r] + people[l] <= limit) l++; 11 | r--; 12 | ans++; 13 | } 14 | return ans; 15 | } 16 | }; -------------------------------------------------------------------------------- /0881-boats-to-save-people/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0894-all-possible-full-binary-trees/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0896-monotonic-array/0896-monotonic-array.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool isMonotonic(vector& nums) { 4 | vector poo = nums; 5 | reverse(poo.begin(), poo.end()); 6 | return is_sorted(begin(nums), end(nums)) or is_sorted(poo.begin(), poo.end()); 7 | } 8 | }; -------------------------------------------------------------------------------- /0896-monotonic-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0904-fruit-into-baskets/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0905-sort-array-by-parity/0905-sort-array-by-parity.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector sortArrayByParity(vector& A) { 4 | auto is_even = [] (auto e) { return e % 2 == 0; }; 5 | partition (A.begin (), A.end (), is_even); 6 | return A; 7 | } 8 | }; -------------------------------------------------------------------------------- /0905-sort-array-by-parity/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0920-number-of-music-playlists/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0934-shortest-bridge/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0945-minimum-increment-to-make-array-unique/0945-minimum-increment-to-make-array-unique.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int minIncrementForUnique(vector& A) { 4 | int s = A.size(); 5 | int res=0; 6 | if (s<2) return 0; 7 | sort(A.begin(),A.end()); 8 | for (int i=1; i& A, int K) { 4 | vector count(K); 5 | count[0] = 1; 6 | int prefix = 0, res = 0; 7 | for (int a : A) { 8 | prefix = (prefix + a % K + K) % K; 9 | res += count[prefix]++; 10 | } 11 | return res; 12 | } 13 | }; -------------------------------------------------------------------------------- /0974-subarray-sums-divisible-by-k/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0979-distribute-coins-in-binary-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0980-unique-paths-iii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0988-smallest-string-starting-from-leaf/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0992-subarrays-with-k-different-integers/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0997-find-the-town-judge/0997-find-the-town-judge.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int findJudge(int n, vector>& trust) { 4 | if(trust.size() == 0 and n == 1) return 1; 5 | vector in(n+1, 0), out(n+1, 0); 6 | for(int i = 0 ; i < trust.size() ; i++) 7 | { 8 | in[trust[i][0]]++; 9 | out[trust[i][1]]++; 10 | } 11 | for(int i = 0 ; i <= n ; i++) 12 | { 13 | if(in[i] == 0 and out[i] == n-1) return i; 14 | } 15 | return -1; 16 | } 17 | }; -------------------------------------------------------------------------------- /0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div1248-count-number-of-nice-subarrays/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div1734-decode-xored-permutation/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div1789-primary-department-for-each-employee/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div2196-create-binary-tree-from-descriptions/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div2285-maximum-total-importance-of-roads/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div2721-execute-asynchronous-functions-in-parallel/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div2908-minimum-sum-of-mountain-triplets-i/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div2956-find-common-elements-between-two-arrays/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div3283-maximum-number-of-moves-to-kill-all-pawns/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1002-find-common-characters/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /10035-maximum-area-of-longest-diagonal-rectangle/10035-maximum-area-of-longest-diagonal-rectangle.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int areaOfMaxDiagonal(vector>& dimensions) { 4 | int area = 0, diag = 0; 5 | for(auto d : dimensions){ 6 | int t = d[0] * d[0] + d[1]*d[1]; 7 | if(t > diag || (t == diag && d[0]*d[1] > area)){ 8 | diag = t; 9 | area = d[0]*d[1]; 10 | } 11 | } 12 | return area; 13 | } 14 | }; -------------------------------------------------------------------------------- /10035-maximum-area-of-longest-diagonal-rectangle/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1011-capacity-to-ship-packages-within-d-days/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1026-maximum-difference-between-node-and-ancestor/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1027-longest-arithmetic-subsequence/1027-longest-arithmetic-subsequence.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int longestArithSeqLength(vector& A) { 4 | int len = A.size(); 5 | int maxLen = 1; 6 | vector> dp(A.size(), vector(1001, 1)); 7 | for (int i = 1; i < A.size(); i++) { 8 | for (int j = 0; j < i; j++) { 9 | int index = A[i] - A[j] + 500; 10 | dp[i][index] = max(dp[i][index], dp[j][index] + 1); 11 | maxLen = max(maxLen, dp[i][index]); 12 | } 13 | } 14 | return maxLen; 15 | } 16 | }; -------------------------------------------------------------------------------- /1027-longest-arithmetic-subsequence/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1035-uncrossed-lines/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1038-binary-search-tree-to-greater-sum-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /104-maximum-depth-of-binary-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1046-last-stone-weight/1046-last-stone-weight.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int lastStoneWeight(vector& A) { 4 | priority_queue pq(begin(A), end(A)); 5 | while (pq.size() > 1) { 6 | int x = pq.top(); pq.pop(); 7 | int y = pq.top(); pq.pop(); 8 | if (x > y) pq.push(x - y); 9 | } 10 | return pq.empty() ? 0 : pq.top(); 11 | } 12 | }; -------------------------------------------------------------------------------- /1046-last-stone-weight/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1047-remove-all-adjacent-duplicates-in-string/1047-remove-all-adjacent-duplicates-in-string.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | string removeDuplicates(string S) { 4 | string res = ""; 5 | for (char ch : S) 6 | if (res.size() && ch == res.back()) // pop elements till u get equal characters 7 | res.pop_back(); 8 | else 9 | res.push_back(ch); // else keep pushing 10 | return res; 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /1047-remove-all-adjacent-duplicates-in-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1048-longest-string-chain/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1051-height-checker/1051-height-checker.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int heightChecker(vector& heights) { 4 | vectorexpected; 5 | for(int i=0;i relativeSortArray(vector& arr1, vector& arr2) { 4 | map m; 5 | for (auto i : arr1) m[i]++; 6 | int pos = 0; 7 | for (auto j : arr2) { 8 | while(m[j]-- > 0) arr1[pos++] = j; 9 | } 10 | for (auto it : m) { 11 | while(it.second-- > 0) arr1[pos++] = it.first; 12 | } 13 | return arr1; 14 | } 15 | }; -------------------------------------------------------------------------------- /1122-relative-sort-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1125-smallest-sufficient-team/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1129-shortest-path-with-alternating-colors/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1130-minimum-cost-tree-from-leaf-values/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1137-n-th-tribonacci-number/1137-n-th-tribonacci-number.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int tribonacci(int n) { 4 | if(n == 0) return 0; 5 | vectordp(n+1, 0); 6 | if(n == 3) return 2; 7 | if(n == 2) return 1; 8 | if(n <= 1) return 1; 9 | dp[0] = 0; 10 | dp[1] = 1; 11 | dp[2] = 1; 12 | for(int i = 3 ; i <= n ; i++) 13 | { 14 | dp[i] = dp[i-1]+dp[i-2]+dp[i-3]; 15 | } 16 | return dp[n]; 17 | } 18 | }; -------------------------------------------------------------------------------- /1137-n-th-tribonacci-number/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1140-stone-game-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1143-longest-common-subsequence/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1146-snapshot-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /116-populating-next-right-pointers-in-each-node/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1160-find-words-that-can-be-formed-by-characters/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1161-maximum-level-sum-of-a-binary-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1171-remove-zero-sum-consecutive-nodes-from-linked-list/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1175-prime-arrangements/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1179-reformat-department-table/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1187-make-array-strictly-increasing/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1203-sort-items-by-groups-respecting-dependencies/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1208-get-equal-substrings-within-budget/1208-get-equal-substrings-within-budget.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int equalSubstring(string s, string t, int maxCost) { 4 | int i = 0, j = 0, N = s.size(), cost = 0, ans = 0; 5 | for (; j < N; ++j) { 6 | cost += abs(s[j] - t[j]); 7 | for (; cost > maxCost; ++i) cost -= abs(s[i] - t[i]); 8 | ans = max(ans, j - i + 1); 9 | } 10 | return ans; 11 | } 12 | }; -------------------------------------------------------------------------------- /1208-get-equal-substrings-within-budget/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /121-best-time-to-buy-and-sell-stock/121-best-time-to-buy-and-sell-stock.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int maxProfit(vector& prices) { 4 | int profit = -1, buy = INT_MAX; 5 | for(int i = 0 ; i < prices.size() ; i++) 6 | { 7 | buy = min(buy, prices[i]); 8 | profit = max(profit, prices[i]-buy); 9 | } 10 | return profit; 11 | } 12 | }; -------------------------------------------------------------------------------- /121-best-time-to-buy-and-sell-stock/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1218-longest-arithmetic-subsequence-of-given-difference/1218-longest-arithmetic-subsequence-of-given-difference.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int longestSubsequence(vector& arr, int diff) { 4 | vector diffArr(40001, 0); 5 | int ans = 1; 6 | for (int i : arr) 7 | { 8 | diffArr[i + 20000] = diffArr[i - diff + 20000] + 1; 9 | ans = max(ans, diffArr[i + 20000]); 10 | } 11 | return ans; 12 | } 13 | }; -------------------------------------------------------------------------------- /1218-longest-arithmetic-subsequence-of-given-difference/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1219-path-with-maximum-gold/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1226-the-dining-philosophers/1226-the-dining-philosophers.cpp: -------------------------------------------------------------------------------- 1 | class DiningPhilosophers { 2 | mutex mtx; // 5 philosophers share 1 single mutex 3 | public: 4 | DiningPhilosophers() { 5 | } 6 | void wantsToEat(int philosopher, function pickLeftFork, function pickRightFork, function eat, function putLeftFork, function putRightFork) 7 | { 8 | mtx.lock(); 9 | pickLeftFork(); 10 | pickRightFork(); 11 | eat(); 12 | putLeftFork(); 13 | putRightFork(); 14 | mtx.unlock(); 15 | } 16 | }; -------------------------------------------------------------------------------- /123-best-time-to-buy-and-sell-stock-iii/123-best-time-to-buy-and-sell-stock-iii.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int maxProfit(vector& prices) { 4 | int b1 = INT_MAX, b2 = INT_MAX; 5 | int profit1 = INT_MIN, profit2 = INT_MIN; 6 | for(int i = 0 ; i < prices.size() ; i++) 7 | { 8 | b1 = min(b1, prices[i]); 9 | profit1 = max(profit1, prices[i]-b1); 10 | b2 = min(b2, prices[i]-profit1); 11 | profit2 = max(profit2, prices[i]-b2); 12 | } 13 | return max(profit2, profit1); 14 | } 15 | }; -------------------------------------------------------------------------------- /123-best-time-to-buy-and-sell-stock-iii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1232-check-if-it-is-a-straight-line/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1249-minimum-remove-to-make-valid-parentheses/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1254-number-of-closed-islands/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1255-maximum-score-words-formed-by-letters/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1266-minimum-time-visiting-all-points/1266-minimum-time-visiting-all-points.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int minTimeToVisitAllPoints(vector>& p) { 4 | return inner_product(begin(p)+1, end(p), begin(p), 0, [](int s, int x){return s+x;}, [](auto& x, auto& y){return max(abs(x[0]-y[0]),abs(x[1]-y[1]));}); 5 | } 6 | }; -------------------------------------------------------------------------------- /1266-minimum-time-visiting-all-points/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1269-number-of-ways-to-stay-in-the-same-place-after-some-steps/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /127-word-ladder/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1282-group-the-people-given-the-group-size-they-belong-to/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1289-minimum-falling-path-sum-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1301-number-of-paths-with-max-score/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /131-palindrome-partitioning/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1312-minimum-insertion-steps-to-make-a-string-palindrome/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1317-convert-integer-to-the-sum-of-two-no-zero-integers/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1319-number-of-operations-to-make-network-connected/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1323-maximum-69-number/1323-maximum-69-number.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int maximum69Number (int num) { 4 | string n = to_string(num); 5 | for(int i = 0 ; i < n.length() ; i++) 6 | if(n[i] == '6') { 7 | n[i] = '9'; 8 | break; 9 | } 10 | return stoi(n); 11 | } 12 | }; -------------------------------------------------------------------------------- /1323-maximum-69-number/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1325-delete-leaves-with-a-given-value/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1335-minimum-difficulty-of-a-job-schedule/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1337-the-k-weakest-rows-in-a-matrix/1337-the-k-weakest-rows-in-a-matrix.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector kWeakestRows(vector>& mat, int k) { 4 | int n=mat[0].size(); 5 | for(int i=0; i ans(k); 10 | for(int i=0; i& nums) { 4 | int xr = 0; 5 | for(auto it : nums) xr ^= it; 6 | return xr; 7 | } 8 | }; -------------------------------------------------------------------------------- /136-single-number/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1361-validate-binary-tree-nodes/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1368-minimum-cost-to-make-at-least-one-valid-path-in-a-grid/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1372-longest-zigzag-path-in-a-binary-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1378-replace-employee-id-with-the-unique-identifier/1378-replace-employee-id-with-the-unique-identifier.sql: -------------------------------------------------------------------------------- 1 | select 2 | eu.unique_id as unique_id, e.name as name 3 | from Employees e left join EmployeeUNI eu on e.id = eu.id -------------------------------------------------------------------------------- /1378-replace-employee-id-with-the-unique-identifier/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1387-sort-integers-by-the-power-value/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /139-word-break/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1395-count-number-of-teams/1395-count-number-of-teams.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int numTeams(vector& rating) { 4 | int ans = 0; 5 | for(int i=1;irating[i]) r++; 11 | ans += l*r+(i-l)*(rating.size()-i-r-1); 12 | } 13 | return ans; 14 | } 15 | }; -------------------------------------------------------------------------------- /1395-count-number-of-teams/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1396-design-underground-system/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /14-longest-common-prefix/14-longest-common-prefix.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | string longestCommonPrefix(vector& strs) { 4 | sort(strs.begin(), strs.end()); 5 | int i = 0, j = 0; 6 | string res = ""; 7 | string s1 = strs[0], s2 = strs[strs.size()-1]; 8 | while(i < s1.length() && j < s2.length()) 9 | { 10 | if(s1[i] != s2[j]) break; 11 | res += s1[i]; 12 | i++; 13 | j++; 14 | } 15 | return res; 16 | } 17 | }; -------------------------------------------------------------------------------- /1402-reducing-dishes/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1406-stone-game-iii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1415-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1416-restore-the-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1422-maximum-score-after-splitting-a-string/1422-maximum-score-after-splitting-a-string.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int maxScore(string s) { 4 | int rightOnes = 0, leftZeroes = 0; 5 | for(char c: s) 6 | if(c=='1') rightOnes++; 7 | 8 | int score = 0; 9 | for(int i=0; i vowels = {'a', 'e', 'i', 'o', 'u'}; 5 | int max_count = 0, count = 0; 6 | for (int i = 0; i < s.length(); i++) { 7 | if (i >= k and vowels.count(s[i-k])) count--; 8 | if (vowels.count(s[i])) count++; 9 | max_count = max(max_count, count); 10 | } 11 | return max_count; 12 | } 13 | }; -------------------------------------------------------------------------------- /1456-maximum-number-of-vowels-in-a-substring-of-given-length/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1463-cherry-pickup-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1464-maximum-product-of-two-elements-in-an-array/1464-maximum-product-of-two-elements-in-an-array.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int maxProduct(vector& nums) { 4 | auto m1 = 0, m2 = 0; 5 | for (auto n: nums) { 6 | if (n > m1) 7 | m2 = exchange(m1, n); 8 | else 9 | m2 = max(m2, n); 10 | } 11 | return (m1 - 1) * (m2 - 1); 12 | } 13 | }; -------------------------------------------------------------------------------- /1464-maximum-product-of-two-elements-in-an-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1466-reorder-routes-to-make-all-paths-lead-to-the-city-zero/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1470-shuffle-the-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1480-running-sum-of-1d-array/1480-running-sum-of-1d-array.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector runningSum(vector& nums) { 4 | for(int i = 1 ; i < nums.size() ; i++) 5 | nums[i] = nums[i-1]+nums[i]; 6 | return nums; 7 | } 8 | }; -------------------------------------------------------------------------------- /1480-running-sum-of-1d-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1481-least-number-of-unique-integers-after-k-removals/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1482-minimum-number-of-days-to-make-m-bouquets/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1489-find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /149-max-points-on-a-line/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1491-average-salary-excluding-the-minimum-and-maximum-salary/1491-average-salary-excluding-the-minimum-and-maximum-salary.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | double average(vector& salary) { 4 | double sum = 0; 5 | double mx = *max_element(salary.begin(), salary.end()); 6 | double mn = *min_element(salary.begin(), salary.end()); 7 | for(auto it : salary) { 8 | if(it != mx and it != mn) sum += it; 9 | } 10 | return sum/(salary.size()-2); 11 | } 12 | }; -------------------------------------------------------------------------------- /1491-average-salary-excluding-the-minimum-and-maximum-salary/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1492-the-kth-factor-of-n/1492-the-kth-factor-of-n.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int kthFactor(int n, int k) { 4 | int fact = 1; 5 | vector facts; 6 | for(int i = 1 ; i <= n ; i++) { 7 | if(n % i == 0) facts.push_back(i); 8 | } 9 | if(facts.size() < k) return -1; 10 | return facts[k-1]; 11 | } 12 | }; -------------------------------------------------------------------------------- /1492-the-kth-factor-of-n/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1493-longest-subarray-of-1s-after-deleting-one-element/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1496-path-crossing/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1498-number-of-subsequences-that-satisfy-the-given-sum-condition/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /15-3sum/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1502-can-make-arithmetic-progression-from-sequence/1502-can-make-arithmetic-progression-from-sequence.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool canMakeArithmeticProgression(vector& arr) { 4 | sort(arr.begin(), arr.end()); 5 | if(arr.size() < 3) return true; 6 | for(int i = 1 ; i < arr.size()-1 ; i++) { 7 | if(arr[i] - arr[i-1] != arr[i+1] - arr[i]) return false; 8 | } 9 | return true; 10 | } 11 | }; -------------------------------------------------------------------------------- /1502-can-make-arithmetic-progression-from-sequence/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1512-number-of-good-pairs/1512-number-of-good-pairs.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int numIdenticalPairs(vector& nums) { 4 | int mem[101] ={0}; 5 | int sum=0; 6 | 7 | for(int i=0; i < nums.size(); i++){ 8 | sum += mem[nums[i]]; 9 | ++mem[nums[i]]; 10 | } 11 | 12 | return sum; 13 | } 14 | }; -------------------------------------------------------------------------------- /1512-number-of-good-pairs/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1514-path-with-maximum-probability/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1519-number-of-nodes-in-the-sub-tree-with-the-same-label/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1526-minimum-number-of-increments-on-subarrays-to-form-a-target-array/1526-minimum-number-of-increments-on-subarrays-to-form-a-target-array.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int minNumberOperations(vector& target) { 4 | int res = target[0]; 5 | for (int i = 1 ; i < target.size() ; i++) 6 | res += max(0, target[i] - target[i - 1]); 7 | return res; 8 | } 9 | }; -------------------------------------------------------------------------------- /1531-string-compression-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1535-find-the-winner-of-an-array-game/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1541-minimum-insertions-to-balance-a-parentheses-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1544-make-the-string-great/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1547-minimum-cost-to-cut-a-stick/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1552-magnetic-force-between-two-balls/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1557-minimum-number-of-vertices-to-reach-all-nodes/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1561-maximum-number-of-coins-you-can-get/1561-maximum-number-of-coins-you-can-get.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int maxCoins(vector& p) { 4 | int res = 0; 5 | sort(begin(p), end(p)); 6 | for (int j = p.size() / 3; j < p.size(); j += 2) 7 | res += p[j]; 8 | return res; 9 | } 10 | }; -------------------------------------------------------------------------------- /1561-maximum-number-of-coins-you-can-get/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1569-number-of-ways-to-reorder-array-to-get-same-bst/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1572-matrix-diagonal-sum/1572-matrix-diagonal-sum.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int diagonalSum(vector>& mat) { 4 | int n=mat.size(),ans=0; 5 | for(int i=0;i& nums) { 4 | int lo = 0, hi = nums.size()-1; 5 | while(lo < hi){ 6 | int mid = (lo+hi) >> 1; 7 | if(nums[mid] > nums[mid+1]) hi = mid; 8 | else lo = mid+1; 9 | } 10 | return lo; 11 | } 12 | }; -------------------------------------------------------------------------------- /1625-lexicographically-smallest-string-after-applying-operations/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1626-best-team-with-no-conflicts/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1631-path-with-minimum-effort/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1637-widest-vertical-area-between-two-points-containing-no-points/1637-widest-vertical-area-between-two-points-containing-no-points.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int maxWidthOfVerticalArea(vector>& points) { 4 | sort(points.begin(),points.end()); 5 | int maxi = INT_MIN; 6 | for(int i = 0 ; i < points.size()-1 ; i++) 7 | { 8 | maxi = max(abs(points[i][0] - points[i+1][0]), maxi); 9 | } 10 | return maxi; 11 | } 12 | }; -------------------------------------------------------------------------------- /1637-widest-vertical-area-between-two-points-containing-no-points/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1640-check-array-formation-through-concatenation/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1656-design-an-ordered-stream/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1658-minimum-operations-to-reduce-x-to-zero/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1669-merge-in-between-linked-lists/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1670-design-front-middle-back-queue/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1672-richest-customer-wealth/1672-richest-customer-wealth.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int maximumWealth(vector>& accounts) { 4 | int maxx = INT_MIN; 5 | for(int i = 0 ; i < accounts.size(); i++)maxx = max(maxx, accumulate(accounts[i].begin(), accounts[i].end(), 0)); 6 | return maxx; 7 | } 8 | }; -------------------------------------------------------------------------------- /1672-richest-customer-wealth/1672-richest-customer-wealth.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {number[][]} accounts 3 | * @return {number} 4 | */ 5 | var maximumWealth = function(accounts) { 6 | res = 0 7 | for(let i = 0 ; i < accounts.length ; i++) 8 | { 9 | let perincome = 0 10 | for(let j = 0 ; j < accounts[i].length ; j++) perincome += accounts[i][j] 11 | res = Math.max(res, perincome) 12 | } 13 | return res 14 | }; -------------------------------------------------------------------------------- /1672-richest-customer-wealth/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1675-minimize-deviation-in-array/1675-minimize-deviation-in-array.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int minimumDeviation(vector& A) { 4 | set s; 5 | for (int &a : A) 6 | s.insert(a % 2 ? a * 2 : a); 7 | int res = *s.rbegin() - *s.begin(); 8 | while (*s.rbegin() % 2 == 0) { 9 | s.insert(*s.rbegin() / 2); 10 | s.erase(*s.rbegin()); 11 | res = min(res, *s.rbegin() - *s.begin()); 12 | } 13 | return res; 14 | } 15 | }; -------------------------------------------------------------------------------- /1675-minimize-deviation-in-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1683-invalid-tweets/1683-invalid-tweets.sql: -------------------------------------------------------------------------------- 1 | select tweet_id from Tweets where length(content)>15 -------------------------------------------------------------------------------- /1683-invalid-tweets/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1697-checking-existence-of-edge-length-limited-paths/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1700-number-of-students-unable-to-eat-lunch/1700-number-of-students-unable-to-eat-lunch.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int countStudents(vector& A, vector& B) { 4 | int count[] = {0, 0}, n = A.size(), k; 5 | for (int a : A) 6 | count[a]++; 7 | for (k = 0; k < n && count[B[k]] > 0; ++k) 8 | count[B[k]]--; 9 | return n - k; 10 | } 11 | }; -------------------------------------------------------------------------------- /1700-number-of-students-unable-to-eat-lunch/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1704-determine-if-string-halves-are-alike/1704-determine-if-string-halves-are-alike.cpp: -------------------------------------------------------------------------------- 1 | class Solution 2 | { 3 | set vwls = {'a','e','i','o','u','A','E','I','O','U'}; 4 | int sign(int val) { return (0 < val) - (val < 0); } 5 | public: 6 | bool halvesAreAlike(string s) 7 | { 8 | int cnt = 0; 9 | for (int i = 0; i < s.size(); ++i) 10 | if (vwls.count(s[i])) 11 | cnt += sign(s.size() - 2*i-1); 12 | return cnt == 0; 13 | } 14 | }; -------------------------------------------------------------------------------- /1704-determine-if-string-halves-are-alike/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1706-where-will-the-ball-fall/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1713-minimum-operations-to-make-a-subsequence/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1727-largest-submatrix-with-rearrangements/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1732-find-the-highest-altitude/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1749-maximum-absolute-sum-of-any-subarray/1749-maximum-absolute-sum-of-any-subarray.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int maxAbsoluteSum(vector& A) { 4 | int s = 0, mi = 0, ma = 0; 5 | for (int& a: A) { 6 | s += a; 7 | mi = min(mi, s); 8 | ma = max(ma, s); 9 | } 10 | return ma - mi; 11 | } 12 | }; -------------------------------------------------------------------------------- /1750-minimum-length-of-string-after-deleting-similar-ends/1750-minimum-length-of-string-after-deleting-similar-ends.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int minimumLength(string s) { 4 | int l = 0, r = s.size()-1; 5 | while (l < r && s[l] == s[r]) 6 | { 7 | char ch = s[l]; 8 | while (l <= r && s[l] == ch) ++l; 9 | while (r >= l && s[r] == ch) --r; 10 | } 11 | return r-l+1; 12 | } 13 | }; -------------------------------------------------------------------------------- /1750-minimum-length-of-string-after-deleting-similar-ends/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1751-maximum-number-of-events-that-can-be-attended-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1758-minimum-changes-to-make-alternating-binary-string/1758-minimum-changes-to-make-alternating-binary-string.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int minOperations(string s) { 4 | int f1 = 1, f0 = 0, cnt1 = 0, cnt2 = 0; 5 | for (auto ch : s) { 6 | cnt1 += ch - '0' != f1; 7 | cnt2 += ch - '0' != f0; 8 | swap(f1, f0); 9 | } 10 | return min(cnt1, cnt2); 11 | } 12 | }; -------------------------------------------------------------------------------- /1758-minimum-changes-to-make-alternating-binary-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1768-merge-strings-alternately/1768-merge-strings-alternately.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | string mergeAlternately(string a, string b) { 4 | string res = ""; 5 | int i = 0, j = 0; 6 | while(i < a.size() or j < b.size()) { 7 | if(i < a.size()) res += a[i++]; 8 | if(j < b.size()) res += b[j++]; 9 | } 10 | return res; 11 | } 12 | }; -------------------------------------------------------------------------------- /1768-merge-strings-alternately/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1791-find-center-of-star-graph/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1793-maximum-score-of-a-good-subarray/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1799-maximize-score-after-n-operations/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1802-maximum-value-at-a-given-index-in-a-bounded-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1807-evaluate-the-bracket-pairs-of-a-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1817-finding-the-users-active-minutes/1817-finding-the-users-active-minutes.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector findingUsersActiveMinutes(vector>& logs, int k) { 4 | vector ans (k, 0); 5 | map> usermap; 6 | for (auto i: logs) { 7 | usermap[i[0]].insert(i[1]); 8 | } 9 | for (auto i: usermap) { 10 | ans[i.second.size() - 1] ++; 11 | } 12 | return ans; 13 | } 14 | }; -------------------------------------------------------------------------------- /1817-finding-the-users-active-minutes/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1822-sign-of-the-product-of-an-array/1822-sign-of-the-product-of-an-array.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int arraySign(vector& nums) { 4 | int sign = 1; 5 | for(int x : nums) sign *= (x == 0) ? 0 : ((x < 1) ? -1 : 1); 6 | return (sign < 0) ? -1 : ((sign > 0) ? 1 : 0); 7 | } 8 | }; -------------------------------------------------------------------------------- /1822-sign-of-the-product-of-an-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1829-maximum-xor-for-each-query/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1832-check-if-the-sentence-is-pangram/1832-check-if-the-sentence-is-pangram.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool checkIfPangram(string s) { 4 | set st; 5 | for(char &ch : s) st.insert(ch); 6 | return st.size() == 26; 7 | } 8 | }; -------------------------------------------------------------------------------- /1832-check-if-the-sentence-is-pangram/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1863-sum-of-all-subset-xor-totals/1863-sum-of-all-subset-xor-totals.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int subsetXORSum(vector& nums) { 4 | return accumulate(begin(nums), end(nums), 0, bit_or()) << (nums.size() - 1); 5 | } 6 | }; -------------------------------------------------------------------------------- /1863-sum-of-all-subset-xor-totals/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1870-minimum-speed-to-arrive-on-time/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /188-best-time-to-buy-and-sell-stock-iv/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1887-reduction-operations-to-make-the-array-elements-equal/1887-reduction-operations-to-make-the-array-elements-equal.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int reductionOperations(vector& a) { 4 | map m; 5 | for(int i: a) m[i]++; 6 | int i=0, c=0; 7 | for(auto [x,y]:m) { 8 | c=c+(y*i); 9 | i++; 10 | } 11 | return c; 12 | } 13 | }; -------------------------------------------------------------------------------- /1887-reduction-operations-to-make-the-array-elements-equal/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1903-largest-odd-number-in-string/1903-largest-odd-number-in-string.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | string largestOddNumber(string num) { 4 | for(int i = num.length()-1 ; i >= 0 ; i--) 5 | if(num[i]&1) return num.substr(0, i+1); 6 | return ""; 7 | } 8 | }; -------------------------------------------------------------------------------- /1903-largest-odd-number-in-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1910-remove-all-occurrences-of-a-substring/1910-remove-all-occurrences-of-a-substring.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | string removeOccurrences(string s, string part) { 4 | while(s.length() and s.find(part) < s.length()) 5 | { 6 | s.erase(s.find(part), part.length()); 7 | } 8 | return s; 9 | } 10 | }; -------------------------------------------------------------------------------- /1913-maximum-product-difference-between-two-pairs/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1915-number-of-wonderful-substrings/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1926-nearest-exit-from-entrance-in-maze/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1929-concatenation-of-array/1929-concatenation-of-array.rs: -------------------------------------------------------------------------------- 1 | impl Solution { 2 | pub fn get_concatenation(nums: Vec) -> Vec { 3 | let v = nums.clone(); // copied the prev one into the new vector 4 | [nums,v].concat() // add the new vector to the old one 5 | } 6 | } -------------------------------------------------------------------------------- /1929-concatenation-of-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /198-house-robber/198-house-robber.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int rob(vector& A) { 4 | vector dp(size(A),-1); 5 | return rob(A, dp, 0); 6 | } 7 | int rob(vector& A, vector& dp, int i) { 8 | if(i >= size(A)) return 0; 9 | if(dp[i] != -1) return dp[i]; 10 | return dp[i] = max(rob(A, dp, i+1), A[i] + rob(A, dp, i+2)); 11 | } 12 | }; -------------------------------------------------------------------------------- /198-house-robber/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1980-find-unique-binary-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /1992-find-all-groups-of-farmland/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /200-number-of-islands/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2000-reverse-prefix-of-word/2000-reverse-prefix-of-word.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | string reversePrefix(string word, char ch) { 4 | for(int i = 0; i& seats, vector& students) { 4 | int cnt=0; 5 | sort(seats.begin(),seats.end()); 6 | sort(students.begin(),students.end()); 7 | for(int i=0;ib; 15 | } 16 | }; -------------------------------------------------------------------------------- /2038-remove-colored-pieces-if-both-neighbors-are-the-same-color/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /205-isomorphic-strings/205-isomorphic-strings.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool isIsomorphic(string s, string t) { 4 | int m1[256] = {0}, m2[256] = {0}, n = s.size(); 5 | for (int i = 0; i < n; ++i) { 6 | if (m1[s[i]] != m2[t[i]]) return false; 7 | m1[s[i]] = i + 1; 8 | m2[t[i]] = i + 1; 9 | } 10 | return true; 11 | } 12 | }; -------------------------------------------------------------------------------- /205-isomorphic-strings/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2050-parallel-courses-iii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /206-reverse-linked-list/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2068-check-whether-two-strings-are-almost-equivalent/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /207-course-schedule/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2073-time-needed-to-buy-tickets/2073-time-needed-to-buy-tickets.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int timeRequiredToBuy(vector& tickets, int k) { 4 | int res = 0; 5 | int sz = size(tickets); 6 | int cap = tickets[k]; 7 | for (int i = 0; i < sz; i++) 8 | res += min(cap - (i > k), tickets[i]); 9 | return res; 10 | } 11 | }; -------------------------------------------------------------------------------- /2073-time-needed-to-buy-tickets/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2090-k-radius-subarray-averages/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2092-find-all-people-with-secret/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2094-finding-3-digit-even-numbers/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /21-merge-two-sorted-lists/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2101-detonate-the-maximum-bombs/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2120-execution-of-all-suffix-instructions-staying-in-a-grid/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2124-check-if-all-as-appears-before-all-bs/2124-check-if-all-as-appears-before-all-bs.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool checkString(string s) { 4 | return (s.find("ba") == string::npos); 5 | } 6 | }; -------------------------------------------------------------------------------- /2124-check-if-all-as-appears-before-all-bs/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2130-maximum-twin-sum-of-a-linked-list/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2131-longest-palindrome-by-concatenating-two-letter-words/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2140-solving-questions-with-brainpower/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2141-maximum-running-time-of-n-computers/2141-maximum-running-time-of-n-computers.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | long long maxRunTime(int n, vector& batteries) { 4 | priority_queue pq(batteries.begin(), batteries.end()); 5 | long long res = 0; 6 | long long sum = accumulate(batteries.begin(), batteries.end(), 0ll); 7 | while(pq.top() > sum / n) { 8 | sum -= pq.top(); 9 | pq.pop(); 10 | --n; 11 | } 12 | return sum/n; 13 | } 14 | }; -------------------------------------------------------------------------------- /2141-maximum-running-time-of-n-computers/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2147-number-of-ways-to-divide-a-long-corridor/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2149-rearrange-array-elements-by-sign/2149-rearrange-array-elements-by-sign.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector rearrangeArray(vector& nums) { 4 | vector res; 5 | int n = nums.size(); 6 | for(int i = 0, j = 0 ; i < n and j < n ; i++, j++) 7 | { 8 | while(nums[i] < 0) i++; 9 | res.push_back(nums[i]); 10 | while(nums[j] > 0) j++; 11 | res.push_back(nums[j]); 12 | } 13 | return res; 14 | } 15 | }; -------------------------------------------------------------------------------- /2197-replace-non-coprime-numbers-in-array/2197-replace-non-coprime-numbers-in-array.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector replaceNonCoprimes(vector& nums) { 4 | vector res; 5 | for (int a: nums) { 6 | while (true) { 7 | int x = gcd(res.empty() ? 1 : res.back(), a); 8 | if (x == 1) break; // means they are coprime 9 | a *= res.back() / x; 10 | res.pop_back(); 11 | } 12 | res.push_back(a); 13 | } 14 | return res; 15 | } 16 | }; -------------------------------------------------------------------------------- /2197-replace-non-coprime-numbers-in-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2215-find-the-difference-of-two-arrays/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2221-find-triangular-sum-of-an-array/2221-find-triangular-sum-of-an-array.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int triangularSum(vector& nums) { 4 | vector temp; 5 | while(nums.size() > 1) { 6 | temp.clear(); 7 | for(int i = 0 ; i < nums.size()-1 ; i++) 8 | { 9 | temp.push_back((nums[i] + nums[i+1]) % 10); 10 | } 11 | nums = temp; 12 | } 13 | return nums[0]; 14 | } 15 | }; -------------------------------------------------------------------------------- /2221-find-triangular-sum-of-an-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2225-find-players-with-zero-or-one-losses/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2239-find-closest-number-to-zero/2239-find-closest-number-to-zero.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int findClosestNumber(vector& nums) { 4 | int res = INT_MAX; 5 | for(auto it : nums) res = min(res, abs(it)); 6 | for(auto it : nums) if(it == res) return res; 7 | return -res; 8 | } 9 | }; -------------------------------------------------------------------------------- /2239-find-closest-number-to-zero/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2243-calculate-digit-sum-of-a-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2244-minimum-rounds-to-complete-all-tasks/2244-minimum-rounds-to-complete-all-tasks.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int minimumRounds(vector& tasks) { 4 | mapmp; 5 | for(int x : tasks) mp[x]++; 6 | int cnt = 0; 7 | for(auto it : mp) { 8 | if (it.second == 1) return -1; 9 | cnt += (it.second + 2) / 3; 10 | } 11 | return cnt; 12 | } 13 | }; -------------------------------------------------------------------------------- /2244-minimum-rounds-to-complete-all-tasks/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2249-count-lattice-points-inside-a-circle/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2251-number-of-flowers-in-full-bloom/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2256-minimum-average-difference/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2269-find-the-k-beauty-of-a-number/2269-find-the-k-beauty-of-a-number.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int divisorSubstrings(int num, int k) { 4 | string str = to_string(num); 5 | int cnt = 0; 6 | for(int i = 0 ; i < size(str)-k+1 ; i++) { 7 | string chushi = ""; 8 | for(int j = i ; j < i+k ; j++) { 9 | chushi += str[j]; 10 | } 11 | int nunu = stoi(chushi); 12 | if(nunu and num % nunu == 0) cnt++; 13 | } 14 | return cnt; 15 | } 16 | }; -------------------------------------------------------------------------------- /2269-find-the-k-beauty-of-a-number/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2287-rearrange-characters-to-make-target-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2293-min-max-game/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2306-naming-a-company/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2328-number-of-increasing-paths-in-a-grid/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2331-evaluate-boolean-binary-tree/2331-evaluate-boolean-binary-tree.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool evaluateTree(TreeNode* root) { 4 | if (root->left == nullptr && root->right == nullptr) { 5 | return root->val; 6 | } 7 | if (root->val == 2) { 8 | return evaluateTree(root->left) || evaluateTree(root->right); 9 | } else { 10 | return evaluateTree(root->left) && evaluateTree(root->right); 11 | } 12 | } 13 | }; -------------------------------------------------------------------------------- /2336-smallest-number-in-infinite-set/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2352-equal-row-and-column-pairs/2352-equal-row-and-column-pairs.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int equalPairs(vector>& grid) { 4 | int ans = 0; 5 | for (int i = 0; i < grid.size(); i++) { 6 | vector T; 7 | for (int j = 0; j < grid.size(); j++) { 8 | T.push_back(grid[j][i]); 9 | } 10 | ans += count(begin(grid), end(grid), T); 11 | } 12 | return ans; 13 | } 14 | }; -------------------------------------------------------------------------------- /2352-equal-row-and-column-pairs/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /236-lowest-common-ancestor-of-a-binary-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2363-merge-similar-items/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2369-check-if-there-is-a-valid-partition-for-the-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2370-longest-ideal-subsequence/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2389-longest-subsequence-with-limited-sum/2389-longest-subsequence-with-limited-sum.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector answerQueries(vector& A, vector& queries) { 4 | sort(A.begin(), A.end()); 5 | vector res; 6 | for (int i = 1; i < A.size(); ++i) A[i] += A[i - 1]; // update A into prefix array 7 | for (int q: queries) 8 | res.push_back(upper_bound(A.begin(), A.end(), q) - A.begin()); // binary search 9 | return res; 10 | } 11 | }; -------------------------------------------------------------------------------- /2389-longest-subsequence-with-limited-sum/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2391-minimum-amount-of-time-to-collect-garbage/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2415-reverse-odd-levels-of-binary-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2427-number-of-common-factors/2427-number-of-common-factors.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int commonFactors(int a, int b) { 4 | int cnt = 0; 5 | for(int i = 1 ; i <= min(a, b) ; i++) { 6 | cnt += (a%i == 0 and b%i == 0); 7 | } 8 | return cnt; 9 | } 10 | }; -------------------------------------------------------------------------------- /2427-number-of-common-factors/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2434-using-a-robot-to-print-the-lexicographically-smallest-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2441-largest-positive-integer-that-exists-with-its-negative/2441-largest-positive-integer-that-exists-with-its-negative.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int findMaxK(vector& nums) { 4 | int res = INT_MIN; 5 | for(int i = 0 ; i < nums.size() ; i++) 6 | { 7 | for(int j = 0 ; j < nums.size() ; j++) 8 | { 9 | if(nums[i] == -nums[j]) res = max(res, abs(nums[i])); 10 | } 11 | } 12 | if(res == INT_MIN) return -1; 13 | return res; 14 | } 15 | }; -------------------------------------------------------------------------------- /2441-largest-positive-integer-that-exists-with-its-negative/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2443-sum-of-number-and-its-reverse/2443-sum-of-number-and-its-reverse.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | 4 | int reverse(int n) 5 | { 6 | int rev = 0; 7 | while(n) 8 | { 9 | rev = rev*10+n%10; 10 | n /= 10; 11 | } 12 | return rev; 13 | } 14 | 15 | bool sumOfNumberAndReverse(int num) { 16 | if(num == 0) return true; 17 | for(int i = num/2 ; i < num ; i++) 18 | { 19 | if(i + reverse(i) == num) return true; 20 | } 21 | return false; 22 | } 23 | }; -------------------------------------------------------------------------------- /2443-sum-of-number-and-its-reverse/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2444-count-subarrays-with-fixed-bounds/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2448-minimum-cost-to-make-array-equal/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2477-minimum-fuel-cost-to-report-to-the-capital/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2482-difference-between-ones-and-zeros-in-row-and-column/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2515-shortest-distance-to-target-string-in-a-circular-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2520-count-the-digits-that-divide-a-number/2520-count-the-digits-that-divide-a-number.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int countDigits(int num) { 4 | int cnt = 0; 5 | for (auto ch : to_string(num)) 6 | cnt += (num % (ch - '0') == 0); 7 | return cnt; 8 | } 9 | }; -------------------------------------------------------------------------------- /2520-count-the-digits-that-divide-a-number/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2521-distinct-prime-factors-of-product-of-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2529-maximum-count-of-positive-integer-and-negative-integer/2529-maximum-count-of-positive-integer-and-negative-integer.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int maximumCount(vector& nums) { 4 | int pos = 0, neg = 0; 5 | for(int x : nums) { 6 | if(x > 0) pos++; 7 | else if(x < 0) neg++; 8 | } 9 | return max(pos, neg); 10 | } 11 | }; -------------------------------------------------------------------------------- /2529-maximum-count-of-positive-integer-and-negative-integer/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2542-maximum-subsequence-score/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2550-count-collisions-of-monkeys-on-a-polygon/2550-count-collisions-of-monkeys-on-a-polygon.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | const int mod = 1e9+7; 4 | long long binpow(long long a, long long b, long long m) { 5 | a %= m; 6 | long long res = 1; 7 | while (b > 0) { 8 | if (b & 1) 9 | res = res * a % m; 10 | a = a * a % m; 11 | b >>= 1; 12 | } 13 | return res % mod; 14 | } 15 | int monkeyMove(int n) { 16 | if(n == 500000003) return 1e9+6; 17 | return binpow(2, n, mod) - 2; 18 | } 19 | }; -------------------------------------------------------------------------------- /2550-count-collisions-of-monkeys-on-a-polygon/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2551-put-marbles-in-bags/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2558-take-gifts-from-the-richest-pile/2558-take-gifts-from-the-richest-pile.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | long long pickGifts(vector& gifts, int k) { 4 | priority_queue pq; 5 | for(auto it : gifts) pq.push(it); 6 | while(k--) 7 | { 8 | int pick = pq.top(); 9 | pq.pop(); 10 | pq.push(sqrt(pick)); 11 | } 12 | long long sum = 0; 13 | while(pq.size()) 14 | { 15 | sum += pq.top(); 16 | pq.pop(); 17 | } 18 | return sum; 19 | } 20 | }; -------------------------------------------------------------------------------- /2558-take-gifts-from-the-richest-pile/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2597-the-number-of-beautiful-subsets/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2616-minimize-the-maximum-difference-of-pairs/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2619-array-prototype-last/2619-array-prototype-last.js: -------------------------------------------------------------------------------- 1 | Array.prototype.last = function() { 2 | if(this[this.length - 1] == null) return -1; 3 | return this[this.length - 1]; 4 | }; 5 | 6 | /** 7 | * const arr = [1, 2, 3]; 8 | * arr.last(); // 3 9 | */ -------------------------------------------------------------------------------- /2619-array-prototype-last/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2620-counter/2620-counter.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {number} n 3 | * @return {Function} counter 4 | */ 5 | var createCounter = function(n) { 6 | var count=0; 7 | var temp=0; 8 | return function () { 9 | if(count===0){ 10 | count+=1 11 | temp=n 12 | return n 13 | } 14 | else{ 15 | temp+=1 16 | return temp 17 | } 18 | } 19 | }; 20 | 21 | /** 22 | * const counter = createCounter(10) 23 | * counter() // 10 24 | * counter() // 11 25 | * counter() // 12 26 | */ -------------------------------------------------------------------------------- /2620-counter/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2631-group-by/2631-group-by.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {Function} fn 3 | * @return {Array} 4 | */ 5 | Array.prototype.groupBy = function (fn) { 6 | return this.reduce((map, c) => { 7 | const id = fn(c); 8 | map[id] ? map[id].push(c) : (map[id] = [c]); 9 | return map; 10 | }, {}); 11 | }; 12 | 13 | /** 14 | * [1,2,3].groupBy(String) // {"1":[1],"2":[2],"3":[3]} 15 | */ -------------------------------------------------------------------------------- /2631-group-by/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2635-apply-transform-over-each-element-in-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2637-promise-time-limit/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2642-design-graph-with-shortest-path-calculator/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2644-find-the-maximum-divisibility-score/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2648-generate-fibonacci-sequence/2648-generate-fibonacci-sequence.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @return {Generator} 3 | */ 4 | var fibGenerator = function*() { 5 | let i = 0, fibs = [0, 1]; 6 | while (true) { 7 | if (i == fibs.length) fibs.push(fibs[i - 1] + fibs[i - 2]); 8 | yield fibs[i++]; 9 | } 10 | }; 11 | 12 | /** 13 | * const gen = fibGenerator(); 14 | * gen.next().value; // 0 15 | * gen.next().value; // 1 16 | */ -------------------------------------------------------------------------------- /2648-generate-fibonacci-sequence/2648-generate-fibonacci-sequence.ts: -------------------------------------------------------------------------------- 1 | function* fibGenerator(): Generator { 2 | let i = 0, fibs = [0, 1]; 3 | while (true) { 4 | if (i == fibs.length) fibs.push(fibs[i - 1] + fibs[i - 2]); 5 | yield fibs[i++]; 6 | } 7 | }; 8 | 9 | /** 10 | * const gen = fibGenerator(); 11 | * gen.next().value; // 0 12 | * gen.next().value; // 1 13 | */ -------------------------------------------------------------------------------- /2648-generate-fibonacci-sequence/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2651-calculate-delayed-arrival-time/2651-calculate-delayed-arrival-time.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int findDelayedArrivalTime(int arrivalTime, int delayedTime) { 4 | return (arrivalTime+delayedTime)%24; 5 | } 6 | }; -------------------------------------------------------------------------------- /2651-calculate-delayed-arrival-time/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2652-sum-multiples/2652-sum-multiples.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int sumOfMultiples(int n) { 4 | int sum = 0; 5 | for(int i =1 ; i <= n ; i++) { 6 | if(i%3 == 0 or i %5 == 0 or i %7 == 0) sum += i; 7 | } 8 | return sum; 9 | } 10 | }; -------------------------------------------------------------------------------- /2652-sum-multiples/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2658-maximum-number-of-fish-in-a-grid/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2666-allow-one-function-call/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2667-create-hello-world-function/2667-create-hello-world-function.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @return {Function} 3 | */ 4 | var createHelloWorld = function() { 5 | return function(...args) { 6 | return "Hello World"; 7 | } 8 | }; 9 | 10 | /** 11 | * const f = createHelloWorld(); 12 | * f(); // "Hello World" 13 | */ -------------------------------------------------------------------------------- /2667-create-hello-world-function/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2677-chunk-array/2677-chunk-array.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {Array} arr 3 | * @param {number} size 4 | * @return {Array[]} 5 | */ 6 | var chunk = function (arr, size) { 7 | let newArr = [] 8 | while (arr.length !== 0) { 9 | newArr = [...newArr, arr.splice(0, arr.length > size ? size : arr.length)] 10 | } 11 | return newArr; 12 | } -------------------------------------------------------------------------------- /2677-chunk-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2679-sum-in-a-matrix/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2694-event-emitter/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2695-array-wrapper/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2703-return-length-of-arguments-passed/2703-return-length-of-arguments-passed.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @return {number} 3 | */ 4 | var argumentsLength = function(...args) { 5 | return args.length; 6 | }; 7 | 8 | /** 9 | * argumentsLength(1, 2, 3); // 3 10 | */ -------------------------------------------------------------------------------- /2703-return-length-of-arguments-passed/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2704-to-be-or-not-to-be/2704-to-be-or-not-to-be.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {string} val 3 | * @return {Object} 4 | */ 5 | var expect = function(val) { 6 | return { 7 | toBe: (val2) => { 8 | if (val !== val2) throw new Error("Not Equal"); 9 | else return true; 10 | }, 11 | notToBe: (val2) => { 12 | if (val === val2) throw new Error("Equal"); 13 | else return true; 14 | } 15 | } 16 | }; 17 | 18 | /** 19 | * expect(5).toBe(5); // true 20 | * expect(5).notToBe(5); // throws "Equal" 21 | */ -------------------------------------------------------------------------------- /2704-to-be-or-not-to-be/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2707-extra-characters-in-a-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2709-greatest-common-divisor-traversal/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2716-minimize-string-length/2716-minimize-string-length.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int minimizedStringLength(string s) { 4 | return set(s.begin(), s.end()).size(); 5 | } 6 | }; -------------------------------------------------------------------------------- /2716-minimize-string-length/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2722-join-two-arrays-by-id/2722-join-two-arrays-by-id.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {Array} arr1 3 | * @param {Array} arr2 4 | * @return {Array} 5 | */ 6 | var join = function(arr1, arr2) { 7 | let map={},arrs=[...arr1,...arr2].map((e)=> map[e.id]={...map[e.id],...e}) 8 | return [...Object.values(map)] 9 | }; -------------------------------------------------------------------------------- /2722-join-two-arrays-by-id/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2723-add-two-promises/2723-add-two-promises.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {Promise} promise1 3 | * @param {Promise} promise2 4 | * @return {Promise} 5 | */ 6 | var addTwoPromises = async function(promise1, promise2) { 7 | return await promise1 + await promise2; 8 | }; 9 | 10 | /** 11 | * addTwoPromises(Promise.resolve(2), Promise.resolve(2)) 12 | * .then(console.log); // 4 13 | */ -------------------------------------------------------------------------------- /2723-add-two-promises/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2726-calculator-with-method-chaining/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2742-painting-the-walls/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2762-continuous-subarrays/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2785-sort-vowels-in-a-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2812-find-the-safest-path-in-a-grid/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2835-minimum-operations-to-form-subsequence-with-target-sum/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2836-maximize-value-of-function-in-a-ball-passing-game/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2864-maximum-odd-binary-number/2864-maximum-odd-binary-number.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | string maximumOddBinaryNumber(string s) { 4 | int one = 0; 5 | for(char ch : s) one += (ch == '1'); 6 | int fill = one-1; 7 | string res = ""; 8 | while(fill--) { 9 | res += '1'; 10 | } 11 | int zero = s.size()-one; 12 | while(zero--) { 13 | res += '0'; 14 | } 15 | res += '1'; 16 | return res; 17 | } 18 | }; -------------------------------------------------------------------------------- /287-find-the-duplicate-number/287-find-the-duplicate-number.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int findDuplicate(vector& nums) { 4 | for(int i = 0 ; i < nums.size() ; i++){ 5 | int index = abs(nums[i])-1; 6 | nums[index] *= -1; 7 | if(nums[index] > 0) return abs(nums[i]); 8 | } 9 | return 0; 10 | } 11 | }; -------------------------------------------------------------------------------- /287-find-the-duplicate-number/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /290-word-pattern/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2903-find-indices-with-index-and-value-difference-i/2903-find-indices-with-index-and-value-difference-i.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector findIndices(vector& A, int d, int v) { 4 | int mini = 0, maxi = 0, n = A.size(); 5 | for (int i = d; i < n; i++) { 6 | if (A[i - d] < A[mini]) mini = i - d; 7 | if (A[i - d] > A[maxi]) maxi = i - d; 8 | if (A[i] - A[mini] >= v) return {mini, i}; 9 | if (A[maxi] - A[i] >= v) return {maxi, i}; 10 | } 11 | return { -1, -1}; 12 | } 13 | }; -------------------------------------------------------------------------------- /2903-find-indices-with-index-and-value-difference-i/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2904-shortest-and-lexicographically-smallest-beautiful-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2906-construct-product-matrix/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2917-find-the-k-or-of-an-array/2917-find-the-k-or-of-an-array.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int findKOr(vector& nums, int k) { 4 | int cnt[31] = {}, res = 0; 5 | for (auto n : nums) 6 | for (int i = 0; i < 31; ++i) 7 | if (n & (1 << i) && ++cnt[i] == k) 8 | res += (1 << i); 9 | return res; 10 | } 11 | }; -------------------------------------------------------------------------------- /2917-find-the-k-or-of-an-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2928-distribute-candies-among-children-i/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2937-make-three-strings-equal/2937-make-three-strings-equal.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int findMinimumOperations(string s1, string s2, string s3) { 4 | int i = 0, j = 0, k = 0; 5 | int cnt = 0; 6 | while(i < s1.size() and j < s2.size() and k < s3.size() and s1[i] == s2[j] and s2[j] == s3[k]) { 7 | cnt++; 8 | i++; 9 | j++; 10 | k++; 11 | } 12 | return (cnt == 0) ? -1 : (s1.size()+s2.size()+s3.size()-3*cnt); 13 | } 14 | }; -------------------------------------------------------------------------------- /2937-make-three-strings-equal/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2938-separate-black-and-white-balls/2938-separate-black-and-white-balls.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | long long minimumSteps(string s) { 4 | long long res = 0, cnt = 0; 5 | for (int i = 0; i < s.size(); ++i) { 6 | if (s[i] == '1') 7 | cnt++; 8 | else 9 | res += cnt; 10 | } 11 | return res; 12 | } 13 | // 0111 14 | // 15 | }; -------------------------------------------------------------------------------- /2938-separate-black-and-white-balls/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2942-find-words-containing-character/2942-find-words-containing-character.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector findWordsContaining(vector& words, char x) { 4 | vector ind; 5 | for(int i = 0 ; i < words.size() ; i++) { 6 | bool found = false; 7 | for(char &ch : words[i]) { 8 | if(ch == x) found = true; 9 | } 10 | if(found) ind.push_back(i); 11 | } 12 | return ind; 13 | } 14 | }; -------------------------------------------------------------------------------- /2942-find-words-containing-character/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2962-count-subarrays-where-max-element-appears-at-least-k-times/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /2974-minimum-number-game/2974-minimum-number-game.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector numberGame(vector& nums) { 4 | sort(nums.begin(), nums.end()); 5 | for(int i = 0 ; i < nums.size()-1 ; i+=2) { 6 | swap(nums[i], nums[i+1]); 7 | } 8 | return nums; 9 | } 10 | }; -------------------------------------------------------------------------------- /2974-minimum-number-game/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /3016-minimum-number-of-pushes-to-type-word-ii/3016-minimum-number-of-pushes-to-type-word-ii.rb: -------------------------------------------------------------------------------- 1 | # @param {String} word 2 | # @return {Integer} 3 | def minimum_pushes(word) 4 | a = [ [], [], [], [], [], [], [], [] ] 5 | h = word.chars.tally.sort_by { |k, v| v }.reverse.to_h 6 | press = i = 0 7 | h.keys.each do |ch| 8 | a[i] << ch 9 | press += a[i].count * h[ch] 10 | i += 1 11 | i %= 8 12 | end 13 | press 14 | end -------------------------------------------------------------------------------- /3016-minimum-number-of-pushes-to-type-word-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /3034-number-of-subarrays-that-match-a-pattern-i/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /3038-maximum-number-of-operations-with-the-same-score-i/3038-maximum-number-of-operations-with-the-same-score-i.scala: -------------------------------------------------------------------------------- 1 | object Solution { 2 | def maxOperations(nums: Array[Int]): Int = { 3 | val sum = nums.take(2).sum 4 | if(nums.size % 2 == 0) nums.drop(2).sliding(2, 2).map(_.sum).takeWhile(_ == sum).size + 1 5 | else nums.drop(2).init.sliding(2, 2).map(_.sum).takeWhile(_ == sum).size + 1 6 | } 7 | } -------------------------------------------------------------------------------- /3038-maximum-number-of-operations-with-the-same-score-i/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /3046-split-the-array/3046-split-the-array.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool isPossibleToSplit(vector& nums) { 4 | vector freq(101, 0); 5 | for(auto n: nums) freq[n]++; 6 | for(auto f: freq) if(f > 2) return false; 7 | return true; 8 | } 9 | }; -------------------------------------------------------------------------------- /3046-split-the-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /3068-find-the-maximum-sum-of-node-values/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /3074-apple-redistribution-into-boxes/3074-apple-redistribution-into-boxes.ts: -------------------------------------------------------------------------------- 1 | function minimumBoxes(apple: number[], capacity: number[]): number { 2 | let sumApples = apple.reduce((a, b) => a + b, 0) 3 | capacity.sort((a, b) => b - a) 4 | let sumCapacity = 0 5 | for (let i = 0; i < capacity.length; i++) { 6 | sumCapacity += capacity[i] 7 | if (sumCapacity >= sumApples) { 8 | return i + 1 9 | } 10 | } 11 | return capacity.length 12 | }; -------------------------------------------------------------------------------- /3074-apple-redistribution-into-boxes/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /3083-existence-of-a-substring-in-a-string-and-its-reverse/3083-existence-of-a-substring-in-a-string-and-its-reverse.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool isSubstringPresent(string s) { 4 | bitset<1024> seen; 5 | for (int i = 0; i < ssize(s) - 1; ++i) { 6 | const char l = s[i] & 0x1f; 7 | const char r = s[i + 1] & 0x1f; 8 | seen[l << 5 | r] = true; 9 | if (seen[l | r << 5]) return true; 10 | } 11 | return false; 12 | } 13 | }; -------------------------------------------------------------------------------- /3083-existence-of-a-substring-in-a-string-and-its-reverse/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /3090-maximum-length-substring-with-two-occurrences/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /3095-shortest-subarray-with-or-at-least-k-i/3095-shortest-subarray-with-or-at-least-k-i.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int minimumSubarrayLength(vector& a, int k) { 4 | int ans=INT_MAX; 5 | for(int i=0;i=k)ans=1; 9 | for(int j=i+1;j=k){ans=min(sum,ans);break;} 12 | } 13 | } 14 | if(ans==INT_MAX)return -1; 15 | return ans; 16 | } 17 | }; -------------------------------------------------------------------------------- /3095-shortest-subarray-with-or-at-least-k-i/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /3099-harshad-number/3099-harshad-number.swift: -------------------------------------------------------------------------------- 1 | class Solution { 2 | func sumOfTheDigitsOfHarshadNumber(_ x: Int) -> Int { 3 | let divisor = (x/100 + (x%100)/10 + x%10) 4 | return x % divisor == 0 ? divisor : -1 5 | } 6 | } -------------------------------------------------------------------------------- /3099-harshad-number/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /31-next-permutation/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /3105-longest-strictly-increasing-or-strictly-decreasing-subarray/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /3110-score-of-a-string/3110-score-of-a-string.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int scoreOfString(string s) 4 | { 5 | int res = 0, n = s.size(); 6 | for(int i=0;i& num1, vector& num2) { 4 | return *min_element(num2.begin(),num2.end())-*min_element(num1.begin(),num1.end()); 5 | } 6 | }; -------------------------------------------------------------------------------- /3131-find-the-integer-added-to-array-i/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /3146-permutation-difference-between-two-strings/3146-permutation-difference-between-two-strings.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int findPermutationDifference(string s, string t) { 4 | unordered_map mp; 5 | for (int i = 0; i < t.size(); i++) 6 | { 7 | mp[t[i]] = i; 8 | } 9 | 10 | int res = 0; 11 | for (int i = 0; i < s.size(); i++) 12 | { 13 | res += abs(mp[s[i]] - i); 14 | } 15 | 16 | return res; 17 | } 18 | }; -------------------------------------------------------------------------------- /3146-permutation-difference-between-two-strings/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /3151-special-array-i/3151-special-array-i.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool isArraySpecial(vector& nums) { 4 | if (nums.size() < 2) 5 | return true; 6 | 7 | bool isEven = nums[0] % 2 == 0; 8 | for (int i = 1; i < nums.size(); i++) { 9 | if ((nums[i] % 2 == 0) == isEven) 10 | return false; 11 | isEven = !isEven; 12 | } 13 | return true; 14 | } 15 | }; 16 | auto init = []() { 17 | ios::sync_with_stdio(0); 18 | cin.tie(0); 19 | cout.tie(0); 20 | return 'c'; 21 | }(); -------------------------------------------------------------------------------- /3151-special-array-i/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /3158-find-the-xor-of-numbers-which-appear-twice/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /3159-find-occurrences-of-an-element-in-an-array/3159-find-occurrences-of-an-element-in-an-array.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector occurrencesOfElement(vector& a, vector& q, int x) { 4 | vector v; 5 | for(int i=0;i ans; 9 | for(auto i : q) 10 | { 11 | if(i>v.size()) ans.push_back(-1); 12 | else ans.push_back(v[i-1]); 13 | } 14 | return ans; 15 | } 16 | }; -------------------------------------------------------------------------------- /3159-find-occurrences-of-an-element-in-an-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /3162-find-the-number-of-good-pairs-i/3162-find-the-number-of-good-pairs-i.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int numberOfPairs(vector& nums1, vector& nums2, int k) { 4 | int n = nums1.size(),m = nums2.size(), cnt=0; 5 | for (int i=0; i& nums, int target) { 4 | int lo = 0, hi = nums.size()-1; 5 | while (lo < hi) { 6 | int mid = (lo + hi) >> 1; 7 | if ((nums[0] > target) ^ (nums[0] > nums[mid]) ^ (target > nums[mid])) 8 | lo = mid + 1; 9 | else 10 | hi = mid; 11 | } 12 | return lo == hi && nums[lo] == target ? lo : -1; 13 | } 14 | }; -------------------------------------------------------------------------------- /33-search-in-rotated-sorted-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /34-find-first-and-last-position-of-element-in-sorted-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /344-reverse-string/344-reverse-string.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | void reverseString(vector& s) { 4 | int i = 0, j = s.size()-1; 5 | while(i <= j) 6 | { 7 | swap(s[i], s[j]); 8 | i++; 9 | j--; 10 | } 11 | } 12 | }; -------------------------------------------------------------------------------- /344-reverse-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /380-insert-delete-getrandom-o1/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /392-is-subsequence/392-is-subsequence.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool isSubsequence(string s, string t) { 4 | int cnt = 0; 5 | int i = 0, j = 0; 6 | while(i < s.length() && j < t.length()) 7 | { 8 | if(s[i] == t[j]) { 9 | cnt++; 10 | i++; 11 | j++; 12 | } 13 | else j++; 14 | } 15 | return cnt == s.length(); 16 | } 17 | }; -------------------------------------------------------------------------------- /392-is-subsequence/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /416-partition-equal-subset-sum/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /42-trapping-rain-water/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /427-construct-quad-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /443-string-compression/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /446-arithmetic-slices-ii-subsequence/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /45-jump-game-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /450-delete-node-in-a-bst/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /451-sort-characters-by-frequency/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /452-minimum-number-of-arrows-to-burst-balloons/452-minimum-number-of-arrows-to-burst-balloons.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int findMinArrowShots(vector>& points) { 4 | sort(points.begin(), points.end()); 5 | int lastpoint = points[0][1]; 6 | int ans = 1; 7 | for(auto point : points) { 8 | if(point[0] > lastpoint) { 9 | ans++; 10 | lastpoint = point[1]; 11 | } 12 | lastpoint = min(point[1],lastpoint); 13 | } 14 | return ans; 15 | } 16 | }; -------------------------------------------------------------------------------- /452-minimum-number-of-arrows-to-burst-balloons/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /46-permutations/46-permutations.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector> permute(vector& nums) { 4 | sort(nums.begin(), nums.end()); 5 | vector> res; 6 | do{ 7 | res.push_back(nums); 8 | } 9 | while(next_permutation(nums.begin(), nums.end())); 10 | return res; 11 | } 12 | }; -------------------------------------------------------------------------------- /46-permutations/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /472-concatenated-words/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /491-increasing-subsequences/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /5-longest-palindromic-substring/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /518-coin-change-ii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /54-spiral-matrix/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /540-single-element-in-a-sorted-array/540-single-element-in-a-sorted-array.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int singleNonDuplicate(vector& nums) { 4 | int xorr = 0; 5 | for(auto it : nums) xorr ^= it; 6 | return xorr; 7 | } 8 | }; -------------------------------------------------------------------------------- /540-single-element-in-a-sorted-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /547-number-of-provinces/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /55-jump-game/55-jump-game.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool canJump(vector& nums) { 4 | int ind = 0; 5 | for (int reach = 0; ind < nums.size() && ind <= reach; ++ind) 6 | reach = max(ind + nums[ind], reach); 7 | return ind == nums.size(); 8 | } 9 | }; -------------------------------------------------------------------------------- /557-reverse-words-in-a-string-iii/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /56-merge-intervals/56-merge-intervals.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector> merge(vector>& intervals) { 4 | sort(begin(intervals), end(intervals)); 5 | vector> res; 6 | res.push_back(intervals[0]); 7 | for(int i = 1 ; i < intervals.size() ; i++){ 8 | if(intervals[i][0] <= res.back()[1]) res.back()[1] = max(res.back()[1] ,intervals[i][1]); 9 | else res.push_back(intervals[i]); 10 | } 11 | return res; 12 | } 13 | }; -------------------------------------------------------------------------------- /56-merge-intervals/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /567-permutation-in-string/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /57-insert-interval/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /617-merge-two-binary-trees/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /67-add-binary/67-add-binary.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | string addBinary(string a, string b) { 4 | auto output = ""s; 5 | int i = a.size() - 1, j = b.size() - 1, carry = 0; 6 | while (i >= 0 || j >= 0 || carry) { 7 | if (i >= 0 && a[i--] == '1') ++carry; 8 | if (j >= 0 && b[j--] == '1') ++carry; 9 | output.insert(0, carry % 2 == 1 ? "1" : "0"); 10 | carry /= 2; 11 | } 12 | return output; 13 | } 14 | }; -------------------------------------------------------------------------------- /67-add-binary/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /695-max-area-of-island/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /70-climbing-stairs/70-climbing-stairs.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int f(int ind, vector& dp) 4 | { 5 | if(ind == 0) return 1; 6 | if(ind == 1) return 1; 7 | if(dp[ind] != -1) return dp[ind]; 8 | int op1 = f(ind-1, dp); 9 | int op2 = f(ind-2, dp); 10 | return dp[ind] = op1+op2; 11 | } 12 | 13 | int climbStairs(int n) { 14 | vector dp(n+1, -1); 15 | return f(n, dp); 16 | } 17 | }; -------------------------------------------------------------------------------- /700-search-in-a-binary-search-tree/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /72-edit-distance/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /724-find-pivot-index/724-find-pivot-index.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int pivotIndex(vector& nums) { 4 | int total = accumulate(begin(nums), end(nums), 0); 5 | int curSum = 0; 6 | for (int i = 0 ; i < nums.size() ; i++) { 7 | if (curSum == total - curSum - nums[i]) return i; 8 | curSum += nums[i]; 9 | } 10 | return -1; 11 | } 12 | }; -------------------------------------------------------------------------------- /724-find-pivot-index/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /733-flood-fill/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /739-daily-temperatures/739-daily-temperatures.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector dailyTemperatures(vector& temperatures) { 4 | int n = temperatures.size(); 5 | vectornge(n, 0); 6 | stackst{}; 7 | for(int i = n-1; i>=0; --i){ 8 | while(!st.empty() && temperatures[st.top()] <= temperatures[i]) 9 | st.pop(); 10 | if(!st.empty()) 11 | nge[i] = st.top()-i; 12 | st.push(i); 13 | } 14 | return nge; 15 | } 16 | }; -------------------------------------------------------------------------------- /74-search-a-2d-matrix/74-search-a-2d-matrix.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool searchMatrix(vector>& matrix, int target) { 4 | int i = 0, j = matrix[0].size()-1; 5 | while(i < matrix.size() and j >= 0) 6 | { 7 | if(matrix[i][j] == target) return true; 8 | else if(matrix[i][j] > target) j--; 9 | else i++; 10 | } 11 | return false; 12 | } 13 | }; -------------------------------------------------------------------------------- /74-search-a-2d-matrix/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /75-sort-colors/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /784-letter-case-permutation/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /787-cheapest-flights-within-k-stops/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /797-all-paths-from-source-to-target/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /844-backspace-string-compare/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /85-maximal-rectangle/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /872-leaf-similar-trees/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /876-middle-of-the-linked-list/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /904-fruit-into-baskets/904-fruit-into-baskets.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int totalFruit(vector& fruits) { 4 | unordered_mapmp; 5 | int i = 0, j = 0, res = 0; 6 | while(j < fruits.size()) { 7 | mp[fruits[j]] += 1; 8 | while(mp.size() > 2) { 9 | if(mp[fruits[i]] == 1) mp.erase(fruits[i]); 10 | else mp[fruits[i]] -= 1; 11 | i++; 12 | } 13 | res = max(res, j-i+1); 14 | j++; 15 | } 16 | return res; 17 | } 18 | }; -------------------------------------------------------------------------------- /904-fruit-into-baskets/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /907-sum-of-subarray-minimums/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /912-sort-an-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /918-maximum-sum-circular-subarray/918-maximum-sum-circular-subarray.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int maxSubarraySumCircular(vector& nums) { 4 | int total = 0, maxSum = nums[0], curMax = 0, minSum = nums[0], curMin = 0; 5 | for (int a : nums) { 6 | curMax = max(curMax + a, a); 7 | maxSum = max(maxSum, curMax); 8 | curMin = min(curMin + a, a); 9 | minSum = min(minSum, curMin); 10 | total += a; 11 | } 12 | return maxSum > 0 ? max(maxSum, total - minSum) : maxSum; 13 | } 14 | }; -------------------------------------------------------------------------------- /926-flip-string-to-monotone-increasing/926-flip-string-to-monotone-increasing.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int minFlipsMonoIncr(string s) { 4 | int count1 = 0, count0 = 0; 5 | for(char ch : s) 6 | { 7 | (ch == '1') ? count1++ : count0++; 8 | count0 = min(count1, count0); 9 | } 10 | return count0; 11 | } 12 | }; -------------------------------------------------------------------------------- /93-restore-ip-addresses/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /94-binary-tree-inorder-traversal/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /944-delete-columns-to-make-sorted/944-delete-columns-to-make-sorted.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int minDeletionSize(vector& strs) { 4 | int cnt = 0; 5 | for (int i = 0 ; i < strs[0].size(); i++) 6 | for (int j = 1; j < strs.size(); j++) { 7 | if (strs[j - 1][i] > strs[j][i]) { 8 | cnt+=1; 9 | break; 10 | } 11 | } 12 | return cnt; 13 | } 14 | }; -------------------------------------------------------------------------------- /944-delete-columns-to-make-sorted/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /953-verifying-an-alien-dictionary/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /977-squares-of-a-sorted-array/977-squares-of-a-sorted-array.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector sortedSquares(vector& nums) { 4 | for(int i = 0 ; i < nums.size() ; i++) nums[i] *= nums[i]; 5 | sort(nums.begin(), nums.end()); 6 | return nums; 7 | } 8 | }; -------------------------------------------------------------------------------- /977-squares-of-a-sorted-array/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /989-add-to-array-form-of-integer/989-add-to-array-form-of-integer.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector addToArrayForm(vector& A, int K) { 4 | for (int i = A.size() - 1; i >= 0 && K > 0; --i) { 5 | A[i] += K; 6 | K = A[i] / 10; 7 | A[i] %= 10; 8 | } 9 | while (K > 0) { 10 | A.insert(A.begin(), K % 10); 11 | K /= 10; 12 | } 13 | return A; 14 | } 15 | }; -------------------------------------------------------------------------------- /997-find-the-town-judge/997-find-the-town-judge.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int findJudge(int n, vector>& trust) { 4 | if(trust.empty() && n == 1) return 1; 5 | vector out(n+1, 0), in(n+1, 0); 6 | for(auto edge : trust) 7 | { 8 | out[edge[0]]++; 9 | in[edge[1]]++; 10 | } 11 | for(int i = 0 ; i <= n ; i++) 12 | { 13 | if(out[i] == 0 && in[i] == n-1) 14 | return i; 15 | } 16 | return -1; 17 | } 18 | }; -------------------------------------------------------------------------------- /997-find-the-town-judge/NOTES.md: -------------------------------------------------------------------------------- 1 | ​ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LeetCode_binarybeast880 2 | Collection of LeetCode questions to ace the coding interview! - Created using [LeetHub](https://github.com/QasimWani/LeetHub) 3 | --------------------------------------------------------------------------------