Skip to content

AnshPhirani/Leetcode-optimized-solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode-optimized-solutions

Collection of LeetCode questions to ace the coding interview!

LeetCode Topics

Math

0231-power-of-two
0326-power-of-three
1411-convert-binary-number-in-a-linked-list-to-integer
1529-max-difference-you-can-get-from-changing-an-integer
2202-sum-of-k-mirror-numbers
2661-smallest-missing-non-negative-integer-after-operations
2704-maximum-difference-by-remapping-a-digit
3201-distribute-candies-among-children-ii
3676-smallest-number-with-all-set-bits
3754-maximum-manhattan-distance-after-k-changes

Combinatorics

3201-distribute-candies-among-children-ii

Enumeration

2202-sum-of-k-mirror-numbers
3201-distribute-candies-among-children-ii
3683-find-the-lexicographically-largest-string-from-the-box-i

Array

0036-valid-sudoku
0135-candy
0594-longest-harmonious-subsequence
1424-maximum-candies-you-can-get-from-boxes
1478-maximum-number-of-events-that-can-be-attended
1510-find-lucky-integer-in-an-array
1586-longest-subarray-of-1s-after-deleting-one-element
1813-maximum-erasure-value
2137-final-value-of-variable-after-performing-operations
2204-find-subsequence-of-length-k-with-the-largest-sum
2320-find-all-k-distant-indices-in-an-array
2387-partition-array-such-that-maximum-difference-is-k
2497-maximum-matching-of-players-with-trainers
2529-range-product-queries-of-powers
2661-smallest-missing-non-negative-integer-after-operations
2720-minimize-the-maximum-difference-of-pairs
3437-maximum-total-damage-with-spell-casting
3461-find-the-minimum-area-to-cover-all-ones-i
3490-find-the-maximum-length-of-valid-subsequence-i
3501-delete-nodes-from-linked-list-present-in-array
3612-adjacent-increasing-subarrays-detection-i
3743-reschedule-meetings-for-maximum-free-time-i
3747-maximum-difference-between-adjacent-elements-in-a-circular-array

Greedy

0135-candy
1478-maximum-number-of-events-that-can-be-attended
1529-max-difference-you-can-get-from-changing-an-integer
1818-maximum-score-from-removing-substrings
2387-partition-array-such-that-maximum-difference-is-k
2395-longest-binary-subsequence-less-than-or-equal-to-k
2497-maximum-matching-of-players-with-trainers
2520-using-a-robot-to-print-the-lexicographically-smallest-string
2661-smallest-missing-non-negative-integer-after-operations
2704-maximum-difference-by-remapping-a-digit
2720-minimize-the-maximum-difference-of-pairs
3445-lexicographically-minimum-string-after-removing-stars
3743-reschedule-meetings-for-maximum-free-time-i

Breadth-First Search

1424-maximum-candies-you-can-get-from-boxes
1554-minimum-time-to-collect-all-apples-in-a-tree

Graph

1424-maximum-candies-you-can-get-from-boxes

Two Pointers

2320-find-all-k-distant-indices-in-an-array
2497-maximum-matching-of-players-with-trainers
3437-maximum-total-damage-with-spell-casting
3683-find-the-lexicographically-largest-string-from-the-box-i

String

1058-lexicographically-smallest-equivalent-string
1818-maximum-score-from-removing-substrings
2137-final-value-of-variable-after-performing-operations
2260-divide-a-string-into-groups-of-size-k
2395-longest-binary-subsequence-less-than-or-equal-to-k
2520-using-a-robot-to-print-the-lexicographically-smallest-string
3396-valid-word
3445-lexicographically-minimum-string-after-removing-stars
3617-find-the-original-typed-string-i
3683-find-the-lexicographically-largest-string-from-the-box-i
3754-maximum-manhattan-distance-after-k-changes

Union Find

1058-lexicographically-smallest-equivalent-string

Hash Table

0036-valid-sudoku
0594-longest-harmonious-subsequence
1510-find-lucky-integer-in-an-array
1554-minimum-time-to-collect-all-apples-in-a-tree
1813-maximum-erasure-value
2204-find-subsequence-of-length-k-with-the-largest-sum
2520-using-a-robot-to-print-the-lexicographically-smallest-string
2661-smallest-missing-non-negative-integer-after-operations
3437-maximum-total-damage-with-spell-casting
3445-lexicographically-minimum-string-after-removing-stars
3501-delete-nodes-from-linked-list-present-in-array
3754-maximum-manhattan-distance-after-k-changes

Stack

1818-maximum-score-from-removing-substrings
2520-using-a-robot-to-print-the-lexicographically-smallest-string
3445-lexicographically-minimum-string-after-removing-stars

Tree

1554-minimum-time-to-collect-all-apples-in-a-tree

Depth-First Search

0386-lexicographical-numbers
1554-minimum-time-to-collect-all-apples-in-a-tree

Heap (Priority Queue)

1478-maximum-number-of-events-that-can-be-attended
2204-find-subsequence-of-length-k-with-the-largest-sum
3445-lexicographically-minimum-string-after-removing-stars

Trie

0386-lexicographical-numbers
0440-k-th-smallest-in-lexicographical-order

Binary Search

2720-minimize-the-maximum-difference-of-pairs
3437-maximum-total-damage-with-spell-casting

Sorting

0594-longest-harmonious-subsequence
1478-maximum-number-of-events-that-can-be-attended
2204-find-subsequence-of-length-k-with-the-largest-sum
2387-partition-array-such-that-maximum-difference-is-k
2497-maximum-matching-of-players-with-trainers
3437-maximum-total-damage-with-spell-casting

Counting

0594-longest-harmonious-subsequence
1510-find-lucky-integer-in-an-array
3437-maximum-total-damage-with-spell-casting
3754-maximum-manhattan-distance-after-k-changes

Simulation

2137-final-value-of-variable-after-performing-operations
2260-divide-a-string-into-groups-of-size-k

Dynamic Programming

1586-longest-subarray-of-1s-after-deleting-one-element
2395-longest-binary-subsequence-less-than-or-equal-to-k
3437-maximum-total-damage-with-spell-casting
3490-find-the-maximum-length-of-valid-subsequence-i

Memoization

2395-longest-binary-subsequence-less-than-or-equal-to-k

Sliding Window

0594-longest-harmonious-subsequence
1586-longest-subarray-of-1s-after-deleting-one-element
1813-maximum-erasure-value
3743-reschedule-meetings-for-maximum-free-time-i

Linked List

1411-convert-binary-number-in-a-linked-list-to-integer
3501-delete-nodes-from-linked-list-present-in-array

Bit Manipulation

0231-power-of-two
2529-range-product-queries-of-powers
3676-smallest-number-with-all-set-bits

Recursion

0231-power-of-two
0326-power-of-three

Prefix Sum

2529-range-product-queries-of-powers

Matrix

0036-valid-sudoku
3461-find-the-minimum-area-to-cover-all-ones-i

About

Collection of LeetCode questions to ace the coding interview!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published