How in option 1 we can store graph it is only 1-d array

option one is vector graph[n+1] which is 1-d array but we need 2-d array to store graph

hello @luckypavan

vector< int> graph[n+1];
this declaration is for array of vector, it means at evry index of array u r storing vector (why is basically a kind of 2d array with variable colums).