Skip to content

A collection of LeetCode questions and solutions.

Notifications You must be signed in to change notification settings

YosephSE/Leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode

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

Array

0001-two-sum
0026-remove-duplicates-from-sorted-array

Hash Table

0001-two-sum
0013-roman-to-integer

Math

0009-palindrome-number
0013-roman-to-integer
0412-fizz-buzz

String

0013-roman-to-integer
0412-fizz-buzz

Two Pointers

0026-remove-duplicates-from-sorted-array

Simulation

0412-fizz-buzz

LeetCode Topics

Database

0175-combine-two-tables
0181-employees-earning-more-than-their-managers
0183-customers-who-never-order
0197-rising-temperature
0570-managers-with-at-least-5-direct-reports
0577-employee-bonus
0584-find-customer-referee
0595-big-countries
1153-product-sales-analysis-i
1258-article-views-i
1509-replace-employee-id-with-the-unique-identifier
1724-customer-who-visited-but-did-not-make-any-transactions
1827-invalid-tweets
1908-recyclable-and-low-fat-products

Two Pointers

0005-longest-palindromic-substring
0011-container-with-most-water
0027-remove-element
0028-find-the-index-of-the-first-occurrence-in-a-string
0075-sort-colors
0088-merge-sorted-array
0125-valid-palindrome
0151-reverse-words-in-a-string
0167-two-sum-ii-input-array-is-sorted
0283-move-zeroes
0344-reverse-string
0345-reverse-vowels-of-a-string
0349-intersection-of-two-arrays
0350-intersection-of-two-arrays-ii
0557-reverse-words-in-a-string-iii
0941-sort-array-by-parity
1798-max-number-of-k-sum-pairs
1894-merge-strings-alternately
2128-reverse-prefix-of-word
2481-strictly-palindromic-number
2917-count-pairs-whose-sum-is-less-than-target
3471-minimum-average-of-smallest-and-largest-elements

String

0003-longest-substring-without-repeating-characters
0005-longest-palindromic-substring
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
0125-valid-palindrome
0151-reverse-words-in-a-string
0171-excel-sheet-column-number
0242-valid-anagram
0344-reverse-string
0345-reverse-vowels-of-a-string
0389-find-the-difference
0412-fizz-buzz
0415-add-strings
0500-keyboard-row
0535-encode-and-decode-tinyurl
0557-reverse-words-in-a-string-iii
0599-minimum-index-sum-of-two-lists
0782-jewels-and-stones
0990-verifying-an-alien-dictionary
1205-defanging-an-ip-address
1434-decrypt-string-from-alphabet-to-integer-mapping
1502-construct-k-palindrome-strings
1524-string-matching-in-an-array
1537-maximum-score-after-splitting-a-string
1567-maximum-number-of-vowels-in-a-substring-of-given-length
1786-count-the-number-of-consistent-strings
1797-goal-parser-interpretation
1894-merge-strings-alternately
1987-substrings-of-size-three-with-distinct-characters
2128-reverse-prefix-of-word
2137-final-value-of-variable-after-performing-operations
2219-maximum-number-of-words-found-in-sentences
2292-counting-words-with-a-given-prefix
2470-removing-stars-from-a-string
2594-count-pairs-of-similar-strings
3194-find-words-containing-character
3309-count-prefix-and-suffix-pairs-i
3379-score-of-a-string
3412-permutation-difference-between-two-strings
3455-minimum-length-of-string-after-operations
3567-convert-date-to-binary

String Matching

0028-find-the-index-of-the-first-occurrence-in-a-string
1524-string-matching-in-an-array
2292-counting-words-with-a-given-prefix
3309-count-prefix-and-suffix-pairs-i

Math

