Question: Google | Coding Round (GOCC) - Set2 | July 2021 gocc coding-round google

Google · Question · Posted Jul 2021

Problem - 1 Prime tree You are given an undirected tree T consisting of N nodes rooted at node 1. You have to assign value to each node of the tree such that The assigned value must be a prime number less than or equal to 102 The Sum of values assigned to any pair of adjacent nodes is not a prime number. Task Determine the total number of valid assignments. Since, this number can be very large output it ...

The full answer & interview discussion are available to premium members.

Log in Create a free account