Skip to content

ELEF-TQ/LeetCode_Master

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode_Master

Collection of LeetCode questions to ace the coding interview! - Created using LeetHub v2

LeetCode Topics

Array

0001-two-sum
0004-median-of-two-sorted-arrays
0011-container-with-most-water
0015-3sum
0016-3sum-closest
0018-4sum
0026-remove-duplicates-from-sorted-array
0027-remove-element
0035-search-insert-position
0036-valid-sudoku
0041-first-missing-positive
0042-trapping-rain-water
0045-jump-game-ii
0048-rotate-image
0049-group-anagrams
0051-n-queens
0053-maximum-subarray
0055-jump-game
0066-plus-one
0075-sort-colors
0080-remove-duplicates-from-sorted-array-ii
0088-merge-sorted-array
0121-best-time-to-buy-and-sell-stock
0122-best-time-to-buy-and-sell-stock-ii
0128-longest-consecutive-sequence
0134-gas-station
0135-candy
0136-single-number
0149-max-points-on-a-line
0150-evaluate-reverse-polish-notation
0152-maximum-product-subarray
0167-two-sum-ii-input-array-is-sorted
0169-majority-element
0189-rotate-array
0200-number-of-islands
0204-count-primes
0209-minimum-size-subarray-sum
0217-contains-duplicate
0219-contains-duplicate-ii
0238-product-of-array-except-self
0268-missing-number
0274-h-index
0283-move-zeroes
0334-increasing-triplet-subsequence
0347-top-k-frequent-elements
0380-insert-delete-getrandom-o1
0442-find-all-duplicates-in-an-array
0448-find-all-numbers-disappeared-in-an-array
0485-max-consecutive-ones
0575-distribute-candies
0605-can-place-flowers
0621-task-scheduler
0643-maximum-average-subarray-i
0645-set-mismatch
0682-baseball-game
0724-find-pivot-index
0733-flood-fill
0792-binary-search
0954-maximum-sum-circular-subarray
0976-largest-perimeter-triangle
0990-verifying-an-alien-dictionary
1319-unique-number-of-occurrences
1365-how-many-numbers-are-smaller-than-the-current-number
1392-find-the-difference-of-two-arrays
1431-kids-with-the-greatest-number-of-candies
1441-build-an-array-with-stack-operations
1470-shuffle-the-array
1480-running-sum-of-1d-array
1499-maximum-performance-of-a-team
1512-number-of-good-pairs
1528-kids-with-the-greatest-number-of-candies
1547-destination-city
1603-running-sum-of-1d-array
1662-check-if-two-string-arrays-are-equivalent
1672-richest-customer-wealth
1706-min-cost-to-connect-all-points
1741-sort-array-by-increasing-frequency
1779-find-nearest-point-that-has-the-same-x-or-y-coordinate
1791-richest-customer-wealth
1798-max-number-of-k-sum-pairs
1833-find-the-highest-altitude
1920-build-array-from-permutation
1927-maximum-ascending-subarray-sum
1929-concatenation-of-array
2011-final-value-of-variable-after-performing-operations
2058-concatenation-of-array
2114-maximum-number-of-words-found-in-sentences
2148-minimum-number-of-moves-to-seat-everyone
2254-check-if-every-row-and-column-contains-all-numbers
2350-find-closest-number-to-zero
2386-min-max-game
2502-sort-the-people
2518-the-employee-that-worked-on-the-longest-task
2529-maximum-count-of-positive-integer-and-negative-integer
2614-maximum-count-of-positive-integer-and-negative-integer
3151-minimum-processing-time

Two Pointers

0005-longest-palindromic-substring
0011-container-with-most-water
0015-3sum
0016-3sum-closest
0018-4sum
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
0042-trapping-rain-water
0075-sort-colors
0080-remove-duplicates-from-sorted-array-ii
0082-remove-duplicates-from-sorted-list-ii
0088-merge-sorted-array
0125-valid-palindrome
0141-linked-list-cycle
0151-reverse-words-in-a-string
0167-two-sum-ii-input-array-is-sorted
0189-rotate-array
0202-happy-number
0234-palindrome-linked-list
0283-move-zeroes
0344-reverse-string
0345-reverse-vowels-of-a-string
0392-is-subsequence
0908-middle-of-the-linked-list
1798-max-number-of-k-sum-pairs
1894-merge-strings-alternately

