Skip to content

This repository contains solutions to various LeetCode problems, which are commonly used in coding interviews.

License

Notifications You must be signed in to change notification settings

ankan24/LeetCode-Solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

864 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A collection of LeetCode questions to ace the coding interview!

LeetCode Topics

Array

0001-two-sum
0004-median-of-two-sorted-arrays
0027-remove-element
0035-search-insert-position
0036-valid-sudoku
0037-sudoku-solver
0042-trapping-rain-water
0051-n-queens
0073-set-matrix-zeroes
0121-best-time-to-buy-and-sell-stock
0228-summary-ranges
0532-k-diff-pairs-in-an-array
0661-image-smoother
0682-baseball-game
1550-three-consecutive-odds
1672-richest-customer-wealth
1822-sign-of-the-product-of-an-array
2108-find-first-palindromic-string-in-the-array
2114-maximum-number-of-words-found-in-sentences
2535-difference-between-element-sum-and-digit-sum-of-an-array
2798-number-of-employees-who-met-the-target
2942-find-words-containing-character
2974-minimum-number-game
3024-type-of-triangle
3232-find-if-digit-game-can-be-won
3581-the-two-sneaky-numbers-of-digitville

Hash Table

0001-two-sum
0036-valid-sudoku
0037-sudoku-solver
0073-set-matrix-zeroes
0387-first-unique-character-in-a-string
0532-k-diff-pairs-in-an-array
1832-check-if-the-sentence-is-pangram
3581-the-two-sneaky-numbers-of-digitville

Dynamic Programming

0042-trapping-rain-water
0121-best-time-to-buy-and-sell-stock

Matrix

0036-valid-sudoku
0037-sudoku-solver
0073-set-matrix-zeroes
0661-image-smoother
1672-richest-customer-wealth

String

0020-valid-parentheses
0028-find-the-index-of-the-first-occurrence-in-a-string
0058-length-of-last-word
0067-add-binary
0125-valid-palindrome
0344-reverse-string
0387-first-unique-character-in-a-string
0657-robot-return-to-origin
0709-to-lower-case
1832-check-if-the-sentence-is-pangram
2108-find-first-palindromic-string-in-the-array
2114-maximum-number-of-words-found-in-sentences
2942-find-words-containing-character
3019-number-of-changing-keys

Stack

0020-valid-parentheses
0042-trapping-rain-water
0094-binary-tree-inorder-traversal
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0682-baseball-game

Two Pointers

0027-remove-element
0028-find-the-index-of-the-first-occurrence-in-a-string
0042-trapping-rain-water
0125-valid-palindrome
0344-reverse-string
0532-k-diff-pairs-in-an-array
2108-find-first-palindromic-string-in-the-array

String Matching

0028-find-the-index-of-the-first-occurrence-in-a-string

Bit Manipulation

0067-add-binary
0201-bitwise-and-of-numbers-range
0231-power-of-two
0476-number-complement
1486-xor-operation-in-an-array
3676-smallest-number-with-all-set-bits

Queue

0387-first-unique-character-in-a-string

Counting

0387-first-unique-character-in-a-string

Binary Search

0004-median-of-two-sorted-arrays
0035-search-insert-position
0069-sqrtx
0532-k-diff-pairs-in-an-array

Sorting

0532-k-diff-pairs-in-an-array
2974-minimum-number-game
3024-type-of-triangle

Linked List

0024-swap-nodes-in-pairs
0025-reverse-nodes-in-k-group

Recursion

0024-swap-nodes-in-pairs
0025-reverse-nodes-in-k-group
0050-powx-n
0231-power-of-two

Math

0009-palindrome-number
0050-powx-n
0067-add-binary
0069-sqrtx
0231-power-of-two
0258-add-digits
1281-subtract-the-product-and-sum-of-digits-of-an-integer
1486-xor-operation-in-an-array
1822-sign-of-the-product-of-an-array
2520-count-the-digits-that-divide-a-number
2535-difference-between-element-sum-and-digit-sum-of-an-array
2652-sum-multiples
2769-find-the-maximum-achievable-number
2894-divisible-and-non-divisible-sums-difference
3024-type-of-triangle
3232-find-if-digit-game-can-be-won
3581-the-two-sneaky-numbers-of-digitville
3676-smallest-number-with-all-set-bits

Tree

0094-binary-tree-inorder-traversal
0104-maximum-depth-of-binary-tree
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0783-search-in-a-binary-search-tree

Depth-First Search

0094-binary-tree-inorder-traversal
0104-maximum-depth-of-binary-tree
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal

Binary Tree

0094-binary-tree-inorder-traversal
0104-maximum-depth-of-binary-tree
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0783-search-in-a-binary-search-tree

Binary Search Tree

0783-search-in-a-binary-search-tree

Breadth-First Search

0104-maximum-depth-of-binary-tree

Simulation

0067-add-binary
0258-add-digits
0657-robot-return-to-origin
0682-baseball-game
2974-minimum-number-game

Backtracking

0037-sudoku-solver
0051-n-queens

Divide and Conquer

0004-median-of-two-sorted-arrays

Monotonic Stack

0042-trapping-rain-water

Heap (Priority Queue)

2974-minimum-number-game

Number Theory

0258-add-digits

About

This repository contains solutions to various LeetCode problems, which are commonly used in coding interviews.

Topics

Resources

License

Stars

Watchers

Forks

Contributors