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 a6d7581 commit 73aba40Copy full SHA for 73aba40
graph-valid-tree/Chaedie.py
@@ -9,6 +9,8 @@ class Solution:
9
def validTree(self, n: int, edges: List[List[int]]) -> bool:
10
if not n:
11
return True
12
+ if len(edges) != n - 1:
13
+ return False
14
15
# Make Graph
16
graph = {i: [] for i in range(n)}
0 commit comments