Algorithm for increasing nest | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

Algorithm for increasing nest

lets say a, b, c,....,n are firms. a has 2 partners x and y. b has 2 partners y and z. c has 4 partners z, p, q, r. then a belongs to group, say 1, and b also because y is common and c also because z is common and all other firms where x, p, q or r is partner belong to group 1. so x, y, z, p, q and r all related. given all persons and their firms, algorithm should be able to answer if 2 persons are of same group for eg: a and r

12th Dec 2017, 4:22 PM
Natwar Gaur
Natwar Gaur - avatar
2 Antworten
+ 2
thanks Gordie, appreciate. it gives the basic idea. really helpful.
13th Dec 2017, 5:02 PM
Natwar Gaur
Natwar Gaur - avatar
+ 1
yes Gordie p, q etc are people being partners in those firms...c++ or python anything would do..just trying to frame logic...and last words in question to be read x and r instead a and r...thanx..
13th Dec 2017, 5:21 AM
Natwar Gaur
Natwar Gaur - avatar