854 Making A Large Island
Making A Large Island You are given an n x n binary matrix grid. You are allowed to change at most one 0 to be 1. Return the size of the largest island in grid after applying this operation. An...
Making A Large Island You are given an n x n binary matrix grid. You are allowed to change at most one 0 to be 1. Return the size of the largest island in grid after applying this operation. An...
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 given a...
Redundant Connection In this problem, a tree is an undirected graph that is connected and has no cycles. You are given a graph that started as a tree with n nodes labeled from 1 to n, with one a...
Maximum Number of Fish in a Grid 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] fis...
Course Schedule IV 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, bi] indicates tha...
Maximum Employees to Be Invited to a Meeting A company is organizing a meeting and has a list of n employees, waiting to be invited. They have arranged for a large circular table, capable of seat...
Make Lexicographically Smallest Array by Swapping Elements You are given a 0-indexed array of positive integers nums and a positive integer limit. In one operation, you can choose...
Find Eventual Safe States 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 array graph where graph[i] is an integer ...
Count Servers that Communicate You are given a map of a server center, represented as a m * n integer matrix grid, where 1 means that on that cell there is a server and 0 means that it is no serv...
01 Matrix Given an m x n binary matrix mat, return the distance of the nearest *0 for each cell*. The distance between two cells sharing a common edge is 1. Example 1: **Input:** mat = [[...