Unique Paths II
count paths from top-left to bottom-right with obstacles using dp with space optimization to O(n).
Leetcode
I collated all the leetcode problems i solved on here so you can learn from it. You can search for a problem, filter by language or problem type, narrow by difficulty.
Showing 1-10 of 242 problems
Page 1 of 25
count paths from top-left to bottom-right with obstacles using dp with space optimization to O(n).
notes and solution files for walking robot simulation.
rearrange array in wiggle pattern (nums[0] < nums[1] > nums[2] < ...) using sorted interleaving.
find the largest plus sign order by computing longest consecutive 1s in four directions using dp.
notes and solution files for movie rating.
notes and solution files for game theory.
find minimum balls needed to clear board using dfs with memoization, trying to form groups of 3+.
distribute candy to children based on ratings using two-pass greedy approach.
find maximum number of points that lie on the same line using slope calculation and hash map.
implement RecentCounter using circular queue to count requests within last 3000ms.