Skip to content

This repository serves as a collection of my solutions to various LeetCode Data Structures and Algorithms (DSA) problems.

License

Notifications You must be signed in to change notification settings

Keshabkjha/LeetCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode

Here I am sharing my solution of Leetcode Problems.

LeetCode Topics

Linked List

0002-add-two-numbers
0019-remove-nth-node-from-end-of-list
0021-merge-two-sorted-lists
0023-merge-k-sorted-lists
0083-remove-duplicates-from-sorted-list
0141-linked-list-cycle
0146-lru-cache
0160-intersection-of-two-linked-lists
0203-remove-linked-list-elements
0206-reverse-linked-list
0234-palindrome-linked-list
0445-add-two-numbers-ii
0766-flatten-a-multilevel-doubly-linked-list
0816-design-hashset
0817-design-hashmap
1411-convert-binary-number-in-a-linked-list-to-integer
2389-design-a-text-editor

Recursion

0002-add-two-numbers
0021-merge-two-sorted-lists
0050-powx-n
0060-permutation-sequence
0203-remove-linked-list-elements
0206-reverse-linked-list
0231-power-of-two
0234-palindrome-linked-list
0342-power-of-four
1013-fibonacci-number

Array

0001-two-sum
0004-median-of-two-sorted-arrays
0026-remove-duplicates-from-sorted-array
0027-remove-element
0035-search-insert-position
0051-n-queens
0054-spiral-matrix
0066-plus-one
0073-set-matrix-zeroes
0088-merge-sorted-array
0108-convert-sorted-array-to-binary-search-tree
0118-pascals-triangle
0119-pascals-triangle-ii
0121-best-time-to-buy-and-sell-stock
0123-best-time-to-buy-and-sell-stock-iii
0136-single-number
0169-majority-element
0217-contains-duplicate
0219-contains-duplicate-ii
0228-summary-ranges
0268-missing-number
0283-move-zeroes
0407-trapping-rain-water-ii
0448-find-all-numbers-disappeared-in-an-array
0455-assign-cookies
0463-island-perimeter
0485-max-consecutive-ones
0494-target-sum
0495-teemo-attacking
0496-next-greater-element-i
0500-keyboard-row
0506-relative-ranks
0561-array-partition
0566-reshape-the-matrix
0575-distribute-candies
0594-longest-harmonious-subsequence
0598-range-addition-ii
0599-minimum-index-sum-of-two-lists
0605-can-place-flowers
0628-maximum-product-of-three-numbers
0643-maximum-average-subarray-i
0674-longest-continuous-increasing-subsequence
0682-baseball-game
0714-best-time-to-buy-and-sell-stock-with-transaction-fee
0747-min-cost-climbing-stairs
0780-max-chunks-to-make-sorted
0792-binary-search
0816-design-hashset
0817-design-hashmap
0890-lemonade-change
0898-transpose-matrix
0932-monotonic-array
0941-sort-array-by-parity
0952-word-subsets
0958-sort-array-by-parity-ii
0993-tallest-billboard
1018-largest-perimeter-triangle
1025-minimum-cost-for-tickets
1063-best-sightseeing-pair
1087-longest-arithmetic-subsequence
1137-height-checker
1349-check-if-it-is-a-straight-line
1396-count-servers-that-communicate
1400-find-winner-on-a-tic-tac-toe-game
1458-sort-integers-by-the-number-of-1-bits
1463-the-k-weakest-rows-in-a-matrix
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1496-lucky-numbers-in-a-matrix
1524-string-matching-in-an-array
1528-kids-with-the-greatest-number-of-candies
1548-check-if-all-1s-are-at-least-length-k-places-away
1570-final-prices-with-a-special-discount-in-a-shop
1584-average-salary-excluding-the-minimum-and-maximum-salary
1626-can-make-arithmetic-progression-from-sequence
1635-number-of-good-pairs
1677-matrix-diagonal-sum
1680-count-all-possible-routes
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
1791-richest-customer-wealth
1876-map-of-highest-peak
1886-minimum-limit-of-balls-in-a-bag
1917-maximum-average-pass-ratio
1950-sign-of-the-product-of-an-array
1956-maximum-element-after-decreasing-and-rearranging
1966-frequency-of-the-most-frequent-element
1988-minimize-maximum-pair-sum-in-array
2107-find-unique-binary-string
2145-grid-game
2232-adding-spaces-to-a-string
2358-number-of-ways-to-split-array
2465-shifting-letters-ii
2533-bitwise-xor-of-all-pairings
2538-minimum-cost-to-make-array-equal
2553-total-cost-to-hire-k-workers
2640-maximum-number-of-integers-to-choose-from-a-range-i
2685-first-completely-painted-row-or-column
2691-count-vowel-strings-in-ranges
2692-take-gifts-from-the-richest-pile
2695-find-score-of-an-array-after-marking-all-elements
2764-maximum-number-of-fish-in-a-grid
2766-find-the-prefix-common-array-of-two-arrays
2792-neighboring-bitwise-xor
2868-continuous-subarrays
2891-maximum-beauty-of-an-array-after-applying-operation
2919-maximum-number-of-groups-with-increasing-length
3181-find-building-where-alice-and-bob-can-meet
3219-make-lexicographically-smallest-array-by-swapping-elements
3309-count-prefix-and-suffix-pairs-i
3427-special-array-ii
3555-final-array-state-after-k-multiplication-operations-i

Two Pointers

0005-longest-palindromic-substring
0019-remove-nth-node-from-end-of-list
0026-remove-duplicates-from-sorted-array
0027-remove-element
0028-find-the-index-of-the-first-occurrence-in-a-string
0088-merge-sorted-array
0125-valid-palindrome
0141-linked-list-cycle
0160-intersection-of-two-linked-lists
0202-happy-number
0234-palindrome-linked-list
0283-move-zeroes
0392-is-subsequence
0455-assign-cookies
0557-reverse-words-in-a-string-iii
0874-backspace-string-compare
0941-sort-array-by-parity
0958-sort-array-by-parity-ii
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
1894-merge-strings-alternately
1988-minimize-maximum-pair-sum-in-array
2232-adding-spaces-to-a-string
2414-move-pieces-to-obtain-a-string
2553-total-cost-to-hire-k-workers
3018-make-string-a-subsequence-using-cyclic-increments

Hash Table

0001-two-sum
0003-longest-substring-without-repeating-characters
0013-roman-to-integer
0073-set-matrix-zeroes
0141-linked-list-cycle
0146-lru-cache
0160-intersection-of-two-linked-lists
0169-majority-element
0202-happy-number
0205-isomorphic-strings
0217-contains-duplicate
0219-contains-duplicate-ii
0242-valid-anagram
0268-missing-number
0389-find-the-difference
0448-find-all-numbers-disappeared-in-an-array
0496-next-greater-element-i
0500-keyboard-row
0575-distribute-candies
0594-longest-harmonious-subsequence
0599-minimum-index-sum-of-two-lists
0816-design-hashset
0817-design-hashmap
0889-buddy-strings
0952-word-subsets
1087-longest-arithmetic-subsequence
1400-find-winner-on-a-tic-tac-toe-game
1502-construct-k-palindrome-strings
1635-number-of-good-pairs
2059-unique-length-3-palindromic-subsequences
2107-find-unique-binary-string
2300-construct-string-with-repeat-limit
2640-maximum-number-of-integers-to-choose-from-a-range-i
2685-first-completely-painted-row-or-column
2695-find-score-of-an-array-after-marking-all-elements
2766-find-the-prefix-common-array-of-two-arrays
3267-find-longest-special-substring-that-occurs-thrice-i

String

