Graph Problem
Anonymous User
1261

Guys can someone help me with this problem.

An undirected graph with nodes representing cities in a country. Assume you have decided to build temples in this country, where the TASK is to build minimum number of temples such that each city has access to a temple in their own city or a neighbor city with a direct connection. Return number of minimum required temples. image

For the above example, Minimum number of temples required are 5 which are 3, 6, 10, 5, 12.

image

For the above example, Minimum number of temples required are 3 which are 1, 3, 5.

Comments (4)