Skip to content

Commit ea430d1

Browse files
committed
968 添加注释
1 parent 4ff4d1c commit ea430d1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Algorithms/0968.binary-tree-cameras/binary-tree-cameras.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ func minCameraCover(root *TreeNode) int {
1818
res := 0
1919
s := check(root, &res)
2020
if s == isMonitoredByParent {
21+
// root has no parent
22+
// so need itself has a camera
2123
res++
2224
}
2325
return res

0 commit comments

Comments
 (0)