Skip to content

devxoshakya/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leetcode

Collection of LeetCode questions and their solutions.

LeetCode Topics

Linked List

0002-add-two-numbers
0021-merge-two-sorted-lists
0061-rotate-list
0083-remove-duplicates-from-sorted-list
0092-reverse-linked-list-ii
0114-flatten-binary-tree-to-linked-list
0116-populating-next-right-pointers-in-each-node
0141-linked-list-cycle
0142-linked-list-cycle-ii
0143-reorder-list
0148-sort-list
0160-intersection-of-two-linked-lists
0206-reverse-linked-list
0234-palindrome-linked-list
0237-delete-node-in-a-linked-list
0817-design-hashmap
0860-design-circular-queue
0908-middle-of-the-linked-list
1411-convert-binary-number-in-a-linked-list-to-integer

Recursion

0002-add-two-numbers
0021-merge-two-sorted-lists
0143-reorder-list
0206-reverse-linked-list
0234-palindrome-linked-list
0509-fibonacci-number

Hash Table

0001-two-sum
0003-longest-substring-without-repeating-characters
0013-roman-to-integer
0041-first-missing-positive
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0141-linked-list-cycle
0142-linked-list-cycle-ii
0160-intersection-of-two-linked-lists
0202-happy-number
0817-design-hashmap
1482-how-many-numbers-are-smaller-than-the-current-number
1635-number-of-good-pairs
1960-check-if-the-sentence-is-pangram

Two Pointers

0015-3sum
0027-remove-element
0061-rotate-list
0141-linked-list-cycle
0142-linked-list-cycle-ii
0143-reorder-list
0148-sort-list
0160-intersection-of-two-linked-lists
0167-two-sum-ii-input-array-is-sorted
0202-happy-number
0234-palindrome-linked-list
0557-reverse-words-in-a-string-iii
0861-flipping-an-image
0908-middle-of-the-linked-list

Math

0002-add-two-numbers
0007-reverse-integer
0009-palindrome-number
0013-roman-to-integer
0067-add-binary
0069-sqrtx
0070-climbing-stairs
0202-happy-number
0367-valid-perfect-square
0441-arranging-coins
0509-fibonacci-number
1031-add-to-array-form-of-integer
1378-cells-with-odd-values-in-a-matrix
1411-convert-binary-number-in-a-linked-list-to-integer
1421-find-numbers-with-even-number-of-digits
1426-find-n-unique-integers-sum-up-to-zero
1635-number-of-good-pairs

Divide and Conquer

0105-construct-binary-tree-from-preorder-and-inorder-traversal
0108-convert-sorted-array-to-binary-search-tree
0148-sort-list
0948-sort-an-array

Sorting

0015-3sum
0148-sort-list
0948-sort-an-array
1482-how-many-numbers-are-smaller-than-the-current-number
1970-sorting-the-sentence

Merge Sort

0148-sort-list
0948-sort-an-array

Stack

0020-valid-parentheses
0084-largest-rectangle-in-histogram
0094-binary-tree-inorder-traversal
0114-flatten-binary-tree-to-linked-list
0143-reorder-list
0145-binary-tree-postorder-traversal
0232-implement-queue-using-stacks
0234-palindrome-linked-list
0957-minimum-add-to-make-parentheses-valid
1648-minimum-insertions-to-balance-a-parentheses-string

Design

0232-implement-queue-using-stacks
0817-design-hashmap
0860-design-circular-queue

Queue

0232-implement-queue-using-stacks
0860-design-circular-queue

Array

0001-two-sum
0015-3sum
0027-remove-element
0034-find-first-and-last-position-of-element-in-sorted-array
0041-first-missing-positive
0079-word-search
0084-largest-rectangle-in-histogram
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0108-convert-sorted-array-to-binary-search-tree
0167-two-sum-ii-input-array-is-sorted
0485-max-consecutive-ones
0745-find-smallest-letter-greater-than-target
0817-design-hashmap
0860-design-circular-queue
0861-flipping-an-image
0898-transpose-matrix
0948-sort-an-array
1031-add-to-array-form-of-integer
1378-cells-with-odd-values-in-a-matrix
1421-find-numbers-with-even-number-of-digits
1426-find-n-unique-integers-sum-up-to-zero
1470-shuffle-the-array
1482-how-many-numbers-are-smaller-than-the-current-number
1496-lucky-numbers-in-a-matrix
1505-create-target-array-in-the-given-order
1528-kids-with-the-greatest-number-of-candies
1580-shuffle-the-array
1603-running-sum-of-1d-array
1635-number-of-good-pairs
1646-kth-missing-positive-number
1651-shuffle-string
1677-matrix-diagonal-sum
1781-check-if-two-string-arrays-are-equivalent
1791-richest-customer-wealth
1899-count-items-matching-a-rule
1929-concatenation-of-array
2048-build-array-from-permutation
2058-concatenation-of-array
2099-number-of-strings-that-appear-as-substrings-in-word
2350-find-closest-number-to-zero

Monotonic Stack

0084-largest-rectangle-in-histogram

String

