#261

Graph Valid Tree

medium· Graphsruns: 0

You have an undirected graph of n nodes labeled 0 to n - 1. You are given the integer n and an array of edges where each edges[i] = [a, b] indicates an undirected edge between a and b. Return true if the edges form a valid tree (connected and acyclic with exactly n - 1 edges).

sign in to paste and practice your own solution
desktop only

codedrill is a typing game and needs a real keyboard. open this on a laptop or desktop to practice.

you can still browse problems and sections from your phone.