0003-longest-substring-without-repeating-characters
0005-longest-palindromic-substring
0006-zigzag-conversion
0013-roman-to-integer
0014-longest-common-prefix
0020-valid-parentheses
0028-find-the-index-of-the-first-occurrence-in-a-string
0043-multiply-strings
0058-length-of-last-word
0067-add-binary
0125-valid-palindrome
0168-excel-sheet-column-title
0171-excel-sheet-column-number
0205-isomorphic-strings
0242-valid-anagram
0257-binary-tree-paths
0389-find-the-difference
0392-is-subsequence
0434-number-of-segments-in-a-string
0459-repeated-substring-pattern
0482-license-key-formatting
0500-keyboard-row
0520-detect-capital
0521-longest-uncommon-subsequence-i
0551-student-attendance-record-i
0557-reverse-words-in-a-string-iii
0599-minimum-index-sum-of-two-lists
0657-robot-return-to-origin
0742-to-lower-case
0874-backspace-string-compare
0889-buddy-strings
0952-word-subsets
1119-robot-bounded-in-circle
1274-number-of-days-between-two-dates
1490-generate-a-string-with-characters-that-have-odd-counts
1502-construct-k-palindrome-strings
1524-string-matching-in-an-array
1532-reformat-the-string
1537-maximum-score-after-splitting-a-string
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
1894-merge-strings-alternately
2059-unique-length-3-palindromic-subsequences
2107-find-unique-binary-string
2221-check-if-a-parentheses-string-can-be-valid
2232-adding-spaces-to-a-string
2300-construct-string-with-repeat-limit
2389-design-a-text-editor
2414-move-pieces-to-obtain-a-string
2465-shifting-letters-ii
2691-count-vowel-strings-in-ranges
3018-make-string-a-subsequence-using-cyclic-increments
3267-find-longest-special-substring-that-occurs-thrice-i
3309-count-prefix-and-suffix-pairs-i

String Matching

0028-find-the-index-of-the-first-occurrence-in-a-string
0459-repeated-substring-pattern
0572-subtree-of-another-tree
1524-string-matching-in-an-array
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
3309-count-prefix-and-suffix-pairs-i

Math

0002-add-two-numbers
0007-reverse-integer
0009-palindrome-number
0013-roman-to-integer
0043-multiply-strings
0050-powx-n
0060-permutation-sequence
0066-plus-one
0067-add-binary
0069-sqrtx
0070-climbing-stairs
0168-excel-sheet-column-title
0171-excel-sheet-column-number
0202-happy-number
0231-power-of-two
0263-ugly-number
0268-missing-number
0342-power-of-four
0441-arranging-coins
0445-add-two-numbers-ii
0504-base-7
0507-perfect-number
0598-range-addition-ii
0628-maximum-product-of-three-numbers
1013-fibonacci-number
1018-largest-perimeter-triangle
1119-robot-bounded-in-circle
1274-number-of-days-between-two-dates
1349-check-if-it-is-a-straight-line
1411-convert-binary-number-in-a-linked-list-to-integer
1444-number-of-steps-to-reduce-a-number-to-zero
1448-maximum-69-number
1630-count-odd-numbers-in-an-interval-range
1635-number-of-good-pairs
1950-sign-of-the-product-of-an-array
2919-maximum-number-of-groups-with-increasing-length
3555-final-array-state-after-k-multiplication-operations-i

Trie

0014-longest-common-prefix
3309-count-prefix-and-suffix-pairs-i

Stack

0020-valid-parentheses
0094-binary-tree-inorder-traversal
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0225-implement-stack-using-queues
0234-palindrome-linked-list
0445-add-two-numbers-ii
0496-next-greater-element-i
0682-baseball-game
0775-n-ary-tree-preorder-traversal
0780-max-chunks-to-make-sorted
0874-backspace-string-compare
1570-final-prices-with-a-special-discount-in-a-shop
2221-check-if-a-parentheses-string-can-be-valid
2389-design-a-text-editor
3181-find-building-where-alice-and-bob-can-meet

Greedy