0002-add-two-numbers
0007-reverse-integer
0009-palindrome-number
0066-plus-one
0069-sqrtx
0171-excel-sheet-column-number
0268-missing-number
0412-fizz-buzz
0415-add-strings
1013-fibonacci-number
1018-largest-perimeter-triangle
1421-find-numbers-with-even-number-of-digits
1585-the-kth-factor-of-n
1635-number-of-good-pairs
1889-check-if-number-is-a-sum-of-powers-of-three
2278-find-three-consecutive-integers-that-sum-to-a-given-number
2383-add-two-integers
2481-strictly-palindromic-number
2491-smallest-even-multiple
2556-convert-the-temperature
2812-find-the-maximum-achievable-number
3476-find-minimum-operations-to-make-all-elements-divisible-by-three
3567-convert-date-to-binary

Array

0001-two-sum
0004-median-of-two-sorted-arrays
0011-container-with-most-water
0027-remove-element
0035-search-insert-position
0049-group-anagrams
0066-plus-one
0075-sort-colors
0088-merge-sorted-array
0121-best-time-to-buy-and-sell-stock
0135-candy
0136-single-number
0153-find-minimum-in-rotated-sorted-array
0167-two-sum-ii-input-array-is-sorted
0169-majority-element
0209-minimum-size-subarray-sum
0217-contains-duplicate
0219-contains-duplicate-ii
0238-product-of-array-except-self
0268-missing-number
0283-move-zeroes
0334-increasing-triplet-subsequence
0349-intersection-of-two-arrays
0350-intersection-of-two-arrays-ii
0414-third-maximum-number
0500-keyboard-row
0599-minimum-index-sum-of-two-lists
0643-maximum-average-subarray-i
0724-find-pivot-index
0792-binary-search
0941-sort-array-by-parity
0990-verifying-an-alien-dictionary
1018-largest-perimeter-triangle
1319-unique-number-of-occurrences
1354-find-players-with-zero-or-one-losses
1392-find-the-difference-of-two-arrays
1421-find-numbers-with-even-number-of-digits
1524-string-matching-in-an-array
1528-kids-with-the-greatest-number-of-candies
1584-average-salary-excluding-the-minimum-and-maximum-salary
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1635-number-of-good-pairs
1786-count-the-number-of-consistent-strings
1791-richest-customer-wealth
1798-max-number-of-k-sum-pairs
1833-find-the-highest-altitude
2005-check-if-all-the-integers-in-a-range-are-covered
2048-build-array-from-permutation
2058-concatenation-of-array
2137-final-value-of-variable-after-performing-operations
2219-maximum-number-of-words-found-in-sentences
2292-counting-words-with-a-given-prefix
2358-number-of-ways-to-split-array
2594-count-pairs-of-similar-strings
2631-sort-the-students-by-their-kth-score
2766-find-the-prefix-common-array-of-two-arrays
2917-count-pairs-whose-sum-is-less-than-target
3194-find-words-containing-character
3309-count-prefix-and-suffix-pairs-i
3471-minimum-average-of-smallest-and-largest-elements
3476-find-minimum-operations-to-make-all-elements-divisible-by-three

Greedy

0011-container-with-most-water
0135-candy
0334-increasing-triplet-subsequence
1018-largest-perimeter-triangle
1502-construct-k-palindrome-strings
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves

Number Theory

1585-the-kth-factor-of-n
2491-smallest-even-multiple

Binary Search

0004-median-of-two-sorted-arrays
0035-search-insert-position
0069-sqrtx
0153-find-minimum-in-rotated-sorted-array
0167-two-sum-ii-input-array-is-sorted
0209-minimum-size-subarray-sum
0268-missing-number
0349-intersection-of-two-arrays
0350-intersection-of-two-arrays-ii
0374-guess-number-higher-or-lower
0792-binary-search
2917-count-pairs-whose-sum-is-less-than-target

Hash Table

