You are viewing a single comment's thread. Return to all comments →
Java 8
return (int)(((n%1000000007)*(n%1000000007))%1000000007);
Seems like cookies are disabled on this browser, please enable them to open this website
Summing the N series
You are viewing a single comment's thread. Return to all comments →
Java 8
return (int)(((n%1000000007)*(n%1000000007))%1000000007);