Sorting

0015-3sum
0016-3sum-closest
0018-4sum
0049-group-anagrams
0075-sort-colors
0088-merge-sorted-array
0169-majority-element
0217-contains-duplicate
0242-valid-anagram
0268-missing-number
0274-h-index
0347-top-k-frequent-elements
0389-find-the-difference
0621-task-scheduler
0645-set-mismatch
0976-largest-perimeter-triangle
1365-how-many-numbers-are-smaller-than-the-current-number
1499-maximum-performance-of-a-team
1741-sort-array-by-increasing-frequency
1777-determine-if-two-strings-are-close
1798-max-number-of-k-sum-pairs
1859-sorting-the-sentence
1970-sorting-the-sentence
2148-minimum-number-of-moves-to-seat-everyone
2502-sort-the-people
3151-minimum-processing-time

Binary Search

0004-median-of-two-sorted-arrays
0035-search-insert-position
0069-sqrtx
0167-two-sum-ii-input-array-is-sorted
0209-minimum-size-subarray-sum
0268-missing-number
0278-first-bad-version
0792-binary-search
2529-maximum-count-of-positive-integer-and-negative-integer
2614-maximum-count-of-positive-integer-and-negative-integer

Sliding Window

0003-longest-substring-without-repeating-characters
0209-minimum-size-subarray-sum
0219-contains-duplicate-ii
0643-maximum-average-subarray-i
1567-maximum-number-of-vowels-in-a-substring-of-given-length

Prefix Sum

0209-minimum-size-subarray-sum
0238-product-of-array-except-self
0724-find-pivot-index
1480-running-sum-of-1d-array
1603-running-sum-of-1d-array
1833-find-the-highest-altitude

Divide and Conquer

0004-median-of-two-sorted-arrays
0053-maximum-subarray
0169-majority-element
0190-reverse-bits
0191-number-of-1-bits
0347-top-k-frequent-elements
0954-maximum-sum-circular-subarray

Dynamic Programming

0005-longest-palindromic-substring
0042-trapping-rain-water
0045-jump-game-ii
0053-maximum-subarray
0055-jump-game
0070-climbing-stairs
0121-best-time-to-buy-and-sell-stock
0122-best-time-to-buy-and-sell-stock-ii
0152-maximum-product-subarray
0338-counting-bits
0392-is-subsequence
0516-longest-palindromic-subsequence
0954-maximum-sum-circular-subarray
1013-fibonacci-number
1250-longest-common-subsequence

Hash Table

0001-two-sum
0003-longest-substring-without-repeating-characters
0012-integer-to-roman
0013-roman-to-integer
0036-valid-sudoku
0041-first-missing-positive
0049-group-anagrams
0128-longest-consecutive-sequence
0141-linked-list-cycle
0149-max-points-on-a-line
0169-majority-element
0202-happy-number
0205-isomorphic-strings
0217-contains-duplicate
0219-contains-duplicate-ii
0242-valid-anagram
0268-missing-number
0290-word-pattern
0347-top-k-frequent-elements
0380-insert-delete-getrandom-o1
0383-ransom-note
0387-first-unique-character-in-a-string
0389-find-the-difference
0409-longest-palindrome
0442-find-all-duplicates-in-an-array
0448-find-all-numbers-disappeared-in-an-array
0575-distribute-candies
0621-task-scheduler
0645-set-mismatch
0990-verifying-an-alien-dictionary
1319-unique-number-of-occurrences
1365-how-many-numbers-are-smaller-than-the-current-number
1392-find-the-difference-of-two-arrays
1512-number-of-good-pairs
1547-destination-city
1741-sort-array-by-increasing-frequency
1777-determine-if-two-strings-are-close
1798-max-number-of-k-sum-pairs
1915-check-if-one-string-swap-can-make-strings-equal
1960-check-if-the-sentence-is-pangram
2254-check-if-every-row-and-column-contains-all-numbers
2475-largest-palindromic-number
2502-sort-the-people
3412-permutation-difference-between-two-strings

