Can you pls find error in my code

I know how to solve it, but I am not able to proceed due to error

@amitqy hey until you dont define graph object by calling the function,you wont get any output,ut will show error ,try completing full code ,then if there is any doubt please ask.

In this question pointer to array of adjacency list is given . I am not able access adj list of any random node.
I’m not able to figure out how to do that.
These are the two ways I’m trying to do that

list t = g.adj[0]; // giving error
list *t = g.adj[0]; // giving error

This a function only problem, object of graph class is given as parameter.

@amitqy hey check out this code,you will get it:
https://ide.codingblocks.com/s/249804

I’m not able to understand in c++ context. Just help me to print adjacency list of any vertex in the graph .
Here is the problem link

@amitqy bro the code is in java and print graph is doing the same thing that you want please check the code.

I am not able to get it because of pointers man. I understood your code.
The point is not printing it, I am not able to do it and not understand why.
Because in this question he has given a pointer to an array of adjacency lists.
I have already solved similar type of question in GFG.

list<int t = g.adj[0]; // --> why I am I not getting error here. I want to know that
list <int *t = g.adj[0]; // --> and here, neither of the two ways I am able to print adj list of vertex 0.

my doubt has been cleared. I request to pls send the feedback link

@amitqy hi bro , listthis indicate that you have taken the value in list and that values are copied in list ,whereas in second part pointer is used to point the list of neighbours .

TypeError Traceback (most recent call last)
in ()
2 team2 = ‘Sunrisers Hyderabad’
3 toss_winner = ‘Sunrisers Hyderabad’
----> 4 inp = [team_encode_dict[‘team1’][team1],team_encode_dict[‘team2’][team2],‘14’,team_encode_dict,[‘toss_winner’][toss_winner],‘2’,‘1’]
5 print(inp)
6 inp = np.array(inp).reshape((1,-1))

TypeError: list indices must be integers or slices, not str.

How to solve this error??