Skip to content

A repository of my LeetCode solutions managed using LeetHub.

Notifications You must be signed in to change notification settings

deluxejamie/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

886 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leetcode

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

LeetCode Topics

Array

0001-two-sum
0011-container-with-most-water
0036-valid-sudoku
0039-combination-sum
0045-jump-game-ii
0046-permutations
0049-group-anagrams
0053-maximum-subarray
0055-jump-game
0056-merge-intervals
0063-unique-paths-ii
0064-minimum-path-sum
0073-set-matrix-zeroes
0078-subsets
0079-word-search
0088-merge-sorted-array
0090-subsets-ii
0118-pascals-triangle
0120-triangle
0121-best-time-to-buy-and-sell-stock
0128-longest-consecutive-sequence
0130-surrounded-regions
0134-gas-station
0136-single-number
0139-word-break
0150-evaluate-reverse-polish-notation
0167-two-sum-ii-input-array-is-sorted
0198-house-robber
0200-number-of-islands
0209-minimum-size-subarray-sum
0213-house-robber-ii
0215-kth-largest-element-in-an-array
0217-contains-duplicate
0219-contains-duplicate-ii
0229-majority-element-ii
0238-product-of-array-except-self
0274-h-index
0287-find-the-duplicate-number
0322-coin-change
0347-top-k-frequent-elements
0384-shuffle-an-array
0442-find-all-duplicates-in-an-array
0718-maximum-length-of-repeated-subarray
0735-asteroid-collision
0747-min-cost-climbing-stairs
0792-binary-search
0846-hand-of-straights
0944-delete-columns-to-make-sorted
0973-k-closest-points-to-origin
1046-last-stone-weight
1138-grumpy-bookstore-owner
1306-minimum-absolute-difference
1458-sort-integers-by-the-number-of-1-bits
1604-least-number-of-unique-integers-after-k-removals
1769-get-maximum-in-generated-array
2428-equal-row-and-column-pairs
3242-count-elements-with-maximum-frequency

Hash Table

0001-two-sum
0003-longest-substring-without-repeating-characters
0012-integer-to-roman
0017-letter-combinations-of-a-phone-number
0036-valid-sudoku
0049-group-anagrams
0073-set-matrix-zeroes
0076-minimum-window-substring
0128-longest-consecutive-sequence
0139-word-break
0146-lru-cache
0187-repeated-dna-sequences
0205-isomorphic-strings
0217-contains-duplicate
0219-contains-duplicate-ii
0229-majority-element-ii
0242-valid-anagram
0299-bulls-and-cows
0347-top-k-frequent-elements
0424-longest-repeating-character-replacement
0442-find-all-duplicates-in-an-array
0846-hand-of-straights
1264-maximum-number-of-words-you-can-type
1604-least-number-of-unique-integers-after-k-removals
1777-determine-if-two-strings-are-close
2177-check-whether-two-strings-are-almost-equivalent
2428-equal-row-and-column-pairs
3242-count-elements-with-maximum-frequency
3872-find-most-frequent-vowel-and-consonant

Linked List

0002-add-two-numbers
0019-remove-nth-node-from-end-of-list
0021-merge-two-sorted-lists
0146-lru-cache
0206-reverse-linked-list
2216-delete-the-middle-node-of-a-linked-list

Math

0002-add-two-numbers
0007-reverse-integer
0012-integer-to-roman
0062-unique-paths
0070-climbing-stairs
0150-evaluate-reverse-polish-notation
0263-ugly-number
0384-shuffle-an-array
0973-k-closest-points-to-origin
1013-fibonacci-number
1642-water-bottles
1920-determine-color-of-a-chessboard-square
2149-remove-colored-pieces-if-both-neighbors-are-the-same-color
3336-water-bottles-ii
3462-vowels-game-in-a-string

Recursion

0002-add-two-numbers
0021-merge-two-sorted-lists
0206-reverse-linked-list
1013-fibonacci-number

Backtracking

0017-letter-combinations-of-a-phone-number
0022-generate-parentheses
0039-combination-sum
0046-permutations
0077-combinations
0078-subsets
0079-word-search
0090-subsets-ii
0257-binary-tree-paths

String

