why Wrong ans in RRFRND

link to my solution
This is the link of my solution PLZ tell me what’s wrong with my code or a test case for which it i giving wrong ansl plz help me i and my friends have tried many test cases plz help

//