Geek Sundaram in AlgoLand WA

Can anyone please tell me what I’m doing wrong? Solution

Please don’t tell the logic just provide me a test case for which my solution is giving WA.
Here’s the question question

Hey @kunnu120,

One possible mistake would be use of int as it would overflow easily. try using long [10^6*(10^6-1) ~~ 10^12].

Hope this helps!

1 Like

thank you so much, now I got it!!

One more question @sandeep_007, is buffer reader is faster than the scanner?

Sorry, I’m not that familiar with Java.

Okay, that’s fine, thanks for the help though!!