Its showing wrong on all testcases

please help me to debug the logic