Can somebody please help and tell me at which point of code I am doing wrong?If somebody atleast give me a test case for which I am getting WA then also it will be helpful?

I have also asked this question before and I am thankful to @tacoder to give me the test case.But even after changing my code after considering his test case I am getting WA.However no. of test cases with WA is reduced from previous submission but they are not completely gone.So, please somebody help!!!

My old code- My new code-