We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6b1606 commit 00206aaCopy full SHA for 00206aa
1 file changed
C++/graph-valid-tree.cpp
@@ -7,6 +7,7 @@ class Solution {
7
int parent;
8
vector<int>neighbors;
9
};
10
+
11
bool validTree(int n, vector<pair<int, int>>& edges) {
12
if (edges.size() != n - 1) {
13
return false;
0 commit comments