Back
Archive
Notes and write-ups from 2019–2022, mostly from when I was teaching myself competitive programming.
Blog posts
algorithms
links
pythonic tricks
Notes
(188)
2d matrix ways
accounts merge wip
add strings
add two numbers
alien dictionary
array index and element equality
array min
basic calculator II
best time to buy and sell stock
bfs
big oh definition
big omega definition
binary search
binary search award budget cuts
binary search tree iterator
binary tree level order traversal
binary tree maximum path sum
binary tree right side view
binary tree vertical order traversal
binomial coefficients
bracket match
breadth first search
budget cuts
busiest time at the mall
closest binary search tree value
competitive programming
continuous subarray sum
counting bits WIP
cubing
data tables
dataclass
decoding a string
depth first search
design add and search words data structure
dfs backedge detection
diameter of binary tree
diff between two strings
divide two integers
dp array sum
draw h tree
drone flight planner
enumerate
EPIP
exclusive time of functions
find connected components
find first occurrence of k in array
find missing number in array
find the celebrity
flatten a dictionary
generating callgraphs in python with mermaid
generating primes
generator expressions
getting a different number
huffman encoding
inorder successor in bst
int to base
integer to english words
intersection of three sorted arrays
intersection of two arrays
is graph bipartitie
itertools.product
k closest points to origin
kth largest element in an array
lambdas
largest smaller BST key
largest time for given digits
levenshtein distance
linked list cycle
list comprehensions
longest arithmetic sequence
longest palindrome
longest substrinct with at most k distinct characters
lru cache
making a large island
matrix anticlockwise rotation
matrix clockwise rotation
matrix diagonal sum
matrix transpose
max array
max array from right
maximum difference between node and ancestor
maximum size subarray sum equals k
maximum sum of 3 non overlapping subarrays
maximum swap
meeting rooms ii
merge 2 sorted lists
merge intervals
merge k sorted lists
merge sorted array
mincost tickets
minimum cost spanning tree
minimum deletion
minimum remove to make valid parentheses
minimum window substring
monotonic array
move zeroes to end
movies
multiply strings
multistage graph
n
n(n+1) over 2
next closest time
next greater element i
next permutation
num encodings
number of islands
number of paths
number of submatrices
online stock span
optimal merge pattern
page rank
pancake sort
path sum iii
permuting a string
pow x n
power of two
pramp algorithms
product of array except self
pyqt webview
python array module
python list slicing
quadratic
rabin karp
random pick index
random pick with weight
range sum of bst
range sum query mutable
recurrence relation for a simple decreasing function
recurrence relation with for loop
recursion
reduce
regular expression matching
remove duplicates
remove invalid parentheses
reorder routes to make all paths lead to city zero
return a list with 0 or 1 items
reverse sublist
reversing a subarray
roman to numeral
rotate a 2d array
rotated digits
rotten oranges
scrims
search first key
serialize and deserialize binary tree
shifted array search
shifted zip
shortest distance from all buildings
single bidirectional pass
slicing to prevent list index out of range
snippets
spiral matrix II
spiral order matrix
split array with equal sum
split array with equal sums
splitting a list into two distinct sublists
sqrt(n)
string contains all chars ordered
string contains all chars unordered
string formatting
subarray sum equals k
subsets
subsets II
substring search
sudoku solver
switch calculator
systems design
task scheduler
ternary conditionals
the skyline problem
theta definition
ThreadPoolExecutor dead simple example
three sum
time complexity analysis
toeplitz matrix
tracing the recursion tree
Trapping Rain Water
two sum
using xor for signedness
valid palindrome
valid palindrome II
validate sudoku
verifying an alien dictionary
vertical order traversal of a binary tree
vulnerability scanning techniques
word break
word count engine
zigzag conversion