Write a program that does the following:
Accept the following inputs:
(1) Number of nodes
(2) A 2-D array representing edges. ith edge connects node input2[0][i] to node input2[1][i].
Assuming that a line can be drawn between nodes if there is an edge between them, print number of lines that can be drawn between nodes.
Sample test case:
input1: 4
input2: {{1,1,1},{2,3,4}}
output1: 3
Accept the following inputs:
(1) Number of nodes
(2) A 2-D array representing edges. ith edge connects node input2[0][i] to node input2[1][i].
Assuming that a line can be drawn between nodes if there is an edge between them, print number of lines that can be drawn between nodes.
Sample test case:
input1: 4
input2: {{1,1,1},{2,3,4}}
output1: 3
Larz60+ write Jul-11-2022, 02:49 PM:
you other duplicate thread deleted. Double posting is against forum rules.
you other duplicate thread deleted. Double posting is against forum rules.