0455-assign-cookies
0561-array-partition
0605-can-place-flowers
0714-best-time-to-buy-and-sell-stock-with-transaction-fee
0780-max-chunks-to-make-sorted
0890-lemonade-change
1018-largest-perimeter-triangle
1448-maximum-69-number
1502-construct-k-palindrome-strings
1917-maximum-average-pass-ratio
1956-maximum-element-after-decreasing-and-rearranging
1966-frequency-of-the-most-frequent-element
1988-minimize-maximum-pair-sum-in-array
2221-check-if-a-parentheses-string-can-be-valid
2300-construct-string-with-repeat-limit
2509-minimize-xor
2538-minimum-cost-to-make-array-equal
2640-maximum-number-of-integers-to-choose-from-a-range-i
2919-maximum-number-of-groups-with-increasing-length

Sorting

0088-merge-sorted-array
0169-majority-element
0217-contains-duplicate
0242-valid-anagram
0268-missing-number
0389-find-the-difference
0455-assign-cookies
0506-relative-ranks
0561-array-partition
0594-longest-harmonious-subsequence
0628-maximum-product-of-three-numbers
0780-max-chunks-to-make-sorted
0941-sort-array-by-parity
0958-sort-array-by-parity-ii
1018-largest-perimeter-triangle
1137-height-checker
1458-sort-integers-by-the-number-of-1-bits
1463-the-k-weakest-rows-in-a-matrix
1584-average-salary-excluding-the-minimum-and-maximum-salary
1626-can-make-arithmetic-progression-from-sequence
1956-maximum-element-after-decreasing-and-rearranging
1966-frequency-of-the-most-frequent-element
1988-minimize-maximum-pair-sum-in-array
2538-minimum-cost-to-make-array-equal
2640-maximum-number-of-integers-to-choose-from-a-range-i
2695-find-score-of-an-array-after-marking-all-elements
2891-maximum-beauty-of-an-array-after-applying-operation
2919-maximum-number-of-groups-with-increasing-length
3219-make-lexicographically-smallest-array-by-swapping-elements

Binary Search

0004-median-of-two-sorted-arrays
0035-search-insert-position
0069-sqrtx
0222-count-complete-tree-nodes
0268-missing-number
0278-first-bad-version
0441-arranging-coins
0792-binary-search
1087-longest-arithmetic-subsequence
1463-the-k-weakest-rows-in-a-matrix
1886-minimum-limit-of-balls-in-a-bag
1966-frequency-of-the-most-frequent-element
2538-minimum-cost-to-make-array-equal
2640-maximum-number-of-integers-to-choose-from-a-range-i
2891-maximum-beauty-of-an-array-after-applying-operation
2919-maximum-number-of-groups-with-increasing-length
3181-find-building-where-alice-and-bob-can-meet
3267-find-longest-special-substring-that-occurs-thrice-i
3427-special-array-ii

Tree

0094-binary-tree-inorder-traversal
0100-same-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0108-convert-sorted-array-to-binary-search-tree
0110-balanced-binary-tree
0111-minimum-depth-of-binary-tree
0112-path-sum
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0222-count-complete-tree-nodes
0257-binary-tree-paths
0501-find-mode-in-binary-search-tree
0572-subtree-of-another-tree
0775-n-ary-tree-preorder-traversal
2493-reverse-odd-levels-of-binary-tree
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level
3058-maximum-number-of-k-divisible-components
3439-find-minimum-diameter-after-merging-two-trees

Depth-First Search

0094-binary-tree-inorder-traversal
0100-same-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0110-balanced-binary-tree
0111-minimum-depth-of-binary-tree
0112-path-sum
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0257-binary-tree-paths
0463-island-perimeter
0501-find-mode-in-binary-search-tree
0572-subtree-of-another-tree
0684-redundant-connection
0766-flatten-a-multilevel-doubly-linked-list
0775-n-ary-tree-preorder-traversal
0820-find-eventual-safe-states
1396-count-servers-that-communicate
1558-course-schedule-iv
2246-maximum-employees-to-be-invited-to-a-meeting
2493-reverse-odd-levels-of-binary-tree
2764-maximum-number-of-fish-in-a-grid
3058-maximum-number-of-k-divisible-components
3439-find-minimum-diameter-after-merging-two-trees

Binary Tree

