2493. Divide Nodes Into the Maximum Number of Groups
You are given a positive integer n representing the number of nodes in an undirected graph. The nodes are labeled from 1 to n. You are also […]
You are given a positive integer n representing the number of nodes in an undirected graph. The nodes are labeled from 1 to n. You are also […]
In this problem, a tree is an undirected graph that is connected and has no cycles. You are given a graph that
You are given a 0-indexed 2D matrix grid of size m x n, where (r, c) represents: A land cell if grid[r][c] = 0, or A water cell containing grid[r][c] fish, if grid[r][c] > 0.
There are a total of numCourses courses you have to take, labeled from 0 to numCourses – 1. You are given an array prerequisites where prerequisites[i] = [ai,
A company is organizing a meeting and has a list of n employees, waiting to be invited. They have arranged for a
You are given a 0-indexed array of positive integers nums and a positive integer limit. In one operation, you can choose any two indices i and j and swap nums[i] and nums[j] if |nums[i] – nums[j]| <= limit.
There is a directed graph of n nodes with each node labeled from 0 to n – 1. The graph is represented by a 0-indexed 2D integer
You are given a map of a server center, represented as a m * n integer matrix grid, where 1 means that on
You are given an integer matrix isWater of size m x n that represents a map of land and water cells. If isWater[i][j] == 0, cell (i, j) is a land cell. If isWater[i][j]
You are given a 0-indexed 2D array grid of size 2 x n, where grid[r][c] represents the number of points at position (r, c) on the matrix. Two robots
You are given a 0-indexed integer array arr, and an m x n integer matrix mat. arr and mat both contain all the integers in the range [1, m * n]. Go through each
Given an m x n integer matrix heightMap representing the height of each unit cell in a 2D elevation map, return the volume of water