We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
There will be 9996 isolated vertices and another 2 groups of vertices each having 2 vertices in it (a total of 9998 groups).
It is like {0}{5}{6}{7}.....{9998}{9999}{1,2}{3,4} and hence the answer should be (9996 x 9995) + (9996 x 2) + (9996 x 2) + (2 x 2) = 99950008. Where do you think I'm going wrong?
Journey to the Moon
You are viewing a single comment's thread. Return to all comments →
Can someone explain me this test case?
Input:
Output:
49994998
There will be 9996 isolated vertices and another 2 groups of vertices each having 2 vertices in it (a total of 9998 groups).
It is like {0}{5}{6}{7}.....{9998}{9999}{1,2}{3,4} and hence the answer should be (9996 x 9995) + (9996 x 2) + (9996 x 2) + (2 x 2) = 99950008. Where do you think I'm going wrong?