I want to print 0 for the nodes which do not exist but getting some error. Plz look into it.
NODES AT K DISTANCE
here is your corrected code:
i have marked the corrections
if this solves your doubt please mark it as resolved
for
4
60 65 50 70
50 65 60 70
5
50 3
65 2
70 4
60 3
65 1
its giving
70
70
0
0
50
60