0003-longest-substring-without-repeating-characters
0005-longest-palindromic-substring
0012-integer-to-roman
0017-letter-combinations-of-a-phone-number
0020-valid-parentheses
0022-generate-parentheses
0049-group-anagrams
0058-length-of-last-word
0071-simplify-path
0076-minimum-window-substring
0079-word-search
0091-decode-ways
0125-valid-palindrome
0139-word-break
0187-repeated-dna-sequences
0205-isomorphic-strings
0242-valid-anagram
0257-binary-tree-paths
0299-bulls-and-cows
0316-remove-duplicate-letters
0424-longest-repeating-character-replacement
0443-string-compression
0944-delete-columns-to-make-sorted
1252-break-a-palindrome
1264-maximum-number-of-words-you-can-type
1392-longest-happy-prefix
1652-minimum-suffix-flips
1777-determine-if-two-strings-are-close
1920-determine-color-of-a-chessboard-square
2149-remove-colored-pieces-if-both-neighbors-are-the-same-color
2177-check-whether-two-strings-are-almost-equivalent
2470-removing-stars-from-a-string
2887-sort-vowels-in-a-string
3462-vowels-game-in-a-string
3872-find-most-frequent-vowel-and-consonant

Stack

0020-valid-parentheses
0071-simplify-path
0150-evaluate-reverse-polish-notation
0155-min-stack
0316-remove-duplicate-letters
0735-asteroid-collision
2470-removing-stars-from-a-string

Sliding Window

0003-longest-substring-without-repeating-characters
0076-minimum-window-substring
0187-repeated-dna-sequences
0209-minimum-size-subarray-sum
0219-contains-duplicate-ii
0424-longest-repeating-character-replacement
0718-maximum-length-of-repeated-subarray
1138-grumpy-bookstore-owner

Bit Manipulation

0078-subsets
0090-subsets-ii
0136-single-number
0187-repeated-dna-sequences
0191-number-of-1-bits
0287-find-the-duplicate-number
1458-sort-integers-by-the-number-of-1-bits

Rolling Hash

0187-repeated-dna-sequences
0718-maximum-length-of-repeated-subarray
1392-longest-happy-prefix

Hash Function

0187-repeated-dna-sequences
0718-maximum-length-of-repeated-subarray
1392-longest-happy-prefix

Binary Search

0167-two-sum-ii-input-array-is-sorted
0209-minimum-size-subarray-sum
0287-find-the-duplicate-number
0718-maximum-length-of-repeated-subarray
0792-binary-search

Prefix Sum

0209-minimum-size-subarray-sum
0238-product-of-array-except-self

Brainteaser

3462-vowels-game-in-a-string

Game Theory

2149-remove-colored-pieces-if-both-neighbors-are-the-same-color
3462-vowels-game-in-a-string

Tree

0100-same-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0110-balanced-binary-tree
0226-invert-binary-tree
0257-binary-tree-paths
0543-diameter-of-binary-tree
0703-kth-largest-element-in-a-stream

Depth-First Search

0079-word-search
0100-same-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0110-balanced-binary-tree
0130-surrounded-regions
0200-number-of-islands
0226-invert-binary-tree
0257-binary-tree-paths
0543-diameter-of-binary-tree

Binary Tree

0100-same-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0110-balanced-binary-tree
0226-invert-binary-tree
0257-binary-tree-paths
0543-diameter-of-binary-tree
0703-kth-largest-element-in-a-stream

Matrix

0036-valid-sudoku
0063-unique-paths-ii
0064-minimum-path-sum
0073-set-matrix-zeroes
0079-word-search
0130-surrounded-regions
0200-number-of-islands
2428-equal-row-and-column-pairs

Sorting

0049-group-anagrams
0056-merge-intervals
0088-merge-sorted-array
0215-kth-largest-element-in-an-array
0217-contains-duplicate
0229-majority-element-ii
0242-valid-anagram
0274-h-index
0347-top-k-frequent-elements
0442-find-all-duplicates-in-an-array
0846-hand-of-straights
0973-k-closest-points-to-origin
1306-minimum-absolute-difference
1458-sort-integers-by-the-number-of-1-bits
1604-least-number-of-unique-integers-after-k-removals
1777-determine-if-two-strings-are-close
2887-sort-vowels-in-a-string

Two Pointers

0005-longest-palindromic-substring
0011-container-with-most-water
0019-remove-nth-node-from-end-of-list
0088-merge-sorted-array
0125-valid-palindrome
0167-two-sum-ii-input-array-is-sorted
0287-find-the-duplicate-number
0443-string-compression
2216-delete-the-middle-node-of-a-linked-list

Dynamic Programming

