Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
2-D array
#1
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
Larz60+ write Jul-11-2022, 02:49 PM:
you other duplicate thread deleted. Double posting is against forum rules.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020