0094-binary-tree-inorder-traversal
0100-same-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0108-convert-sorted-array-to-binary-search-tree
0110-balanced-binary-tree
0111-minimum-depth-of-binary-tree
0112-path-sum
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0222-count-complete-tree-nodes
0257-binary-tree-paths
0501-find-mode-in-binary-search-tree
0572-subtree-of-another-tree
2493-reverse-odd-levels-of-binary-tree
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level

Breadth-First Search

0100-same-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0111-minimum-depth-of-binary-tree
0112-path-sum
0407-trapping-rain-water-ii
0463-island-perimeter
0684-redundant-connection
0820-find-eventual-safe-states
1396-count-servers-that-communicate
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1558-course-schedule-iv
1876-map-of-highest-peak
2493-reverse-odd-levels-of-binary-tree
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level
2764-maximum-number-of-fish-in-a-grid
3439-find-minimum-diameter-after-merging-two-trees

Bit Manipulation

0067-add-binary
0136-single-number
0190-reverse-bits
0191-number-of-1-bits
0222-count-complete-tree-nodes
0231-power-of-two
0268-missing-number
0338-counting-bits
0342-power-of-four
0389-find-the-difference
0401-binary-watch
0461-hamming-distance
1444-number-of-steps-to-reduce-a-number-to-zero
1458-sort-integers-by-the-number-of-1-bits
2059-unique-length-3-palindromic-subsequences
2509-minimize-xor
2533-bitwise-xor-of-all-pairings
2766-find-the-prefix-common-array-of-two-arrays
2792-neighboring-bitwise-xor

Simulation

0043-multiply-strings
0054-spiral-matrix
0067-add-binary
0495-teemo-attacking
0566-reshape-the-matrix
0657-robot-return-to-origin
0682-baseball-game
0874-backspace-string-compare
0898-transpose-matrix
1119-robot-bounded-in-circle
1400-find-winner-on-a-tic-tac-toe-game
2232-adding-spaces-to-a-string
2389-design-a-text-editor
2553-total-cost-to-hire-k-workers
2692-take-gifts-from-the-richest-pile
2695-find-score-of-an-array-after-marking-all-elements
3555-final-array-state-after-k-multiplication-operations-i

Dynamic Programming

0005-longest-palindromic-substring
0070-climbing-stairs
0118-pascals-triangle
0119-pascals-triangle-ii
0121-best-time-to-buy-and-sell-stock
0123-best-time-to-buy-and-sell-stock-iii
0338-counting-bits
0392-is-subsequence
0494-target-sum
0714-best-time-to-buy-and-sell-stock-with-transaction-fee
0747-min-cost-climbing-stairs
0993-tallest-billboard
1013-fibonacci-number
1025-minimum-cost-for-tickets
1063-best-sightseeing-pair
1087-longest-arithmetic-subsequence
1680-count-all-possible-routes
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
2562-count-ways-to-build-good-strings

Memoization

0070-climbing-stairs
1013-fibonacci-number
1680-count-all-possible-routes

Divide and Conquer

0004-median-of-two-sorted-arrays
0023-merge-k-sorted-lists
0108-convert-sorted-array-to-binary-search-tree
0169-majority-element
0190-reverse-bits
0191-number-of-1-bits

Binary Search Tree

0108-convert-sorted-array-to-binary-search-tree
0501-find-mode-in-binary-search-tree

Database

0175-combine-two-tables
0181-employees-earning-more-than-their-managers

Counting

0169-majority-element
0594-longest-harmonious-subsequence
1396-count-servers-that-communicate
1458-sort-integers-by-the-number-of-1-bits
1502-construct-k-palindrome-strings
1635-number-of-good-pairs
2300-construct-string-with-repeat-limit
3267-find-longest-special-substring-that-occurs-thrice-i

Sliding Window

0003-longest-substring-without-repeating-characters
0219-contains-duplicate-ii
0594-longest-harmonious-subsequence
0643-maximum-average-subarray-i
1966-frequency-of-the-most-frequent-element
2868-continuous-subarrays
2891-maximum-beauty-of-an-array-after-applying-operation
3267-find-longest-special-substring-that-occurs-thrice-i