0001-two-sum
0003-longest-substring-without-repeating-characters
0049-group-anagrams
0169-majority-element
0217-contains-duplicate
0219-contains-duplicate-ii
0242-valid-anagram
0268-missing-number
0349-intersection-of-two-arrays
0350-intersection-of-two-arrays-ii
0389-find-the-difference
0500-keyboard-row
0535-encode-and-decode-tinyurl
0599-minimum-index-sum-of-two-lists
0782-jewels-and-stones
0990-verifying-an-alien-dictionary
1319-unique-number-of-occurrences
1354-find-players-with-zero-or-one-losses
1392-find-the-difference-of-two-arrays
1502-construct-k-palindrome-strings
1635-number-of-good-pairs
1786-count-the-number-of-consistent-strings
1798-max-number-of-k-sum-pairs
1987-substrings-of-size-three-with-distinct-characters
2005-check-if-all-the-integers-in-a-range-are-covered
2594-count-pairs-of-similar-strings
2766-find-the-prefix-common-array-of-two-arrays
3412-permutation-difference-between-two-strings
3455-minimum-length-of-string-after-operations

Bit Manipulation

0136-single-number
0268-missing-number
0389-find-the-difference
1786-count-the-number-of-consistent-strings
2594-count-pairs-of-similar-strings
2766-find-the-prefix-common-array-of-two-arrays

Sorting

0049-group-anagrams
0075-sort-colors
0088-merge-sorted-array
0169-majority-element
0217-contains-duplicate
0242-valid-anagram
0268-missing-number
0349-intersection-of-two-arrays
0350-intersection-of-two-arrays-ii
0389-find-the-difference
0414-third-maximum-number
0941-sort-array-by-parity
1018-largest-perimeter-triangle
1354-find-players-with-zero-or-one-losses
1584-average-salary-excluding-the-minimum-and-maximum-salary
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1798-max-number-of-k-sum-pairs
2631-sort-the-students-by-their-kth-score
2917-count-pairs-whose-sum-is-less-than-target
3471-minimum-average-of-smallest-and-largest-elements

Simulation

0412-fizz-buzz
0415-add-strings
1708-design-parking-system
2048-build-array-from-permutation
2058-concatenation-of-array
2137-final-value-of-variable-after-performing-operations
2278-find-three-consecutive-integers-that-sum-to-a-given-number
2470-removing-stars-from-a-string

Divide and Conquer

0004-median-of-two-sorted-arrays
0169-majority-element

Counting

0169-majority-element
1354-find-players-with-zero-or-one-losses
1502-construct-k-palindrome-strings
1635-number-of-good-pairs
1708-design-parking-system
1786-count-the-number-of-consistent-strings
1987-substrings-of-size-three-with-distinct-characters
2594-count-pairs-of-similar-strings
3455-minimum-length-of-string-after-operations

Stack

0020-valid-parentheses
2128-reverse-prefix-of-word
2470-removing-stars-from-a-string

Design

0535-encode-and-decode-tinyurl
1708-design-parking-system

Hash Function

0535-encode-and-decode-tinyurl
3309-count-prefix-and-suffix-pairs-i

Prefix Sum

0209-minimum-size-subarray-sum
0238-product-of-array-except-self
0724-find-pivot-index
1537-maximum-score-after-splitting-a-string
1833-find-the-highest-altitude
2005-check-if-all-the-integers-in-a-range-are-covered
2358-number-of-ways-to-split-array

Trie

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

Linked List

0002-add-two-numbers

Recursion

0002-add-two-numbers
1013-fibonacci-number

Dynamic Programming

0005-longest-palindromic-substring
0121-best-time-to-buy-and-sell-stock
1013-fibonacci-number

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
1987-substrings-of-size-three-with-distinct-characters

Memoization

1013-fibonacci-number

Rolling Hash

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

Matrix

1791-richest-customer-wealth
2631-sort-the-students-by-their-kth-score

Interactive

0374-guess-number-higher-or-lower

Brainteaser

2481-strictly-palindromic-number

About

A collection of LeetCode questions and solutions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published