Beautiful Vertices soln

https://ide.codingblocks.com/#/s/16261
Can someone suggest a test case where my solution gives incorrect answer?