Google-Developer-Student-Club-CCOEW / Competitive-Programming-2023-GDSC-CUMMINS-X-GDSC-MMCOE

Welcome to the Hacktoberfest 2023 Competitive-Programming Cohort for Cummins College and MMCOE students! To request issue assignment, create a pull request, providing: 1. Full Name 🧑‍🎓 2.Email 📧 3.College ID (RNO) 🔢 4.Branch of Study.📚 5. Year 📆 .The Cummins College and MMCOE students' PRs will be considered only. Thank you!
9 stars 69 forks source link

Binary Tree Cameras #99

Closed soniadessai closed 1 year ago

soniadessai commented 1 year ago

Write code in the preferred language and attach output with it.

You are given the root of a binary tree. We install cameras on the tree nodes where each camera at a node can monitor its parent, itself, and its immediate children.

Return the minimum number of cameras needed to monitor all nodes of the tree.

Example 1:

image

Input: root = [0,0,null,0,0] Output: 1 Explanation: One camera is enough to monitor all nodes if placed as shown.

Example 2:

image

Input: root = [0,0,null,0,null,0,null,null,0] Output: 2 Explanation: At least two cameras are needed to monitor all nodes of the tree. The above image shows one of the valid configurations of camera placement.

sejalphatangare commented 1 year ago

Hi1 pls assign this issue to me Sejal Phatangare UCE2021457 Cummins college of engineering,Pune