My Code is getting run error in the last test case, please check

My code goes here::

Hello @atreyyash this is the corrected code:
https://ide.codingblocks.com/s/432449