0

Problem

A company has decided to promote interactions between connections in various departments. They have created a number of nodes which are to be connected to form a cluster to find the above information. The nodes are described by a 2D grid of 0's and 1's with n rows and m columns, a cell containing a zero denotes not working, while a cell containing a one is a cell that denotes a working node. i. e. (1 and 0), (0 and1) and(0 and ) have no connections. but (1 and 1) have connection. =>Input Format -The first line contains an integer, n, denoting the number of rows in gridofNodes -The next line contains an integer, m, denoting the number of columns in gridOfNodes -Grid values containing only 1's and 0's =>Input format example 3 7 1011110 0110101 1000001 Sample Output 28 =>Sample Output Explanation 5 nodes in the first row get connected with 4 nodes in the second row, 20 connections. Then 4 nodes in the second row get connected with 2 nodes in the third row, 8 connections 20+8 = 28 connectioms in total

8th Apr 2020, 11:27 AM
Sonu Mittal
Sonu Mittal - avatar
1 Réponse
+ 1
If this is supposed to be a challenge for other users, please move the thread according to the guidelines to your personal feed instead. However, if you need help with creating a program to solve the problem, please provide more information, especially the code that you have done so far in your own attempt to solve it, but also language, requirements, and any other relevant information.
8th Apr 2020, 12:16 PM
Shadow
Shadow - avatar