Adjacency Matrix for Undirected Graph - WA

Problem :

My code :

It shows that my code isn’t printing anything. Can anyone please help?

The problem is asking you to first take N, and then take M as input. You are doing it the other way around.
Maybe that’s where the problem lies.

1 Like