Given an undirected graph with n nodes and a list of edges, plus a list of queries [u, v], return for each query whether an edge directly connects u and v. Return the boolean answers as an array in order. The input is JSON {n, edges, queries}.
Input: JSON {n, edges, queries}.
Output: Array — a boolean per query.
Input: {"n":5,"edges":[[0,1],[0,2],[1,3]],"queries":[[0,1],[1,2],[3,0]]}
Output: [true,false,false]
Explanation: Only the first query is an edge.Input: {"n":2,"edges":[[0,1]],"queries":[[0,1],[1,0]]}
Output: [true,true]
Explanation: Undirected edge both ways.Input: {"n":3,"edges":[],"queries":[[0,1]]}
Output: [false]
Explanation: No edges.1<=n<=10^51<=queries<=10^5undirected