0003-longest-substring-without-repeating-characters
0013-roman-to-integer
0014-longest-common-prefix
0020-valid-parentheses
0067-add-binary
0079-word-search
0557-reverse-words-in-a-string-iii
0657-robot-return-to-origin
0742-to-lower-case
0957-minimum-add-to-make-parentheses-valid
1205-defanging-an-ip-address
1648-minimum-insertions-to-balance-a-parentheses-string
1651-shuffle-string
1781-check-if-two-string-arrays-are-equivalent
1797-goal-parser-interpretation
1823-determine-if-string-halves-are-alike
1899-count-items-matching-a-rule
1960-check-if-the-sentence-is-pangram
1970-sorting-the-sentence
2099-number-of-strings-that-appear-as-substrings-in-word

Greedy

0957-minimum-add-to-make-parentheses-valid
1648-minimum-insertions-to-balance-a-parentheses-string

Tree

0094-binary-tree-inorder-traversal
0098-validate-binary-search-tree
0100-same-tree
0101-symmetric-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0104-maximum-depth-of-binary-tree
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0107-binary-tree-level-order-traversal-ii
0108-convert-sorted-array-to-binary-search-tree
0114-flatten-binary-tree-to-linked-list
0116-populating-next-right-pointers-in-each-node
0145-binary-tree-postorder-traversal
0199-binary-tree-right-side-view
0222-count-complete-tree-nodes
0226-invert-binary-tree
0230-kth-smallest-element-in-a-bst
0236-lowest-common-ancestor-of-a-binary-tree
0543-diameter-of-binary-tree
0637-average-of-levels-in-binary-tree
1035-cousins-in-binary-tree

Breadth-First Search

0100-same-tree
0101-symmetric-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0104-maximum-depth-of-binary-tree
0107-binary-tree-level-order-traversal-ii
0116-populating-next-right-pointers-in-each-node
0199-binary-tree-right-side-view
0226-invert-binary-tree
0637-average-of-levels-in-binary-tree
1035-cousins-in-binary-tree

Binary Tree

0094-binary-tree-inorder-traversal
0098-validate-binary-search-tree
0100-same-tree
0101-symmetric-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0104-maximum-depth-of-binary-tree
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0107-binary-tree-level-order-traversal-ii
0108-convert-sorted-array-to-binary-search-tree
0114-flatten-binary-tree-to-linked-list
0116-populating-next-right-pointers-in-each-node
0145-binary-tree-postorder-traversal
0199-binary-tree-right-side-view
0222-count-complete-tree-nodes
0226-invert-binary-tree
0230-kth-smallest-element-in-a-bst
0236-lowest-common-ancestor-of-a-binary-tree
0543-diameter-of-binary-tree
0637-average-of-levels-in-binary-tree
1035-cousins-in-binary-tree

Depth-First Search

0079-word-search
0094-binary-tree-inorder-traversal
0098-validate-binary-search-tree
0100-same-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0114-flatten-binary-tree-to-linked-list
0116-populating-next-right-pointers-in-each-node
0145-binary-tree-postorder-traversal
0199-binary-tree-right-side-view
0226-invert-binary-tree
0230-kth-smallest-element-in-a-bst
0236-lowest-common-ancestor-of-a-binary-tree
0543-diameter-of-binary-tree
0637-average-of-levels-in-binary-tree
1035-cousins-in-binary-tree

Binary Search Tree

0034-find-first-and-last-position-of-element-in-sorted-array
0069-sqrtx
0098-validate-binary-search-tree
0108-convert-sorted-array-to-binary-search-tree
0167-two-sum-ii-input-array-is-sorted
0222-count-complete-tree-nodes
0230-kth-smallest-element-in-a-bst
0278-first-bad-version
0367-valid-perfect-square
0374-guess-number-higher-or-lower
0441-arranging-coins
0745-find-smallest-letter-greater-than-target
1646-kth-missing-positive-number

Simulation

0067-add-binary
0657-robot-return-to-origin
0861-flipping-an-image
0898-transpose-matrix
1378-cells-with-odd-values-in-a-matrix
1505-create-target-array-in-the-given-order
1929-concatenation-of-array
2048-build-array-from-permutation
2058-concatenation-of-array

Prefix Sum

1603-running-sum-of-1d-array

Matrix

0079-word-search
0861-flipping-an-image
0898-transpose-matrix
1496-lucky-numbers-in-a-matrix
1677-matrix-diagonal-sum
1791-richest-customer-wealth

Counting

1482-how-many-numbers-are-smaller-than-the-current-number
1635-number-of-good-pairs
1823-determine-if-string-halves-are-alike

Bit Manipulation

0067-add-binary
0222-count-complete-tree-nodes
0861-flipping-an-image

Trie

0014-longest-common-prefix

Hash Function

0817-design-hashmap

Interactive

0278-first-bad-version
0374-guess-number-higher-or-lower

Concurrency

1203-print-in-order

Sliding Window

0003-longest-substring-without-repeating-characters

Heap (Priority Queue)

0948-sort-an-array

Bucket Sort

0948-sort-an-array

Radix Sort

0948-sort-an-array

Counting Sort

0948-sort-an-array

Backtracking

0079-word-search

Dynamic Programming

0070-climbing-stairs
0509-fibonacci-number

Memoization

0070-climbing-stairs
0509-fibonacci-number

Database

0175-combine-two-tables
0181-employees-earning-more-than-their-managers
0584-find-customer-referee
0620-not-boring-movies

About

Collection of LeetCode questions that i have solved

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •