Skip to content

Amanmourya09/LeetCode-Java-Solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode-Java-Solutions

A collection of LeetCode questions to ace the coding interview!

LeetCode Topics

Tree

0094-binary-tree-inorder-traversal
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0112-path-sum
0114-flatten-binary-tree-to-linked-list
0199-binary-tree-right-side-view
0226-invert-binary-tree
0404-sum-of-left-leaves
0513-find-bottom-left-tree-value
0515-find-largest-value-in-each-tree-row
0617-merge-two-binary-trees
0775-n-ary-tree-preorder-traversal
0776-n-ary-tree-postorder-traversal
0832-binary-tree-pruning
1005-univalued-binary-tree
1021-distribute-coins-in-binary-tree

Depth-First Search

0094-binary-tree-inorder-traversal
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0112-path-sum
0114-flatten-binary-tree-to-linked-list
0199-binary-tree-right-side-view
0200-number-of-islands
0207-course-schedule
0226-invert-binary-tree
0404-sum-of-left-leaves
0513-find-bottom-left-tree-value
0515-find-largest-value-in-each-tree-row
0547-number-of-provinces
0617-merge-two-binary-trees
0775-n-ary-tree-preorder-traversal
0776-n-ary-tree-postorder-traversal
0832-binary-tree-pruning
0871-keys-and-rooms
1005-univalued-binary-tree
1021-distribute-coins-in-binary-tree

Breadth-First Search

0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0112-path-sum
0199-binary-tree-right-side-view
0200-number-of-islands
0207-course-schedule
0226-invert-binary-tree
0404-sum-of-left-leaves
0513-find-bottom-left-tree-value
0515-find-largest-value-in-each-tree-row
0547-number-of-provinces
0617-merge-two-binary-trees
0871-keys-and-rooms
1005-univalued-binary-tree

Binary Tree

0094-binary-tree-inorder-traversal
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0112-path-sum
0114-flatten-binary-tree-to-linked-list
0199-binary-tree-right-side-view
0226-invert-binary-tree
0404-sum-of-left-leaves
0513-find-bottom-left-tree-value
0515-find-largest-value-in-each-tree-row
0617-merge-two-binary-trees
0832-binary-tree-pruning
1005-univalued-binary-tree
1021-distribute-coins-in-binary-tree

Array

0001-two-sum
0011-container-with-most-water
0016-3sum-closest
0026-remove-duplicates-from-sorted-array
0027-remove-element
0035-search-insert-position
0036-valid-sudoku
0048-rotate-image
0054-spiral-matrix
0059-spiral-matrix-ii
0066-plus-one
0075-sort-colors
0118-pascals-triangle
0121-best-time-to-buy-and-sell-stock
0136-single-number
0200-number-of-islands
0217-contains-duplicate
0485-max-consecutive-ones
0496-next-greater-element-i
0503-next-greater-element-ii
0724-find-pivot-index
0747-min-cost-climbing-stairs
0792-binary-search
0822-unique-morse-code-words
0837-most-common-word
0876-hand-of-straights
0882-peak-index-in-a-mountain-array
0941-sort-array-by-parity
0952-word-subsets
0958-sort-array-by-parity-ii
0965-unique-email-addresses
1019-squares-of-a-sorted-array
1046-max-consecutive-ones-iii
1072-next-greater-node-in-linked-list
1147-flip-columns-for-maximum-number-of-equal-rows
1468-check-if-n-and-its-double-exist
1886-minimum-limit-of-balls-in-a-bag
2164-two-best-non-overlapping-events
2232-adding-spaces-to-a-string
2640-maximum-number-of-integers-to-choose-from-a-range-i
2692-take-gifts-from-the-richest-pile
2695-find-score-of-an-array-after-marking-all-elements
2891-maximum-beauty-of-an-array-after-applying-operation

Hash Table

0001-two-sum
0012-integer-to-roman
0013-roman-to-integer
0036-valid-sudoku
0141-linked-list-cycle
0202-happy-number
0205-isomorphic-strings
0217-contains-duplicate
0242-valid-anagram
0409-longest-palindrome
0496-next-greater-element-i
0567-permutation-in-string
0782-jewels-and-stones
0822-unique-morse-code-words
0837-most-common-word
0876-hand-of-straights
0952-word-subsets
0965-unique-email-addresses
1147-flip-columns-for-maximum-number-of-equal-rows
1468-check-if-n-and-its-double-exist
2640-maximum-number-of-integers-to-choose-from-a-range-i
2695-find-score-of-an-array-after-marking-all-elements

Sorting

0016-3sum-closest
0075-sort-colors
0148-sort-list
0217-contains-duplicate
0242-valid-anagram
0876-hand-of-straights
0941-sort-array-by-parity
0958-sort-array-by-parity-ii
1019-squares-of-a-sorted-array
1468-check-if-n-and-its-double-exist
2164-two-best-non-overlapping-events
2640-maximum-number-of-integers-to-choose-from-a-range-i
2695-find-score-of-an-array-after-marking-all-elements
2891-maximum-beauty-of-an-array-after-applying-operation

Linked List

