At timestamp 2:00

at line no 9 we have declared vector<pair<int,int>> and same below shouldnt only below one be the vector<pair<int,int>>

No it is syntactically correct. You can specifically define the pointer data type during variable declaration, or you can generally define as done commonly. Basically the pointer will always be of the type of RHS but be referred by the LHS. This is a type of polymorphism called dynamic binding of variables.