my code : https://ideone.com/GpK5tj problem : https://www.spoj.com/problems/FACEFRND i am not getting for which test case it is fail??
You forgot to include #include
You did some double counting I suppose. There are some bob’s friend’s friends that appeared not only once, for example, id 7867.
Here’s an example
3 1 5 2 3 4 5 6 2 2 1 3 3 5 1 2 4 5 6
Expected answer is 3.