Whats wrong with the code
is this okay?
but its giving output as 0
All test cases passed,tle in last test case
@aatish08,
Yes, it will, because you are doing a redundant work in your algorithm again and again, try to think of optimising by precalculation.
Done thanks for the help