Dec 18, 2025
There are n cities. Some of them are connected, while some are not. If city a is connected directly with city b, and city b is connected directly with city...
leetcodealgorithmmediumcppdisjoint-setdfsgraphproblem-solving
Dec 17, 2025
You are given an array of variable pairs equations and an array of real numbers values, where equations[i] = [Ai, Bi] and values[i] represent the equation Ai / Bi =...
leetcodealgorithmmediumcppdisjoint-setgraphdfsproblem-solving
Dec 16, 2025
You have a data structure of employee information, including the employee’s unique ID, importance value, and direct subordinates’ IDs.
leetcodealgorithmmediumcppdfsbfshash-tableproblem-solving
Dec 16, 2025
You are given a 2D array of axis-aligned rectangles. For each rectangle[i] = [xi1, yi1, xi2, yi2], where (xi1, yi1) is the bottom-left corner and (xi2, yi2) is the top-right...
leetcodealgorithmhardcppgeometrysweep-linesegment-treeproblem-solving
Dec 14, 2025
You are given an m x n grid rooms initialized with these three possible values:
leetcodealgorithmmediumcpparraymatrixbfsproblem-solving
Dec 14, 2025
Given an integer n, return the least number of perfect square numbers that sum to n.
leetcodealgorithmmediumcppmathdynamic-programmingbfsproblem-solving
Dec 14, 2025
Greedy algorithms are among the most elegant tools in competitive programming — when they work, they’re simpler and faster than dynamic programming. This guide covers the core greedy patterns you’ll...
leetcodetemplatesgreedy
Dec 14, 2025
Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window.
leetcodealgorithmeasycppqueuesliding-windowdesignproblem-solving
Dec 13, 2025
You are given an m x n grid where each cell can have one of three values:
leetcodealgorithmmediumcpparraymatrixbfsproblem-solving
Dec 11, 2025
Given an array of meeting time intervals intervals where intervals[i] = [starti, endi], return the minimum number of conference rooms required.
leetcodealgorithmmediumcpparraysortingpriority-queuetwo-pointersproblem-solving