Skip to content

mpodhaisky/leetcode-solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leetcode-solutions

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

LeetCode Topics

Array

0001-two-sum
0018-4sum
0066-plus-one
0085-maximal-rectangle
0137-single-number-ii
0200-number-of-islands
0219-contains-duplicate-ii
0321-create-maximum-number
0330-patching-array
0336-palindrome-pairs
0416-partition-equal-subset-sum
0421-maximum-xor-of-two-numbers-in-an-array
0691-stickers-to-spell-word
0870-magic-squares-in-grid
0914-random-point-in-non-overlapping-rectangles
0954-maximum-sum-circular-subarray
0981-delete-columns-to-make-sorted
0992-delete-columns-to-make-sorted-ii
1000-delete-columns-to-make-sorted-iii
1001-n-repeated-element-in-size-2n-array
1232-sum-of-mutated-array-closest-to-target
1284-four-divisors
1395-minimum-time-visiting-all-points
1476-count-negative-numbers-in-a-sorted-matrix
1569-max-dot-product-of-two-subsequences
2089-maximum-matrix-sum
2164-two-best-non-overlapping-events
2233-number-of-smooth-descent-periods-of-a-stock
2479-meeting-rooms-iii
3214-maximize-area-of-square-hole-in-grid
3334-apple-redistribution-into-boxes
3351-maximize-happiness-of-selected-children
3721-count-mentions-per-user
3763-separate-squares-i
3775-separate-squares-ii
3819-count-covered-buildings
3854-maximum-profit-from-trading-stocks-with-discounts
3892-best-time-to-buy-and-sell-stock-v
3934-coupon-code-validator
3980-best-time-to-buy-and-sell-stock-using-strategy
3986-maximum-path-score-in-a-grid
4061-minimum-swaps-to-avoid-forbidden-values
4154-maximum-bitwise-and-after-increment-operations

Hash Table

0001-two-sum
0219-contains-duplicate-ii
0336-palindrome-pairs
0421-maximum-xor-of-two-numbers-in-an-array
0424-longest-repeating-character-replacement
0691-stickers-to-spell-word
0757-pyramid-transition-matrix
0870-magic-squares-in-grid
0896-smallest-subtree-with-all-the-deepest-nodes
1001-n-repeated-element-in-size-2n-array
1460-number-of-substrings-containing-all-three-characters
2479-meeting-rooms-iii
3819-count-covered-buildings
3934-coupon-code-validator
4061-minimum-swaps-to-avoid-forbidden-values

String

0028-find-the-index-of-the-first-occurrence-in-a-string
0214-shortest-palindrome
0301-remove-invalid-parentheses
0336-palindrome-pairs
0424-longest-repeating-character-replacement
0481-magical-string
0514-freedom-trail
0691-stickers-to-spell-word
0712-minimum-ascii-delete-sum-for-two-strings
0757-pyramid-transition-matrix
0981-delete-columns-to-make-sorted
0992-delete-columns-to-make-sorted-ii
1000-delete-columns-to-make-sorted-iii
1460-number-of-substrings-containing-all-three-characters
1508-longest-happy-prefix
2251-number-of-ways-to-divide-a-long-corridor
2576-minimum-penalty-for-a-shop
3934-coupon-code-validator

Dynamic Programming

0085-maximal-rectangle
0233-number-of-digit-one
0416-partition-equal-subset-sum
0514-freedom-trail
0691-stickers-to-spell-word
0712-minimum-ascii-delete-sum-for-two-strings
0863-sum-of-distances-in-tree
0954-maximum-sum-circular-subarray
1000-delete-columns-to-make-sorted-iii
1527-number-of-ways-to-paint-n-3-grid
1569-max-dot-product-of-two-subsequences
1996-number-of-ways-to-rearrange-sticks-with-k-sticks-visible
2164-two-best-non-overlapping-events
2233-number-of-smooth-descent-periods-of-a-stock
2251-number-of-ways-to-divide-a-long-corridor
3854-maximum-profit-from-trading-stocks-with-discounts
3892-best-time-to-buy-and-sell-stock-v
3986-maximum-path-score-in-a-grid

Backtracking

0089-gray-code
0301-remove-invalid-parentheses
0691-stickers-to-spell-word
0757-pyramid-transition-matrix

Bit Manipulation

0089-gray-code
0137-single-number-ii
0421-maximum-xor-of-two-numbers-in-an-array
0691-stickers-to-spell-word
0757-pyramid-transition-matrix
4154-maximum-bitwise-and-after-increment-operations

Memoization

0691-stickers-to-spell-word

Bitmask

0691-stickers-to-spell-word

Breadth-First Search

0200-number-of-islands
0301-remove-invalid-parentheses
0514-freedom-trail
0896-smallest-subtree-with-all-the-deepest-nodes
1116-maximum-level-sum-of-a-binary-tree
2213-find-all-people-with-secret

Sorting

0018-4sum
1232-sum-of-mutated-array-closest-to-target
2164-two-best-non-overlapping-events
2213-find-all-people-with-secret
2479-meeting-rooms-iii
3214-maximize-area-of-square-hole-in-grid
3334-apple-redistribution-into-boxes
3351-maximize-happiness-of-selected-children
3721-count-mentions-per-user
3819-count-covered-buildings
3934-coupon-code-validator
4154-maximum-bitwise-and-after-increment-operations

Two Pointers

0018-4sum
0028-find-the-index-of-the-first-occurrence-in-a-string
0321-create-maximum-number
0481-magical-string

Stack

0085-maximal-rectangle
0321-create-maximum-number

Greedy

0321-create-maximum-number
0330-patching-array
0992-delete-columns-to-make-sorted-ii
2089-maximum-matrix-sum
3334-apple-redistribution-into-boxes
3351-maximize-happiness-of-selected-children
4061-minimum-swaps-to-avoid-forbidden-values
4154-maximum-bitwise-and-after-increment-operations

Monotonic Stack

0085-maximal-rectangle
0321-create-maximum-number

String Matching

0028-find-the-index-of-the-first-occurrence-in-a-string
0214-shortest-palindrome
1508-longest-happy-prefix

Math

0066-plus-one
0089-gray-code
0233-number-of-digit-one
0382-linked-list-random-node
0870-magic-squares-in-grid
0914-random-point-in-non-overlapping-rectangles
1284-four-divisors
1395-minimum-time-visiting-all-points
1996-number-of-ways-to-rearrange-sticks-with-k-sticks-visible
2233-number-of-smooth-descent-periods-of-a-stock
2251-number-of-ways-to-divide-a-long-corridor
3721-count-mentions-per-user

Simulation

2479-meeting-rooms-iii
3721-count-mentions-per-user

Depth-First Search

0200-number-of-islands
0514-freedom-trail
0863-sum-of-distances-in-tree
0896-smallest-subtree-with-all-the-deepest-nodes
1116-maximum-level-sum-of-a-binary-tree
1465-maximum-product-of-splitted-binary-tree
2213-find-all-people-with-secret
3854-maximum-profit-from-trading-stocks-with-discounts

Matrix

0085-maximal-rectangle
0200-number-of-islands
0870-magic-squares-in-grid
1476-count-negative-numbers-in-a-sorted-matrix
2089-maximum-matrix-sum
3986-maximum-path-score-in-a-grid

Trie

0336-palindrome-pairs
0421-maximum-xor-of-two-numbers-in-an-array

Union Find

0200-number-of-islands
2213-find-all-people-with-secret

Tree

0863-sum-of-distances-in-tree
0896-smallest-subtree-with-all-the-deepest-nodes
1116-maximum-level-sum-of-a-binary-tree
1465-maximum-product-of-splitted-binary-tree
3854-maximum-profit-from-trading-stocks-with-discounts

Sliding Window

0219-contains-duplicate-ii
0424-longest-repeating-character-replacement
1460-number-of-substrings-containing-all-three-characters
3980-best-time-to-buy-and-sell-stock-using-strategy

Prefix Sum

0914-random-point-in-non-overlapping-rectangles
2576-minimum-penalty-for-a-shop
3980-best-time-to-buy-and-sell-stock-using-strategy

Graph

0863-sum-of-distances-in-tree
2213-find-all-people-with-secret

Binary Search

0914-random-point-in-non-overlapping-rectangles
1232-sum-of-mutated-array-closest-to-target
1476-count-negative-numbers-in-a-sorted-matrix
2164-two-best-non-overlapping-events
3763-separate-squares-i
3775-separate-squares-ii

Heap (Priority Queue)

2164-two-best-non-overlapping-events
2479-meeting-rooms-iii

Combinatorics

1996-number-of-ways-to-rearrange-sticks-with-k-sticks-visible

Recursion

0233-number-of-digit-one

Rolling Hash

0214-shortest-palindrome
1508-longest-happy-prefix

Hash Function

0214-shortest-palindrome
1508-longest-happy-prefix

Counting

4061-minimum-swaps-to-avoid-forbidden-values

Binary Tree

0896-smallest-subtree-with-all-the-deepest-nodes
1116-maximum-level-sum-of-a-binary-tree
1465-maximum-product-of-splitted-binary-tree

Linked List

0382-linked-list-random-node

Reservoir Sampling

0382-linked-list-random-node
0914-random-point-in-non-overlapping-rectangles

Randomized

0382-linked-list-random-node
0914-random-point-in-non-overlapping-rectangles

Ordered Set

0914-random-point-in-non-overlapping-rectangles

Divide and Conquer

0954-maximum-sum-circular-subarray

Queue

0954-maximum-sum-circular-subarray

Monotonic Queue

0954-maximum-sum-circular-subarray

Geometry

1395-minimum-time-visiting-all-points

Segment Tree

3775-separate-squares-ii

Line Sweep

3775-separate-squares-ii

About

A collection of LeetCode questions to ace the coding interview! - Created using [LeetHub v2](https://github.com/arunbhardwaj/LeetHub-2.0)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published