TLE in a two line program in Java....Plz help.


Program Description is available on:

My solution to the problem is :

This is a two line program with a single “for” loop.
Dont know what to do…Plz help.

try to avoid the Math. function…it is very slow…use some loops instead of Math.functions…i think that is the main reason of getting TLE in your program…