- 2

Problem statement : Write a programme to calculate the number of close loop and open loop. Language- python Sample example

Test Case 1. L1 = [P1,P2] T = [ Lo, ……… ,Ln ] P = (x,y) T = [[19, 30, 269, 30], [19, 280, 19, 30], [269, 280, 19, 280], [269, 30, 269, 280]] Output = 1 Test Case 2. L1 = [P1,P2] T = [ Lo, ……… ,Ln ] P = (x,y) T = [[243, 254, 43, 254], [43, 254, 43, 54], [43, 54, 243, 54], [243, 54, 243, 254], [18, 29, 268, 29], [18, 279, 18, 29], [268, 279, 18, 279], [268, 29, 268, 279]] Output = 2 Test Case 3. L1 = [P1,P2] T = [ Lo, ……… ,Ln ] P = (x,y) T = [[243, 254, 43, 254], [43, 254, 43, 54], [43, 54, 243, 54], [243, 54, 243, 254], [18, 29, 268, 29], [18, 279, 18, 29], [268, 279, 18, 279]]

12th Feb 2021, 11:21 AM
Yogita Patil
Yogita Patil - avatar
3 Answers
+ 2
require more explanation about close loop and open loop definitions and also please try and share where you were not able to understand.
12th Feb 2021, 11:37 AM
NaSaPaKri
NaSaPaKri - avatar
+ 1
i think we need to use a graph ds... find cycles for closed loops...
12th Feb 2021, 11:48 AM
NaSaPaKri
NaSaPaKri - avatar
0
There are set of points and we have to find number of loop forms
12th Feb 2021, 2:16 PM
Yogita Patil
Yogita Patil - avatar