A graph is a set of nodes along with a set of edges connecting the nodes.

Graphs can be directed or undirected. In a directed graph, each edge has a direction whereas, in an undirected graph, edges do not have direction. The graph above is an undirected graph.
Two nodes in a graph are adjacent if there is an edge between them. In the above example, nodes 0 and 1 are adjacent, but 0 and 2 are not adjacent.
We can encode graphs using an adjacency matrix. An adjacency matrix for a graph with "n" nodes is an "n * n" matrix where the entry at row "i" and column "j" is a 0 if nodes "i" and "j" are not adjacent, and 1 if nodes "i" and "j" are adjacent.
In the example above, the adjacency matrix looks like:
{
{ 0, 1, 0, 0 },
{ 1, 0, 1, 1 },
{ 0, 1, 0, 1 },
{ 0, 1, 1, 0 }
}Your task is to determine if two nodes are adjacent in an undirected graph when given the adjacency matrix and the two nodes.

Adjacency Matrix:
{
{ 0, 1, 0, 0 },
{ 1, 0, 1, 1 },
{ 0, 1, 0, 1 },
{ 0, 1, 1, 0 }
}0,1 should return true.0,2 should return false.
{
{ 0, 1, 0, 1, 1 },
{ 1, 0, 1, 0, 0 },
{ 0, 1, 0, 1, 0 },
{ 1, 0, 1, 0, 1 },
{ 1, 0, 0, 1, 0 }
}0,3 should return true.1,4 should return false.