Https://ide.codingblocks.com/s/49121

sir can you point out the mistake …
it says runtime error…i dont see any fault

Hi Rahul, please share the corresponding link of the question.

https://hack.codingblocks.com/contests/c/471/782

Hi Rahul, you need to work on the logic of your code again because your program is giving wrong answers for various test cases. For example, consider the following cases:

  1. 4 3
    1 2
    1 3
    1 4
    Your code gives 1 as output even when there are no beautiful vertices in this case.

  2. 7 6
    1 2
    2 3
    2 4
    3 5
    3 6
    3 7
    For this case, the answer should be 2 but your code gives answer 1.

@Khushboo can u please go through my code. it passes all the above test cases but it is failing while submitting.