I am trying to solve this one particular problem involving basic math. My algorithm works for every other test cases and thus i know its correct. But for one particular input in one of the test cases, the result is wrong. I checked the values by printing them and values are:
a = 1000000000 and b = 999999999
When I do
System.out.print(a*b);
it returns 1808348672.
I have tried doing this:
long ans = (long)a*b;
System.out.print(ans);
It still returns 1808348672