You are given a graph that started as a tree with n nodes. One additional edge has been added, creating a cycle. Your task is to find and return the redundant edge that, when removed, would turn the graph back into a tree.
You are given the root of a binary tree. The task is to find the length of the longest path in the tree where all the nodes in the path have the same value. The path can be anywhere in the tree, not necessarily passing through the root. The path length is determined by the number of edges between the nodes.
You are given a binary matrix of size m x n, where 1 represents land and 0 represents water. An island is a group of 1’s connected horizontally or vertically. Return the area of the largest island. If there are no islands, return 0.
You are given a list of accounts, where each account consists of a name and a list of emails. Merge accounts that share common emails, and return the merged accounts in the format: name followed by sorted emails.
You are given an m x n grid representing an image, where each element in the grid corresponds to a pixel value. Additionally, you’re provided with three integers: sr (starting row), sc (starting column), and color. Your task is to perform a flood fill operation on the image starting at the pixel located at (sr, sc).
You are given a network of n nodes and a list of directed edges with travel times. You need to send a signal from a given node k. Return the minimum time it takes for all nodes to receive the signal, or return -1 if it is impossible.