Skip to content

A repository to store all the solved LeetCode questions

Notifications You must be signed in to change notification settings

varnit-ta/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

0004-median-of-two-sorted-arrays
0011-container-with-most-water
0018-4sum
0031-next-permutation
0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0035-search-insert-position
0036-valid-sudoku
0041-first-missing-positive
0045-jump-game-ii
0046-permutations
0051-n-queens
0053-maximum-subarray
0054-spiral-matrix
0055-jump-game
0056-merge-intervals
0057-insert-interval
0059-spiral-matrix-ii
0063-unique-paths-ii
0073-set-matrix-zeroes
0075-sort-colors
0078-subsets
0080-remove-duplicates-from-sorted-array-ii
0081-search-in-rotated-sorted-array-ii
0088-merge-sorted-array
0090-subsets-ii
0108-convert-sorted-array-to-binary-search-tree
0118-pascals-triangle
0119-pascals-triangle-ii
0121-best-time-to-buy-and-sell-stock
0122-best-time-to-buy-and-sell-stock-ii
0136-single-number
0152-maximum-product-subarray
0162-find-peak-element
0167-two-sum-ii-input-array-is-sorted
0169-majority-element
0189-rotate-array
0228-summary-ranges
0229-majority-element-ii
0283-move-zeroes
0300-longest-increasing-subsequence
0303-range-sum-query-immutable
0349-intersection-of-two-arrays
0350-intersection-of-two-arrays-ii
0448-find-all-numbers-disappeared-in-an-array
0455-assign-cookies
0462-minimum-moves-to-equal-array-elements-ii
0485-max-consecutive-ones
0496-next-greater-element-i
0506-relative-ranks
0540-single-element-in-a-sorted-array
0560-subarray-sum-equals-k
0792-binary-search
1046-max-consecutive-ones-iii
1878-check-if-array-is-sorted-and-rotated
2271-rearrange-array-elements-by-sign

Two Pointers

0011-container-with-most-water
0018-4sum
0031-next-permutation
0061-rotate-list
0075-sort-colors
0080-remove-duplicates-from-sorted-array-ii
0082-remove-duplicates-from-sorted-list-ii
0086-partition-list
0088-merge-sorted-array
0167-two-sum-ii-input-array-is-sorted
0189-rotate-array
0202-happy-number
0283-move-zeroes
0345-reverse-vowels-of-a-string
0349-intersection-of-two-arrays
0350-intersection-of-two-arrays-ii
0455-assign-cookies
2271-rearrange-array-elements-by-sign

Binary Search

0004-median-of-two-sorted-arrays
0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0035-search-insert-position
0081-search-in-rotated-sorted-array-ii
0162-find-peak-element
0167-two-sum-ii-input-array-is-sorted
0278-first-bad-version
0300-longest-increasing-subsequence
0349-intersection-of-two-arrays
0350-intersection-of-two-arrays-ii
0367-valid-perfect-square
0441-arranging-coins
0540-single-element-in-a-sorted-array
0792-binary-search
1046-max-consecutive-ones-iii

Hash Table

0003-longest-substring-without-repeating-characters
0012-integer-to-roman
0013-roman-to-integer
0017-letter-combinations-of-a-phone-number
0036-valid-sudoku
0041-first-missing-positive
0073-set-matrix-zeroes
0169-majority-element
0202-happy-number
0229-majority-element-ii
0290-word-pattern
0349-intersection-of-two-arrays
0350-intersection-of-two-arrays-ii
0383-ransom-note
0387-first-unique-character-in-a-string
0409-longest-palindrome
0448-find-all-numbers-disappeared-in-an-array
0496-next-greater-element-i
0560-subarray-sum-equals-k
3210-count-beautiful-substrings-i

Math

0012-integer-to-roman
0013-roman-to-integer
0043-multiply-strings
0060-permutation-sequence
0062-unique-paths
0089-gray-code
0096-unique-binary-search-trees
0171-excel-sheet-column-number
0189-rotate-array
0202-happy-number
0231-power-of-two
0326-power-of-three
0367-valid-perfect-square
0415-add-strings
0441-arranging-coins
0462-minimum-moves-to-equal-array-elements-ii
0492-construct-the-rectangle
1146-greatest-common-divisor-of-strings
3210-count-beautiful-substrings-i

String

0003-longest-substring-without-repeating-characters
0006-zigzag-conversion
0012-integer-to-roman
0013-roman-to-integer
0017-letter-combinations-of-a-phone-number
0022-generate-parentheses
0043-multiply-strings
0071-simplify-path
0072-edit-distance
0093-restore-ip-addresses
0171-excel-sheet-column-number
0290-word-pattern
0345-reverse-vowels-of-a-string
0383-ransom-note
0387-first-unique-character-in-a-string
0409-longest-palindrome
0415-add-strings
0434-number-of-segments-in-a-string
0459-repeated-substring-pattern
0482-license-key-formatting
0957-minimum-add-to-make-parentheses-valid
1146-greatest-common-divisor-of-strings
3210-count-beautiful-substrings-i

