We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Unless someone can explain otherwise, you basically can't do these exercises in JS. The integer range is too big. Can't pass all cases. Here is my code:
varinput=`10\n229137999\n344936985\n681519110\n494844394\n767088309\n307062702\n306074554\n555026606\n4762607\n231677104`;functionprocessData(input){//Enter your code herevarlines=input.split('\n');letT=parseInt(lines.shift());lines.map(function(item){returnparseInt(item);}).forEach(function(n){console.log(Math.pow(n,2)%(Math.pow(10,9)+7));});}processData(input);
Cookie support is required to access HackerRank
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 →
Unless someone can explain otherwise, you basically can't do these exercises in JS. The integer range is too big. Can't pass all cases. Here is my code: