Mar 20, 2026
You are given an array prices where prices[i] is the price of a stock on day i. Find the maximum profit with as many transactions as you like, subject to:...
leetcodemediumdp
Mar 19, 2026
In an infinite chess board with coordinates from -infinity to +infinity, a knight starts at (0, 0). Return the minimum number of moves to reach (x, y).
leetcodemediumbfs
Mar 19, 2026
Implement a SnapshotArray that supports: SnapshotArray(int length) – initializes an array of the given length (all zeros) void set(index, val) – sets the element at index to val int snap()...
leetcodemediumdesignbinary-search
Mar 18, 2026
Design a hit counter that counts the number of hits received in the past 5 minutes (300 seconds).
leetcodemediumdesignqueue
Mar 18, 2026
Given a binary tree, a node X is good if there is no node with a value greater than X on the path from root to X. Return the number...
leetcodemediumtreedfsbfs
Mar 17, 2026
A company has n employees numbered 0 to n-1. Each employee has exactly one direct manager given in manager[i], except the head of the company (manager[headID] == -1). An employee...
leetcodemediumtreedfsbfs
Mar 16, 2026
You are given a 2D array intervals where intervals[i] = [left_i, right_i] represents the inclusive interval [left_i, right_i]. Divide the intervals into one or more groups such that no two...
leetcodemediumgreedyheapintervals
Mar 15, 2026
A gene string is represented by an 8-character string of 'A', 'C', 'G', and 'T'. Given startGene, endGene, and a bank of valid gene strings, return the minimum number of...
leetcodemediumbfsstring
Mar 12, 2026
There are n rooms labeled 0 to n-1. All rooms are locked except room 0. Each room contains a set of keys to other rooms. Given rooms[i] – the set...
leetcodemediumgraphdfsbfs
Mar 11, 2026
Given an n x n binary matrix grid, return the length of the shortest clear path from top-left (0,0) to bottom-right (n-1,n-1). A clear path consists of cells with value...
leetcodemediumgraphbfs