Enumeration

3210-count-beautiful-substrings-i

Number Theory

3210-count-beautiful-substrings-i

Prefix Sum

0303-range-sum-query-immutable
0560-subarray-sum-equals-k
1046-max-consecutive-ones-iii
3210-count-beautiful-substrings-i

Sorting

0018-4sum
0056-merge-intervals
0075-sort-colors
0088-merge-sorted-array
0169-majority-element
0229-majority-element-ii
0349-intersection-of-two-arrays
0350-intersection-of-two-arrays-ii
0455-assign-cookies
0462-minimum-moves-to-equal-array-elements-ii
0506-relative-ranks

Dynamic Programming

0022-generate-parentheses
0045-jump-game-ii
0053-maximum-subarray
0055-jump-game
0062-unique-paths
0063-unique-paths-ii
0072-edit-distance
0095-unique-binary-search-trees-ii
0096-unique-binary-search-trees
0118-pascals-triangle
0119-pascals-triangle-ii
0121-best-time-to-buy-and-sell-stock
0122-best-time-to-buy-and-sell-stock-ii
0152-maximum-product-subarray
0300-longest-increasing-subsequence
0338-counting-bits

Backtracking

0017-letter-combinations-of-a-phone-number
0022-generate-parentheses
0046-permutations
0051-n-queens
0052-n-queens-ii
0077-combinations
0078-subsets
0089-gray-code
0090-subsets-ii
0093-restore-ip-addresses
0095-unique-binary-search-trees-ii
0113-path-sum-ii

Greedy

0011-container-with-most-water
0045-jump-game-ii
0055-jump-game
0122-best-time-to-buy-and-sell-stock-ii
0409-longest-palindrome
0455-assign-cookies
0957-minimum-add-to-make-parentheses-valid

Linked List

0024-swap-nodes-in-pairs
0061-rotate-list
0082-remove-duplicates-from-sorted-list-ii
0086-partition-list

Combinatorics

0062-unique-paths

Matrix

0036-valid-sudoku
0054-spiral-matrix
0059-spiral-matrix-ii
0063-unique-paths-ii
0073-set-matrix-zeroes

Simulation

0043-multiply-strings
0054-spiral-matrix
0059-spiral-matrix-ii
0415-add-strings
2271-rearrange-array-elements-by-sign

Divide and Conquer

0004-median-of-two-sorted-arrays
0053-maximum-subarray
0108-convert-sorted-array-to-binary-search-tree
0169-majority-element
0190-reverse-bits
0191-number-of-1-bits

Tree

0095-unique-binary-search-trees-ii
0096-unique-binary-search-trees
0108-convert-sorted-array-to-binary-search-tree
0110-balanced-binary-tree
0113-path-sum-ii
0783-search-in-a-binary-search-tree

Binary Search Tree

0095-unique-binary-search-trees-ii
0096-unique-binary-search-trees
0108-convert-sorted-array-to-binary-search-tree
0783-search-in-a-binary-search-tree

Binary Tree

0095-unique-binary-search-trees-ii
0096-unique-binary-search-trees
0108-convert-sorted-array-to-binary-search-tree
0110-balanced-binary-tree
0113-path-sum-ii
0783-search-in-a-binary-search-tree

Depth-First Search

0110-balanced-binary-tree
0113-path-sum-ii

Stack

0071-simplify-path
0225-implement-stack-using-queues
0232-implement-queue-using-stacks
0496-next-greater-element-i
0957-minimum-add-to-make-parentheses-valid

Design

0225-implement-stack-using-queues
0232-implement-queue-using-stacks
0303-range-sum-query-immutable

Queue

0225-implement-stack-using-queues
0232-implement-queue-using-stacks
0387-first-unique-character-in-a-string

Bit Manipulation

0078-subsets
0089-gray-code
0090-subsets-ii
0136-single-number
0190-reverse-bits
0191-number-of-1-bits
0231-power-of-two
0338-counting-bits
0461-hamming-distance
0476-number-complement

Recursion

0024-swap-nodes-in-pairs
0060-permutation-sequence
0231-power-of-two
0326-power-of-three

Interactive

0278-first-bad-version

Counting

0169-majority-element
0229-majority-element-ii
0383-ransom-note
0387-first-unique-character-in-a-string

Heap (Priority Queue)

0506-relative-ranks

String Matching

0459-repeated-substring-pattern

Monotonic Stack

0496-next-greater-element-i

Sliding Window

0003-longest-substring-without-repeating-characters
1046-max-consecutive-ones-iii

About

A repository to store all the solved LeetCode questions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published