algorithms

🏠

Complete Writeups

two sum
three sum
valid palindrome II
find the celebrity
levenshtein distance
making a large island
subarray sum equals k
split array with equal sum
longest arithmetic sequence
monotonic array
dp array sum
kth largest element in an array

pythonic algorithms

nested functions
splitting a list into two distinct sublists
using tuples instead of ternaries
string formatting
enumerate
reversing a subarray
binary search
string substrings
shifted zip
return a list with 0 or 1 items
slicing to prevent list index out of range
array max
array min
max array
max array from right
matrix transpose
matrix clockwise rotation
matrix anticlockwise rotation
itertools.product
list index complement
single bidirectional pass
string contains all chars unordered
string contains all chars ordered
using xor for signedness
find missing number in array
int to base
gcd
dfs
bfs
dp array sum

Advanced Python

python array module

Greedy Method

optimal merge pattern
huffman encoding
job scheduling with deadlines

Trees

minimum cost spanning tree
multistage graph

Drafts

next closest time
rotten oranges
spiral matrix II
[[fraction to recurring decimal]]
merge k sorted lists
[[trapping rain water]]
product of array except self
diameter of binary tree
merge intervals
minimum remove to make valid parentheses
integer to english words
[[serialize and deserialize binary tree]]
alien dictionary
word break
verifying an alien dictionary
next permutation
add strings
minimum window substring
merge sorted array
binary tree right side view
binary tree maximum path sum
remove invalid parentheses
[[valid palindrome]]
vertical order traversal of a binary tree
binary tree vertical order traversal
task scheduler
random pick with weight
longest substrinct with at most k distinct characters
exclusive time of functions
valid number
intersection of two arrays
divide two integers
[[accounts merge]]
range sum of bst
continuous subarray sum
[[expression add operators]]
closest binary search tree value
maximum swap
k closest points to origin
is graph bipartitie
random pick index
maximum sum of 3 non overlapping subarrays
maximum difference between node and ancestor
binary tree vertical order traversal
online stock span
maximum size subarray sum equals k
longest palindrome
zigzag conversion
regular expression matching
multiply strings
mincost tickets
permuting a string
binary search tree iterator
pow x n
find connected components
num encodings
shortest distance from all buildings
subsets
subsets II
the skyline problem
split array with equal sums
exclusive time of functions
basic calculator II
maximum sum of 3 non overlapping subarrays
design add and search words data structure
matrix diagonal sum
path sum iii
power of two
meeting rooms ii
lru cache
inorder successor in bst

pramp algorithms

budget cuts
flatten a dictionary
find first occurrence of k in array
substring search
move zeroes to end
toeplitz matrix
spiral order matrix
[[island count]]
product of array except self
pancake sort
draw h tree
decoding a string
getting a different number
shifted array search
busiest time at the mall
bracket match
minimum deletion
sudoku solver
diff between two strings
word count engine

TBD:

largest smaller BST key

EPIP

rotate a 2d array
binary tree level order traversal
search first key
remove duplicates
levenshtein distance
2d matrix ways
binomial coefficients

time complexity analysis

n
quadratic
n(n+1) over 2
sqrt(n)
recurrence relation for a simple decreasing function
recurrence relation with for loop
big oh definition
theta definition
big omega definition

cubing