Acessing lists by index in List STL example video

Earlier in a video it was mentioned that we can’t access List by index since it uses random memory.So how are we able to access them now in the List STL Example video.

hi @tushar_sharma1999, you are right for a list we can access its ith node by index ,but in the vedio we made an array of list ,
let me explain you by example :-
when you have
int a[1000];
then a is array of integers

now replace int with list (as list is also a datatype)
we get
list < int> a[1000] ;
now a is array of list

in the vedio we dynamically allocate the memory to list array,
when we do l[x].push_back(make_pair(a,b));
we are inserting at end in the xth list not xth node