https://hack.codingblocks.com/app/practice/1/p/1170
isse me doubt ke explanation hai aur code to hai he
Graph, coding blocks ide, me sara short short explain kardiya
give me some time, i`ll debug the code and let u know
hi,
i have a different approach which is simpler, without use of graph,
if u are comfortable giving a look at my code
i am attaching the link
if still u face problem u could reply below i`ll figure out the possible flaw
apne bhi same hi logic lagaya, ek bar submit karke dekhleta hu
and on line 32 " i " ke jagha " node " kehena chatai ho na ??
yes , and in all subsequent lines where i is written
left bottom blue box me sentence incomplete rehegya === n-1 nodes hi honge kyoki otherwise connected component nahi rahega, aise hi sare components sabka add kardenge and
answer= temple+(nodes-1)*road
road is not always cheap to repair
6 6 2 5 here the cost to build the temple is 2 and that to repair road is 5
so left column 3rd point is not always true
u`ll have to check on this
road > temple wala case2 hai apne case1 ke condition lagade, right column 3rd point ye case apke test case ko explain kara hai in total maine 3 case mention kiye hai
Ya man u are good to go with this logc… i just skipped the condition that was written to the top right
Sorry
U are great to go with this logic !
Great efforts
Brooo this is the code, its working 100%
great efforts galti bas long long int lekhne ke thi instead of int
we should not be commiting this error in the future!