Prefix Sum

1537-maximum-score-after-splitting-a-string
1966-frequency-of-the-most-frequent-element
2059-unique-length-3-palindromic-subsequences
2145-grid-game
2358-number-of-ways-to-split-array
2465-shifting-letters-ii
2538-minimum-cost-to-make-array-equal
2691-count-vowel-strings-in-ranges
3427-special-array-ii

Heap (Priority Queue)

0023-merge-k-sorted-lists
0407-trapping-rain-water-ii
0506-relative-ranks
1463-the-k-weakest-rows-in-a-matrix
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1917-maximum-average-pass-ratio
2300-construct-string-with-repeat-limit
2553-total-cost-to-hire-k-workers
2678-design-graph-with-shortest-path-calculator
2692-take-gifts-from-the-richest-pile
2695-find-score-of-an-array-after-marking-all-elements
2868-continuous-subarrays
3181-find-building-where-alice-and-bob-can-meet
3555-final-array-state-after-k-multiplication-operations-i

Design

0146-lru-cache
0225-implement-stack-using-queues
0816-design-hashset
0817-design-hashmap
2389-design-a-text-editor
2678-design-graph-with-shortest-path-calculator

Queue

0225-implement-stack-using-queues
2868-continuous-subarrays

Matrix

0054-spiral-matrix
0073-set-matrix-zeroes
0407-trapping-rain-water-ii
0463-island-perimeter
0566-reshape-the-matrix
0898-transpose-matrix
1396-count-servers-that-communicate
1400-find-winner-on-a-tic-tac-toe-game
1463-the-k-weakest-rows-in-a-matrix
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1496-lucky-numbers-in-a-matrix
1677-matrix-diagonal-sum
1791-richest-customer-wealth
1876-map-of-highest-peak
2145-grid-game
2685-first-completely-painted-row-or-column
2764-maximum-number-of-fish-in-a-grid

Hash Function

0572-subtree-of-another-tree
0816-design-hashset
0817-design-hashmap
3309-count-prefix-and-suffix-pairs-i

Backtracking

0051-n-queens
0257-binary-tree-paths
0401-binary-watch
0494-target-sum
2107-find-unique-binary-string

Monotonic Stack

0496-next-greater-element-i
0780-max-chunks-to-make-sorted
1570-final-prices-with-a-special-discount-in-a-shop
3181-find-building-where-alice-and-bob-can-meet

Geometry

1349-check-if-it-is-a-straight-line

Counting Sort

0561-array-partition
1137-height-checker

Graph

0684-redundant-connection
0820-find-eventual-safe-states
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1558-course-schedule-iv
2246-maximum-employees-to-be-invited-to-a-meeting
2678-design-graph-with-shortest-path-calculator
3439-find-minimum-diameter-after-merging-two-trees

Shortest Path

1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
2678-design-graph-with-shortest-path-calculator

Interactive

0278-first-bad-version

Doubly-Linked List

0146-lru-cache
0766-flatten-a-multilevel-doubly-linked-list
2389-design-a-text-editor

Merge Sort

0023-merge-k-sorted-lists

Ordered Set

2868-continuous-subarrays

Monotonic Queue

2868-continuous-subarrays

Binary Indexed Tree

3181-find-building-where-alice-and-bob-can-meet

Segment Tree

3181-find-building-where-alice-and-bob-can-meet

Rolling Hash

3309-count-prefix-and-suffix-pairs-i

Brainteaser

2533-bitwise-xor-of-all-pairings

Union Find

0684-redundant-connection
1396-count-servers-that-communicate
2764-maximum-number-of-fish-in-a-grid
3219-make-lexicographically-smallest-array-by-swapping-elements

Topological Sort

0820-find-eventual-safe-states
1558-course-schedule-iv
2246-maximum-employees-to-be-invited-to-a-meeting

About

This repository serves as a collection of my solutions to various LeetCode Data Structures and Algorithms (DSA) problems.

Topics

Resources

License

Stars

Watchers

Forks