You are viewing a single comment's thread. Return to all comments →
Javascript (Node.js) solution:
let pageno = 1, result = 0; for(let i=0;i<n;i++) { let x = arr[i], j=1, y = x-k; while(y>=-(k-1)) { let lwr = k*(j-1), upr = k* j; if(pageno>lwr && pageno<=upr && pageno<=x) result++; j++; y-=k; pageno++; } } return result;
Seems like cookies are disabled on this browser, please enable them to open this website
Lisa's Workbook
You are viewing a single comment's thread. Return to all comments →
Javascript (Node.js) solution: