Skip to content

This repository contains my solutions to daily LeetCode problems, showcasing my approach to various challenges.

Notifications You must be signed in to change notification settings

Adisesh05/Leetcode-Solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
0026-remove-duplicates-from-sorted-array
0027-remove-element
0035-search-insert-position
0053-maximum-subarray
0121-best-time-to-buy-and-sell-stock
0189-rotate-array
0209-minimum-size-subarray-sum
0215-kth-largest-element-in-an-array
0217-contains-duplicate
0283-move-zeroes
0854-making-a-large-island
0925-construct-binary-tree-from-preorder-and-postorder-traversal
1335-maximum-candies-allocated-to-k-children
1364-tuple-with-same-product
1396-count-servers-that-communicate
1477-product-of-the-last-k-numbers
1631-number-of-sub-arrays-with-odd-sum
1656-count-good-triplets
1813-maximum-erasure-value
1819-construct-the-lexicographically-largest-valid-sequence
1849-maximum-absolute-sum-of-any-subarray
1876-map-of-highest-peak
1878-check-if-array-is-sorted-and-rotated
1927-maximum-ascending-subarray-sum
2107-find-unique-binary-string
2112-minimum-difference-between-highest-and-lowest-of-k-scores
2145-grid-game
2160-minimum-operations-to-make-a-uni-value-grid
2265-partition-array-according-to-given-pivot
2277-count-equal-and-divisible-pairs-in-an-array
2280-count-good-triplets-in-an-array
2448-count-number-of-bad-pairs
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2551-apply-operations-to-an-array
2564-most-profitable-path-in-a-tree
2588-maximum-number-of-points-from-grid-queries
2614-maximum-count-of-positive-integer-and-negative-integer
2665-minimum-time-to-repair-cars
2707-merge-two-2d-arrays-by-summing-values
2764-maximum-number-of-fish-in-a-grid
2888-minimum-index-of-a-valid-split
2917-count-pairs-whose-sum-is-less-than-target
3219-make-lexicographically-smallest-array-by-swapping-elements
3227-find-missing-and-repeated-values
3332-minimum-operations-to-exceed-threshold-value-ii
3372-longest-strictly-increasing-or-strictly-decreasing-subarray
3429-special-array-i
3430-count-days-without-meetings
3434-find-the-number-of-distinct-colors-among-the-balls
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3483-alternating-groups-ii
3643-zero-array-transformation-ii
3657-check-if-grid-can-be-cut-into-sections

Matrix

0854-making-a-large-island
1396-count-servers-that-communicate
1876-map-of-highest-peak
2145-grid-game
2160-minimum-operations-to-make-a-uni-value-grid
2588-maximum-number-of-points-from-grid-queries
2764-maximum-number-of-fish-in-a-grid
3227-find-missing-and-repeated-values

Prefix Sum

0209-minimum-size-subarray-sum
1477-product-of-the-last-k-numbers
1631-number-of-sub-arrays-with-odd-sum
2145-grid-game
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3643-zero-array-transformation-ii

Breadth-First Search

0684-redundant-connection
0820-find-eventual-safe-states
0854-making-a-large-island
1387-find-elements-in-a-contaminated-binary-tree
1396-count-servers-that-communicate
1558-course-schedule-iv
1876-map-of-highest-peak
2564-most-profitable-path-in-a-tree
2583-divide-nodes-into-the-maximum-number-of-groups
2588-maximum-number-of-points-from-grid-queries
2764-maximum-number-of-fish-in-a-grid

Depth-First Search

0684-redundant-connection
0820-find-eventual-safe-states
0854-making-a-large-island
1093-recover-a-tree-from-preorder-traversal
1387-find-elements-in-a-contaminated-binary-tree
1396-count-servers-that-communicate
1558-course-schedule-iv
2246-maximum-employees-to-be-invited-to-a-meeting
2564-most-profitable-path-in-a-tree
2764-maximum-number-of-fish-in-a-grid

Union Find

0684-redundant-connection
0854-making-a-large-island
1396-count-servers-that-communicate
2583-divide-nodes-into-the-maximum-number-of-groups
2588-maximum-number-of-points-from-grid-queries
2764-maximum-number-of-fish-in-a-grid
3219-make-lexicographically-smallest-array-by-swapping-elements

Counting

1160-letter-tile-possibilities
1364-tuple-with-same-product
1396-count-servers-that-communicate
1915-check-if-one-string-swap-can-make-strings-equal
2448-count-number-of-bad-pairs
2614-maximum-count-of-positive-integer-and-negative-integer

Graph

0684-redundant-connection
0820-find-eventual-safe-states
1558-course-schedule-iv
2246-maximum-employees-to-be-invited-to-a-meeting
2564-most-profitable-path-in-a-tree
2583-divide-nodes-into-the-maximum-number-of-groups

Topological Sort

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

Sorting

0215-kth-largest-element-in-an-array
0217-contains-duplicate
2112-minimum-difference-between-highest-and-lowest-of-k-scores
2160-minimum-operations-to-make-a-uni-value-grid
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2588-maximum-number-of-points-from-grid-queries
2888-minimum-index-of-a-valid-split
2917-count-pairs-whose-sum-is-less-than-target
3219-make-lexicographically-smallest-array-by-swapping-elements
3430-count-days-without-meetings
3657-check-if-grid-can-be-cut-into-sections

Hash Table

0001-two-sum
0217-contains-duplicate
0925-construct-binary-tree-from-preorder-and-postorder-traversal
1160-letter-tile-possibilities
1364-tuple-with-same-product
1387-find-elements-in-a-contaminated-binary-tree
1813-maximum-erasure-value
1915-check-if-one-string-swap-can-make-strings-equal
2107-find-unique-binary-string
2434-design-a-number-container-system
2448-count-number-of-bad-pairs
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2707-merge-two-2d-arrays-by-summing-values
2888-minimum-index-of-a-valid-split
3227-find-missing-and-repeated-values
3434-find-the-number-of-distinct-colors-among-the-balls

String

0058-length-of-last-word
0459-repeated-substring-pattern
0686-repeated-string-match
1093-recover-a-tree-from-preorder-traversal
1160-letter-tile-possibilities
1170-shortest-common-supersequence
1516-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n
1756-minimum-deletions-to-make-string-balanced
1915-check-if-one-string-swap-can-make-strings-equal
2021-remove-all-occurrences-of-a-substring
2107-find-unique-binary-string
2168-check-if-numbers-are-ascending-in-a-sentence
2243-check-if-all-as-appears-before-all-bs
2456-construct-smallest-number-from-di-string
2463-minimum-recolors-to-get-k-consecutive-black-blocks
3447-clear-digits

Simulation

2021-remove-all-occurrences-of-a-substring
2265-partition-array-according-to-given-pivot
2551-apply-operations-to-an-array
3332-minimum-operations-to-exceed-threshold-value-ii
3434-find-the-number-of-distinct-colors-among-the-balls
3447-clear-digits

Design

1387-find-elements-in-a-contaminated-binary-tree
1477-product-of-the-last-k-numbers
2434-design-a-number-container-system

Heap (Priority Queue)

0215-kth-largest-element-in-an-array
2434-design-a-number-container-system
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2588-maximum-number-of-points-from-grid-queries
3332-minimum-operations-to-exceed-threshold-value-ii

Ordered Set

2280-count-good-triplets-in-an-array
2434-design-a-number-container-system

Math

0189-rotate-array
1477-product-of-the-last-k-numbers
1631-number-of-sub-arrays-with-odd-sum
1889-check-if-number-is-a-sum-of-powers-of-three
2160-minimum-operations-to-make-a-uni-value-grid
2448-count-number-of-bad-pairs
2610-closest-prime-numbers-in-range
2649-count-total-number-of-colored-cells
2802-find-the-punishment-number-of-an-integer
3227-find-missing-and-repeated-values

Stack

1756-minimum-deletions-to-make-string-balanced
2021-remove-all-occurrences-of-a-substring
2456-construct-smallest-number-from-di-string
3447-clear-digits

Data Stream

1477-product-of-the-last-k-numbers

Backtracking

1160-letter-tile-possibilities
1516-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n
1819-construct-the-lexicographically-largest-valid-sequence
2107-find-unique-binary-string
2456-construct-smallest-number-from-di-string
2802-find-the-punishment-number-of-an-integer

Greedy

0011-container-with-most-water
2456-construct-smallest-number-from-di-string

Tree

0925-construct-binary-tree-from-preorder-and-postorder-traversal
1093-recover-a-tree-from-preorder-traversal
1387-find-elements-in-a-contaminated-binary-tree
2564-most-profitable-path-in-a-tree

Binary Tree

0925-construct-binary-tree-from-preorder-and-postorder-traversal
1093-recover-a-tree-from-preorder-traversal
1387-find-elements-in-a-contaminated-binary-tree

Divide and Conquer

0053-maximum-subarray
0215-kth-largest-element-in-an-array
0925-construct-binary-tree-from-preorder-and-postorder-traversal
2280-count-good-triplets-in-an-array

Dynamic Programming

0053-maximum-subarray
0121-best-time-to-buy-and-sell-stock
1170-shortest-common-supersequence
1631-number-of-sub-arrays-with-odd-sum
1756-minimum-deletions-to-make-string-balanced
1849-maximum-absolute-sum-of-any-subarray

Two Pointers

0011-container-with-most-water
0026-remove-duplicates-from-sorted-array
0027-remove-element
0189-rotate-array
0283-move-zeroes
2265-partition-array-according-to-given-pivot
2551-apply-operations-to-an-array
2588-maximum-number-of-points-from-grid-queries
2707-merge-two-2d-arrays-by-summing-values
2917-count-pairs-whose-sum-is-less-than-target

Quickselect

0215-kth-largest-element-in-an-array

Number Theory

2610-closest-prime-numbers-in-range

Sliding Window

0209-minimum-size-subarray-sum
1813-maximum-erasure-value
2112-minimum-difference-between-highest-and-lowest-of-k-scores
2463-minimum-recolors-to-get-k-consecutive-black-blocks
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3483-alternating-groups-ii

Binary Search

0035-search-insert-position
0209-minimum-size-subarray-sum
1335-maximum-candies-allocated-to-k-children
2280-count-good-triplets-in-an-array
2614-maximum-count-of-positive-integer-and-negative-integer
2665-minimum-time-to-repair-cars
2917-count-pairs-whose-sum-is-less-than-target
3643-zero-array-transformation-ii

Bit Manipulation

3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i

Queue

3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i

Enumeration

1656-count-good-triplets

Binary Indexed Tree

2280-count-good-triplets-in-an-array

Segment Tree

2280-count-good-triplets-in-an-array

Merge Sort

2280-count-good-triplets-in-an-array

String Matching

0459-repeated-substring-pattern
0686-repeated-string-match

About

This repository contains my solutions to daily LeetCode problems, showcasing my approach to various challenges.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages