What i want is to first store the given input as follows :-

{{{A,B},{B,C},{C,D}},{{A,C},{C,E},{E,F},{F,P}}}

and then make a check if the pair is present in particular subset of a set.

For e.g if the user can give index 0 and pair {B,C} we need to search the first index value i.e {{A,B},{B,C},{C,D}} and return true or false based on its presence. What data structure i should use. I tried vector but not helping me

Kindly help

{{{A,B},{B,C},{C,D}},{{A,C},{C,E},{E,F},{F,P}}}

and then make a check if the pair is present in particular subset of a set.

For e.g if the user can give index 0 and pair {B,C} we need to search the first index value i.e {{A,B},{B,C},{C,D}} and return true or false based on its presence. What data structure i should use. I tried vector but not helping me

Kindly help