Linked List

0002-add-two-numbers
0019-remove-nth-node-from-end-of-list
0021-merge-two-sorted-lists
0024-swap-nodes-in-pairs
0082-remove-duplicates-from-sorted-list-ii
0083-remove-duplicates-from-sorted-list
0092-reverse-linked-list-ii
0141-linked-list-cycle
0206-reverse-linked-list
0234-palindrome-linked-list
0908-middle-of-the-linked-list

Math

0002-add-two-numbers
0007-reverse-integer
0009-palindrome-number
0012-integer-to-roman
0013-roman-to-integer
0048-rotate-image
0050-powx-n
0066-plus-one
0067-add-binary
0069-sqrtx
0070-climbing-stairs
0149-max-points-on-a-line
0150-evaluate-reverse-polish-notation
0172-factorial-trailing-zeroes
0189-rotate-array
0202-happy-number
0204-count-primes
0258-add-digits
0268-missing-number
0371-sum-of-two-integers
0380-insert-delete-getrandom-o1
0412-fizz-buzz
0976-largest-perimeter-triangle
1013-fibonacci-number
1146-greatest-common-divisor-of-strings
1195-distribute-candies-to-people
1281-subtract-the-product-and-sum-of-digits-of-an-integer
1444-number-of-steps-to-reduce-a-number-to-zero
1512-number-of-good-pairs
2235-add-two-integers

Recursion

0002-add-two-numbers
0021-merge-two-sorted-lists
0024-swap-nodes-in-pairs
0050-powx-n
0206-reverse-linked-list
0234-palindrome-linked-list
1013-fibonacci-number

Matrix

0036-valid-sudoku
0048-rotate-image
0200-number-of-islands
0733-flood-fill
1672-richest-customer-wealth
1791-richest-customer-wealth
2254-check-if-every-row-and-column-contains-all-numbers

String

0003-longest-substring-without-repeating-characters
0005-longest-palindromic-substring
0006-zigzag-conversion
0012-integer-to-roman
0013-roman-to-integer
0014-longest-common-prefix
0020-valid-parentheses
0028-find-the-index-of-the-first-occurrence-in-a-string
0049-group-anagrams
0058-length-of-last-word
0067-add-binary
0071-simplify-path
0125-valid-palindrome
0151-reverse-words-in-a-string
0205-isomorphic-strings
0242-valid-anagram
0290-word-pattern
0344-reverse-string
0345-reverse-vowels-of-a-string
0383-ransom-note
0387-first-unique-character-in-a-string
0389-find-the-difference
0392-is-subsequence
0409-longest-palindrome
0412-fizz-buzz
0459-repeated-substring-pattern
0516-longest-palindromic-subsequence
0990-verifying-an-alien-dictionary
1108-defanging-an-ip-address
1146-greatest-common-divisor-of-strings
1250-longest-common-subsequence
1542-consecutive-characters
1547-destination-city
1567-maximum-number-of-vowels-in-a-substring-of-given-length
1662-check-if-two-string-arrays-are-equivalent
1777-determine-if-two-strings-are-close
1859-sorting-the-sentence
1894-merge-strings-alternately
1915-check-if-one-string-swap-can-make-strings-equal
1960-check-if-the-sentence-is-pangram
1970-sorting-the-sentence
2011-final-value-of-variable-after-performing-operations
2114-maximum-number-of-words-found-in-sentences
2243-check-if-all-as-appears-before-all-bs
2470-removing-stars-from-a-string
2475-largest-palindromic-number
2502-sort-the-people
3412-permutation-difference-between-two-strings

Simulation

0067-add-binary
0258-add-digits
0412-fizz-buzz
0682-baseball-game
1195-distribute-candies-to-people
1441-build-an-array-with-stack-operations
1920-build-array-from-permutation
1929-concatenation-of-array
2011-final-value-of-variable-after-performing-operations
2058-concatenation-of-array
2386-min-max-game
2470-removing-stars-from-a-string

Bit Manipulation

