AI Features

Longest Cycle in a Graph

Try to solve the Longest Cycle in a Graph problem.

Statement

You are given a directed graph with n nodes, labeled from 0 to n - 1. Each node in the graph has at most one outgoing edge.

The graph is described using a 0-indexed integer array edges of length n, where: ...

Ask