Wrong answer for 22?


#1

Why answer for 22 should be 482563003 when the actual answer is 597661206 ??


#2

Check if at any place your (int*int) is crossing the range of Integer.

Switch to long it will fix.