0067-add-binary
0136-single-number
0190-reverse-bits
0191-number-of-1-bits
0268-missing-number
0338-counting-bits
0371-sum-of-two-integers
0389-find-the-difference
0645-set-mismatch
1444-number-of-steps-to-reduce-a-number-to-zero

Counting

0169-majority-element
0347-top-k-frequent-elements
0383-ransom-note
0387-first-unique-character-in-a-string
0621-task-scheduler
1512-number-of-good-pairs
1777-determine-if-two-strings-are-close
1915-check-if-one-string-swap-can-make-strings-equal
2475-largest-palindromic-number
2529-maximum-count-of-positive-integer-and-negative-integer
2614-maximum-count-of-positive-integer-and-negative-integer

Greedy

0011-container-with-most-water
0045-jump-game-ii
0055-jump-game
0122-best-time-to-buy-and-sell-stock-ii
0134-gas-station
0135-candy
0334-increasing-triplet-subsequence
0409-longest-palindrome
0605-can-place-flowers
0621-task-scheduler
0976-largest-perimeter-triangle
1499-maximum-performance-of-a-team
2148-minimum-number-of-moves-to-seat-everyone
2475-largest-palindromic-number
3151-minimum-processing-time

Queue

0387-first-unique-character-in-a-string
0954-maximum-sum-circular-subarray

Monotonic Queue

0954-maximum-sum-circular-subarray

Geometry

0149-max-points-on-a-line

Union Find

0128-longest-consecutive-sequence
0200-number-of-islands
1706-min-cost-to-connect-all-points

String Matching

0028-find-the-index-of-the-first-occurrence-in-a-string
0459-repeated-substring-pattern

Trie

0014-longest-common-prefix

Stack

0020-valid-parentheses
0042-trapping-rain-water
0071-simplify-path
0150-evaluate-reverse-polish-notation
0234-palindrome-linked-list
0682-baseball-game
1441-build-an-array-with-stack-operations
2470-removing-stars-from-a-string

Tree

0100-same-tree
0104-maximum-depth-of-binary-tree

Depth-First Search

0100-same-tree
0104-maximum-depth-of-binary-tree
0200-number-of-islands
0733-flood-fill

Breadth-First Search

0100-same-tree
0104-maximum-depth-of-binary-tree
0200-number-of-islands
0733-flood-fill

Binary Tree

0100-same-tree
0104-maximum-depth-of-binary-tree

Counting Sort

0274-h-index
1365-how-many-numbers-are-smaller-than-the-current-number
2148-minimum-number-of-moves-to-seat-everyone

Number Theory

0204-count-primes
0258-add-digits

Memoization

0070-climbing-stairs
1013-fibonacci-number

Enumeration

0204-count-primes

Backtracking

0051-n-queens

Heap (Priority Queue)

0347-top-k-frequent-elements
0621-task-scheduler
1499-maximum-performance-of-a-team

Database

0197-rising-temperature
0570-managers-with-at-least-5-direct-reports
0577-employee-bonus
0584-find-customer-referee
0595-big-countries
0596-classes-more-than-5-students
0619-biggest-single-number
1153-product-sales-analysis-i
1245-user-activity-for-the-past-30-days-i
1258-article-views-i
1415-students-and-examinations
1509-replace-employee-id-with-the-unique-identifier
1724-customer-who-visited-but-did-not-make-any-transactions
1801-average-time-of-process-per-machine
1827-invalid-tweets
1877-find-followers-count
1882-the-number-of-employees-which-report-to-each-employee
1908-recyclable-and-low-fat-products
2495-number-of-unique-subjects-taught-by-each-teacher

Bucket Sort

0347-top-k-frequent-elements

Quickselect

0347-top-k-frequent-elements

Monotonic Stack

0042-trapping-rain-water

Design

0380-insert-delete-getrandom-o1

Randomized

0380-insert-delete-getrandom-o1

Interactive

0278-first-bad-version

Graph

1706-min-cost-to-connect-all-points

Minimum Spanning Tree

1706-min-cost-to-connect-all-points

About

Compilation of solutions for various LeetCode problems

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published