SHOWING WA

Question link

and My Answer link

case 2 is showing as wa…WHY??

THANKS IN ADVANCE

Overflow in variable count may occur, as in a given case upto n(n-1)/2 can be answer, and n can be upto 10^5. So count can be as high as 4.99x10^9 which is greater than size of long, and overflow occurs.

Hope this helps. I need upvote to ask a question

NOPE…That’s not an issue…