0005-longest-palindromic-substring
0022-generate-parentheses
0045-jump-game-ii
0053-maximum-subarray
0055-jump-game
0062-unique-paths
0063-unique-paths-ii
0064-minimum-path-sum
0070-climbing-stairs
0091-decode-ways
0118-pascals-triangle
0120-triangle
0121-best-time-to-buy-and-sell-stock
0139-word-break
0198-house-robber
0213-house-robber-ii
0322-coin-change
0718-maximum-length-of-repeated-subarray
0747-min-cost-climbing-stairs
1013-fibonacci-number

Counting

0229-majority-element-ii
0299-bulls-and-cows
0347-top-k-frequent-elements
1458-sort-integers-by-the-number-of-1-bits
1604-least-number-of-unique-integers-after-k-removals
1777-determine-if-two-strings-are-close
2177-check-whether-two-strings-are-almost-equivalent
3242-count-elements-with-maximum-frequency
3872-find-most-frequent-vowel-and-consonant

Divide and Conquer

0053-maximum-subarray
0191-number-of-1-bits
0215-kth-largest-element-in-an-array
0347-top-k-frequent-elements
0973-k-closest-points-to-origin

Design

0146-lru-cache
0155-min-stack
0384-shuffle-an-array
0703-kth-largest-element-in-a-stream

Randomized

0384-shuffle-an-array

Greedy

0011-container-with-most-water
0045-jump-game-ii
0055-jump-game
0134-gas-station
0316-remove-duplicate-letters
0846-hand-of-straights
1252-break-a-palindrome
1604-least-number-of-unique-integers-after-k-removals
1652-minimum-suffix-flips
2149-remove-colored-pieces-if-both-neighbors-are-the-same-color

Heap (Priority Queue)

0215-kth-largest-element-in-an-array
0347-top-k-frequent-elements
0703-kth-largest-element-in-a-stream
0973-k-closest-points-to-origin
1046-last-stone-weight

Bucket Sort

0347-top-k-frequent-elements

Quickselect

0215-kth-largest-element-in-an-array
0347-top-k-frequent-elements
0973-k-closest-points-to-origin

Simulation

0735-asteroid-collision
1642-water-bottles
1769-get-maximum-in-generated-array
2428-equal-row-and-column-pairs
2470-removing-stars-from-a-string
3336-water-bottles-ii

Memoization

0070-climbing-stairs
0139-word-break
1013-fibonacci-number

Combinatorics

0062-unique-paths

Union Find

0128-longest-consecutive-sequence

Monotonic Stack

0316-remove-duplicate-letters

Database

0176-second-highest-salary
0180-consecutive-numbers
0185-department-top-three-salaries
0196-delete-duplicate-emails
0570-managers-with-at-least-5-direct-reports
0577-employee-bonus
0585-investments-in-2016
0602-friend-requests-ii-who-has-the-most-friends
0610-triangle-judgement
0620-not-boring-movies
0626-exchange-seats
1135-customers-who-bought-all-products
1155-product-sales-analysis-iii
1161-project-employees-i
1182-game-play-analysis-iv
1245-user-activity-for-the-past-30-days-i
1278-product-price-at-a-given-date
1292-immediate-food-delivery-ii
1317-monthly-transactions-i
1327-last-person-to-fit-in-the-bus
1338-queries-quality-and-percentage
1390-average-selling-price
1415-students-and-examinations
1452-restaurant-growth
1462-list-the-products-ordered-in-a-period
1480-movie-rating
1625-group-sold-products-by-the-date
1664-find-users-with-valid-e-mails
1670-patients-with-a-condition
1773-percentage-of-users-attended-a-contest
1801-average-time-of-process-per-machine
1811-fix-names-in-a-table
1882-the-number-of-employees-which-report-to-each-employee
1908-recyclable-and-low-fat-products
1942-primary-department-for-each-employee
2057-count-salary-categories
2087-confirmation-rate
2127-employees-whose-manager-left-the-company
2495-number-of-unique-subjects-taught-by-each-teacher

Trie

0139-word-break

Breadth-First Search

0100-same-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0130-surrounded-regions
0200-number-of-islands
0226-invert-binary-tree
0322-coin-change

Geometry

0973-k-closest-points-to-origin

Binary Search Tree

0703-kth-largest-element-in-a-stream

Data Stream

0703-kth-largest-element-in-a-stream

Union-Find

0130-surrounded-regions
0200-number-of-islands

String Matching

1392-longest-happy-prefix

Counting Sort

0274-h-index

Doubly-Linked List

0146-lru-cache

About

A repository of my LeetCode solutions managed using LeetHub.

Resources

Stars

Watchers

Forks