Hi i was solving this problem. I even figured out the logic for the following problem . My solution first when i submitted it it gave WA on tc3 but when I again submitted it, it gave WA on tc10 and when I did that again it gave WA on tc12 (no changes were made during the following). is there something wrong with my code. It would be great of someone helped me :)