Skip to content

sumitkr003/leetcode-solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solutions to leetcode problems

Problem Solution
01 matrix solution
2134 minimum swaps to group all 1s together ii solution
3sum solution
3sum closest solution
a number after a double reversal solution
add strings solution
add two numbers solution
all elements in two binary search trees solution
all paths from source to target solution
arithmetic slices solution
array of doubled pairs solution
backspace string compare solution
balanced binary tree solution
beautiful arrangement ii solution
best time to buy and sell stock solution
best time to buy and sell stock ii solution
best time to buy and sell stock iii solution
best time to buy and sell stock iv solution
best time to buy and sell stock with cooldown solution
binary search solution
binary search tree iterator solution
binary search tree to greater sum tree solution
binary tree inorder traversal solution
binary tree level order traversal solution
binary tree level order traversal ii solution
binary tree maximum path sum solution
binary tree paths solution
binary tree postorder traversal solution
binary tree preorder traversal solution
binary tree right side view solution
binary tree tilt solution
binary tree zigzag level order traversal solution
bitwise ors of subarrays solution
break a palindrome solution
broken calculator solution
buddy strings solution
build an array with stack operations solution
bulls and cows solution
candy solution
capitalize the title solution
cells with odd values in a matrix solution
check if a string can break another string solution
check if all as appears before all bs solution
check if all the integers in a range are covered solution
check if every row and column contains all numbers solution
check if it is a straight line solution
check if numbers are ascending in a sentence solution
cinema seat allocation solution
circular permutation in binary representation solution
climbing stairs solution
clone graph solution
coin change solution
coin change 2 solution
combination sum solution
combination sum ii solution
compare version numbers solution
complement of base 10 integer solution
complex number multiplication solution
construct binary search tree from preorder traversal solution
construct binary tree from inorder and postorder traversal solution
construct binary tree from preorder and inorder traversal solution
container with most water solution
contains duplicate solution
contiguous array solution
continuous subarray sum solution
convert bst to greater tree solution
convert sorted array to binary search tree solution
convert sorted list to binary search tree solution
copy list with random pointer solution
count and say solution
count complete tree nodes solution
count good nodes in binary tree solution
count number of homogenous substrings solution
count number of nice subarrays solution
count of smaller numbers after self solution
count primes solution
count servers that communicate solution
count sorted vowel strings solution
count square submatrices with all ones solution
count the hidden sequences solution
count triplets that can form two arrays of equal xor solution
count vowels permutation solution
count words obtained after adding a letter solution
counting bits solution
counting elements solution
course schedule solution
course schedule ii solution
cousins in binary tree solution
daily temperatures solution
decode ways solution
decoded string at index solution
deepest leaves sum solution
defanging an ip address solution
delete node in a bst solution
delete tree nodes solution
destroying asteroids solution
detect pattern of length m repeated k or more times solution
determine if string halves are alike solution
determine whether matrix can be obtained by rotation solution
di string match solution
diameter of binary tree solution
distinct subsequences solution
distinct subsequences ii solution
distribute candies solution
divisor game solution
edit distance solution
egg drop with 2 eggs and n floors solution
execution of all suffix instructions staying in a grid solution
fibonacci number solution
find all anagrams in a string solution
find all duplicates in an array solution
find bottom left tree value solution
find center of star graph solution
find elements in a contaminated binary tree solution
find k closest elements solution
find k pairs with smallest sums solution
find latest group of size m solution
find longest awesome substring solution
find median from data stream solution
find minimum in rotated sorted array solution
find pivot index solution
find positive integer solution for a given equation solution
find smallest letter greater than target solution
find the duplicate number solution
find the k beauty of a number solution
find the kth smallest sum of a matrix with sorted rows solution
find the longest substring containing vowels in even counts solution
find the middle index in array solution
find the smallest divisor given a threshold solution
find the student that will replace the chalk solution
find the town judge solution
find winner on a tic tac toe game solution
first bad version solution
first missing positive solution
first unique character in a string solution
first unique number solution
flatten a multilevel doubly linked list solution
flatten binary tree to linked list solution
flood fill solution
gas station solution
generate parentheses solution
get maximum in generated array solution
global and local inversions solution
gray code solution
greatest sum divisible by three solution
grid game solution
group anagrams solution
group the people given the group size they belong to solution
happy number solution
hexspeak solution
house robber solution
house robber ii solution
house robber iii solution
image overlap solution
implement queue using stacks solution
implement stack using queues solution
implement trie prefix tree solution
insert delete getrandom o1 solution
insert into a binary search tree solution
integer break solution
integer replacement solution
integer to roman solution
interleaving string solution
intersection of two arrays solution
intersection of two arrays ii solution
intersection of two linked lists solution
interval list intersections solution
intervals between identical elements solution
invert binary tree solution
is graph bipartite solution
is subsequence solution
island perimeter solution
isomorphic strings solution
iterator for combination solution
jewels and stones solution
jump game solution
jump game ii solution
jump game vi solution
k closest points to origin solution
k concatenation maximum sum solution
k th symbol in grammar solution
kids with the greatest number of candies solution
kth largest element in an array solution
kth smallest element in a bst solution
kth smallest element in a sorted matrix solution
largest magic square solution
largest plus sign solution
largest rectangle in histogram solution
largest time for given digits solution
last stone weight solution
leftmost column with at least a one solution
length of last word solution
letter case permutation solution
letter combinations of a phone number solution
linked list cycle solution
linked list cycle ii solution
long pressed name solution
longest common prefix solution
longest common subsequence solution
longest consecutive sequence solution
longest harmonious subsequence solution
longest increasing subsequence solution
longest palindrome by concatenating two letter words solution
longest palindromic subsequence solution
longest palindromic substring solution
longest repeating character replacement solution
longest substring without repeating characters solution
longest valid parentheses solution
longest word in dictionary through deleting solution
lowest common ancestor of a binary search tree solution
lowest common ancestor of a binary tree solution
lru cache solution
majority element solution
majority element ii solution
matrix block sum solution
max consecutive ones solution
max consecutive ones iii solution
max difference you can get from changing an integer solution
max points on a line solution
maximal rectangle solution
maximal square solution
maximize sum of array after k negations solution
maximum depth of binary tree solution
maximum difference between increasing elements solution
maximum frequency stack solution
maximum height by stacking cuboids solution
maximum length of a concatenated string with unique characters solution
maximum length of subarray with positive product solution
maximum level sum of a binary tree solution
maximum non negative product in a matrix solution
maximum number of balloons solution
maximum number of coins you can get solution
maximum number of removable characters solution
maximum number of weeks for which you can work solution
maximum number of words found in sentences solution
maximum product subarray solution
maximum profit in job scheduling solution
maximum score of a good subarray solution
maximum subarray solution
maximum sum circular subarray solution
maximum twin sum of a linked list solution
maximum white tiles covered by a carpet solution
median of two sorted arrays solution
merge in between linked lists solution
merge intervals solution
merge k sorted lists solution
merge sorted array solution
merge triplets to form target triplet solution
merge two sorted lists solution
middle of the linked list solution
min cost climbing stairs solution
min stack solution
minimized maximum of products distributed to any store solution
minimum changes to make alternating binary string solution
minimum cost of buying candies with discount solution
minimum deletions to make character frequencies unique solution
minimum depth of binary tree solution
minimum insertion steps to make a string palindrome solution
minimum limit of balls in a bag solution
minimum number of arrows to burst balloons solution
minimum number of people to teach solution
minimum number of removals to make mountain array solution
minimum number of vertices to reach all nodes solution
minimum path sum solution
minimum remove to make valid parentheses solution
minimum swaps to group all 1s together ii solution
minimum swaps to make strings equal solution
minimum time to collect all apples in a tree solution
minimum time to make rope colorful solution
minimum time visiting all points solution
minimum value to get positive step by step sum solution
minimum window substring solution
missing number solution
most common word solution
most visited sector in a circular track solution
move zeroes solution
n queens solution
n th tribonacci number solution
next greater element i solution
next greater element ii solution
next greater element iii solution
next permutation solution
number complement solution
number of burgers with no waste of ingredients solution
number of closed islands solution
number of dice rolls with target sum solution
number of enclaves solution
number of islands solution
number of laser beams in a bank solution
number of matching subsequences solution
number of steps to reduce a number to zero solution
number of sub arrays with odd sum solution
number of ways to split array solution
number of ways to stay in the same place after some steps solution
number of ways where square of number is equal to product of two numbers solution
online stock span solution
palindrome linked list solution
palindrome number solution
palindrome partitioning solution
palindrome partitioning ii solution
palindrome partitioning iii solution
partition array for maximum sum solution
partition array into disjoint intervals solution
partition array into three parts with equal sum solution
partition equal subset sum solution
partition labels solution
partition list solution
pascals triangle solution
pascals triangle ii solution
path sum solution
path sum ii solution
path sum iii solution
perfect squares solution
perform string shifts solution
permutation sequence solution
permutations solution
plus one solution
populating next right pointers in each node solution
populating next right pointers in each node ii solution
powx n solution
prison cells after n days solution
process tasks using servers solution
product of array except self solution
queens that can attack the king solution
range addition ii solution
range sum of bst solution
range sum query 2d immutable solution
range sum query immutable solution
range sum query mutable solution
ransom note solution
reconstruct a 2 row binary matrix solution
recover binary search tree solution
redistribute characters to make all strings equal solution
reducing dishes solution
redundant connection solution
redundant connection ii solution
regular expression matching solution
relative sort array solution
remove all adjacent duplicates in string solution
remove duplicates from sorted array solution
remove duplicates from sorted array ii solution
remove duplicates from sorted list solution
remove duplicates from sorted list ii solution
remove element solution
remove interval solution
remove nth node from end of list solution
remove palindromic subsequences solution
remove sub folders from the filesystem solution
reordered power of 2 solution
reorganize string solution
replace all s to avoid consecutive repeating characters solution
replace the substring for balanced string solution
reverse integer solution
reverse linked list solution
reverse linked list ii solution
reverse nodes in k group solution
reverse only letters solution
reverse words in a string solution
rotate array solution
rotate image solution
rotate list solution
rotting oranges solution
running sum of 1d array solution
same tree solution
scramble string solution
search a 2d matrix solution
search a 2d matrix ii solution
search in a binary search tree solution
search in rotated sorted array solution
search in rotated sorted array ii solution
search insert position solution
search suggestions system solution
serialize and deserialize binary tree solution
serialize and deserialize bst solution
set matrix zeroes solution
shift 2d grid solution
shifting letters solution
shortest distance to a character solution
shortest path in binary matrix solution
shortest unsorted continuous subarray solution
shuffle the array solution
simple bank system solution
simplify path solution
single element in a sorted array solution
single number solution
sliding window maximum solution
slowest key solution
smallest integer divisible by k solution
sort an array solution
sort array by parity ii solution
sort characters by frequency solution
sort colors solution
sort integers by the power value solution
spiral matrix solution
spiral matrix ii solution
split a string in balanced strings solution
split linked list in parts solution
sqrtx solution
stone game solution
string to integer atoi solution
subarray sum equals k solution
subsets solution
subsets ii solution
subtract the product and sum of digits of an integer solution
sudoku solver solution
sum of left leaves solution
sum of root to leaf binary numbers solution
sum of square numbers solution
sum root to leaf numbers solution
super egg drop solution
super ugly number solution
swap nodes in pairs solution
swim in rising water solution
symmetric tree solution
target sum solution
the k weakest rows in a matrix solution
thousand separator solution
three divisors solution
trapping rain water solution
triangle solution
two sum solution
two sum ii input array is sorted solution
two sum iv input is a bst solution
unique binary search trees solution
unique binary search trees ii solution
unique email addresses solution
unique paths solution
unique paths ii solution
valid anagram solution
valid palindrome solution
valid palindrome ii solution
valid parentheses solution
valid parenthesis string solution
valid perfect square solution
valid sudoku solution
valid triangle number solution
validate binary search tree solution
verify preorder serialization of a binary tree solution
vowels of all substrings solution
wildcard matching solution
word break solution
word break ii solution
word pattern solution
zigzag conversion solution

About

My submitted solutions to leetcode problems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages