Leetcode graphs problem

problem >>https://leetcode.com/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/

Using floyyd warshal but my code is not working can u plz help me to correct it
my code>> https://ide.codingblocks.com/s/484963

hello @joshisanjay8467

a) node are bidirectional . so in matrix (from,to) and (to,from) both the cells must be filled for every edge

b) use some bigger value of weight matrix initilaisation ,smaller value might cause problem.

c) also in output they want city number

1 Like

hi aman bhaiya !! my bad just revised floyyd from notebook there was directional example so used here too … thankyou!!

u can use here as well.
check my solution->

1 Like

thankyou bhaiya for this !!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.