Nodes at even distance


why am i getting segementation fault?
question link-https://practice.geeksforgeeks.org/problems/nodes-at-even-distance/0/?ref=self

you are using adjacency matrix use adjacency list here