0021-merge-two-sorted-lists
0024-swap-nodes-in-pairs
0086-partition-list
0114-flatten-binary-tree-to-linked-list
0141-linked-list-cycle
0143-reorder-list
0148-sort-list
0206-reverse-linked-list
0234-palindrome-linked-list
0328-odd-even-linked-list
0908-middle-of-the-linked-list
1072-next-greater-node-in-linked-list

Recursion

0021-merge-two-sorted-lists
0024-swap-nodes-in-pairs
0143-reorder-list
0206-reverse-linked-list
0231-power-of-two
0234-palindrome-linked-list
1013-fibonacci-number

Two Pointers

0011-container-with-most-water
0016-3sum-closest
0026-remove-duplicates-from-sorted-array
0027-remove-element
0075-sort-colors
0086-partition-list
0141-linked-list-cycle
0143-reorder-list
0148-sort-list
0202-happy-number
0234-palindrome-linked-list
0344-reverse-string
0567-permutation-in-string
0874-backspace-string-compare
0908-middle-of-the-linked-list
0941-sort-array-by-parity
0953-reverse-only-letters
0958-sort-array-by-parity-ii
1019-squares-of-a-sorted-array
1468-check-if-n-and-its-double-exist
2232-adding-spaces-to-a-string
2414-move-pieces-to-obtain-a-string

Stack

0020-valid-parentheses
0094-binary-tree-inorder-traversal
0114-flatten-binary-tree-to-linked-list
0143-reorder-list
0234-palindrome-linked-list
0496-next-greater-element-i
0503-next-greater-element-ii
0775-n-ary-tree-preorder-traversal
0776-n-ary-tree-postorder-traversal
0874-backspace-string-compare
0957-minimum-add-to-make-parentheses-valid
1072-next-greater-node-in-linked-list
1128-remove-all-adjacent-duplicates-in-string

Dynamic Programming

0118-pascals-triangle
0121-best-time-to-buy-and-sell-stock
0747-min-cost-climbing-stairs
1013-fibonacci-number
2164-two-best-non-overlapping-events

Math

0007-reverse-integer
0009-palindrome-number
0012-integer-to-roman
0013-roman-to-integer
0048-rotate-image
0066-plus-one
0067-add-binary
0202-happy-number
0231-power-of-two
0412-fizz-buzz
1013-fibonacci-number

String

0012-integer-to-roman
0013-roman-to-integer
0014-longest-common-prefix
0020-valid-parentheses
0058-length-of-last-word
0067-add-binary
0205-isomorphic-strings
0242-valid-anagram
0344-reverse-string
0409-longest-palindrome
0412-fizz-buzz
0482-license-key-formatting
0567-permutation-in-string
0657-robot-return-to-origin
0742-to-lower-case
0782-jewels-and-stones
0822-unique-morse-code-words
0837-most-common-word
0874-backspace-string-compare
0952-word-subsets
0953-reverse-only-letters
0957-minimum-add-to-make-parentheses-valid
0965-unique-email-addresses
1128-remove-all-adjacent-duplicates-in-string
1302-delete-characters-to-make-fancy-string
2232-adding-spaces-to-a-string
2414-move-pieces-to-obtain-a-string

Greedy

0011-container-with-most-water
0409-longest-palindrome
0876-hand-of-straights
0957-minimum-add-to-make-parentheses-valid
2640-maximum-number-of-integers-to-choose-from-a-range-i

Binary Search

0035-search-insert-position
0278-first-bad-version
0792-binary-search
0882-peak-index-in-a-mountain-array
1046-max-consecutive-ones-iii
1468-check-if-n-and-its-double-exist
1886-minimum-limit-of-balls-in-a-bag
2164-two-best-non-overlapping-events
2640-maximum-number-of-integers-to-choose-from-a-range-i
2891-maximum-beauty-of-an-array-after-applying-operation

Interactive

0278-first-bad-version

Simulation

0054-spiral-matrix
0059-spiral-matrix-ii
0067-add-binary
0412-fizz-buzz
0657-robot-return-to-origin
0874-backspace-string-compare
2232-adding-spaces-to-a-string
2692-take-gifts-from-the-richest-pile
2695-find-score-of-an-array-after-marking-all-elements

Union Find

0200-number-of-islands
0547-number-of-provinces

Matrix

0036-valid-sudoku
0048-rotate-image
0054-spiral-matrix
0059-spiral-matrix-ii
0200-number-of-islands
1147-flip-columns-for-maximum-number-of-equal-rows

Trie

0014-longest-common-prefix

Graph

0207-course-schedule
0547-number-of-provinces
0871-keys-and-rooms
3189-find-champion-ii

Divide and Conquer

0148-sort-list

Merge Sort

0148-sort-list

Sliding Window

0567-permutation-in-string
1046-max-consecutive-ones-iii
2891-maximum-beauty-of-an-array-after-applying-operation

Topological Sort

0207-course-schedule

Bit Manipulation

0067-add-binary
0136-single-number
0231-power-of-two

Counting

0837-most-common-word

Monotonic Stack

0496-next-greater-element-i
0503-next-greater-element-ii
1072-next-greater-node-in-linked-list

Memoization

1013-fibonacci-number

Prefix Sum

0724-find-pivot-index
1046-max-consecutive-ones-iii

Heap (Priority Queue)

2164-two-best-non-overlapping-events
2692-take-gifts-from-the-richest-pile
2695-find-score-of-an-array-after-marking-all-elements

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published