LeetCode
LeetCode notes
Every LeetCode problem I have solved, with notes. Search by title, or filter by language, problem type and difficulty.
442 problems · page 1 of 23
13 Sept 2026 · Medium
Image Overlap
Find the largest overlap between two binary images under any translation.
Go / Python / TypeScript · array · matrix
13 Sept 2026 · Medium
Max Increase to Keep City Skyline
Maximize the total height increase while preserving every row and column skyline.
Go / Python / TypeScript · array · greedy · matrix
12 Sept 2026 · Easy
Find Numbers with Even Number of Digits
Count the integers whose decimal representation contains an even number of digits.
Go / Python / TypeScript · array · math
09 Sept 2026 · Easy
Add to Array-Form of Integer
Add an integer to a number represented as an array of decimal digits.
Go / Python / TypeScript · array · math
09 Sept 2026 · Easy
Available Captures for Rook
Count pawns an unmoving rook can capture along the four board directions before a bishop blocks it.
Go / Python / TypeScript · array · matrix · simulation
09 Sept 2026 · Easy
Backspace String Compare
Check whether two typed strings are equal after applying backspace characters.
Go / Python / TypeScript · two-pointers · string · stack · simulation
09 Sept 2026 · Easy
Baseball Game
Evaluate a sequence of baseball scoring operations and return the total score.
Go / Python / TypeScript · array · stack · simulation
09 Sept 2026 · Easy
Binary Gap
Find the greatest distance between consecutive set bits in an integer.
Go / Python / TypeScript · bit-manipulation
09 Sept 2026 · Easy
Binary Number with Alternating Bits
Determine whether adjacent bits in a positive integer alternate between zero and one.
Go / Python / TypeScript · bit-manipulation
09 Sept 2026 · Easy
Binary Prefix Divisible By 5
Report whether each binary-array prefix represents a number divisible by five.
Go / Python / TypeScript · array · bit-manipulation
09 Sept 2026 · Easy
Binary Search
Locate a target in a sorted integer array or report that it is absent.
Go / Python / TypeScript · array · binary-search
09 Sept 2026 · Easy
Buddy Strings
Check whether swapping exactly two characters in one string can produce another string.
Go / Python / TypeScript · hash-table · string
09 Sept 2026 · Easy
Can Place Flowers
Determine whether enough flowers can be planted without placing any two in adjacent plots.
Go / Python / TypeScript · array · greedy
09 Sept 2026 · Easy
Cells with Odd Values in a Matrix
Count odd matrix cells after incrementing selected rows and columns.
Go / Python / TypeScript · array · math · simulation
09 Sept 2026 · Easy
Check If It Is a Straight Line
Determine whether every coordinate lies on one straight line.
Go / Python / TypeScript · array · math · geometry
09 Sept 2026 · Easy
Complement of Base 10 Integer
Flip every significant bit in a nonnegative integer's binary representation.
Go / Python / TypeScript · bit-manipulation
09 Sept 2026 · Easy
Day of the Week
Return the weekday name for a Gregorian calendar date.
Go / Python / TypeScript · math
09 Sept 2026 · Easy
Day of the Year
Convert an ISO calendar date to its one-based ordinal day within the year.
Go / Python / TypeScript · math · string
09 Sept 2026 · Easy
Defanging an IP Address
Replace every period in an IPv4 address with a bracketed period.
Go / Python / TypeScript · string
09 Sept 2026 · Easy
Degree of an Array
Find the shortest subarray with the same frequency degree as the complete array.
Go / Python / TypeScript · array · hash-table