Company: juspay_15oct
Difficulty: medium
Network Technician's Mission Problem Description In the city of Techville, a network technician named Sam is tasked with inspecting a newly established network of communication towers. The network is structured as a rooted tree with N towers, with the main control tower located at node 1. This control tower serves as the central hub for all communications. The network is built through various terrains, some of which are marked as hazardous zones. Each tower is either in a safe zone or a hazardous one. The outermost towers (the leaf nodes of the tree) need to be inspected by Sam, but he is cautious and wants to avoid paths that traversethrough too many consecutive hazardous zones. Your task is to help Sam count the number of outermost towers (leaf nodes) he can safely inspect, where the path from the main control tower to the leaf contains no more than M consecutive hazardous zones. It is guaranteed that the given set of edges forms a tree structure Complete the safeViewPoints function